Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tables example repo #91

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

asun1234
Copy link

@asun1234 asun1234 commented Jan 4, 2025

Issue

Goal is to create a new Table(s) example for the sample repo I've forked. Did a bit more than UI and added actual search functionality for Name and Publish Status to filter the table. Also, added pagination and guide buttons to the table.

Things to highlight in this example from product and design:

  • If a button is needed, our recommendation is to use an extra-small secondary button.
  • In a table row, the button should be right aligned
  • Search bar goes to the top left of the table.
  • Enable scrolling by having the width="min" in the TableCell and TableHead (example here)

Screenshot:
Screenshot 2025-01-05 at 1 23 15 AM

Screenshot 2025-01-05 at 1 19 09 AM

@asun1234 asun1234 marked this pull request as ready for review January 4, 2025 16:24
Copy link

@Randyjp Randyjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding search functionality has introduced a few interesting edge cases, and I'm unsure if we want to address them here. My first question is:

  • Do we need or want paginated search in this example?
    If not, we could consider removing pagination entirely, which might simplify things.

Assuming that paginated search is a crucial part of this example, we need to handle the following:

  1. Paginator State Matching Available Data:
    The paginator must reflect the search results accurately. For instance:

    • If the search returns only one item, the paginator should display a single page, and the navigation buttons should be disabled.
  2. Handling No Results:
    If the search yields no results, we should display an empty state indicator to inform users.

));

const TableExampleCard = () => {
const tableData = [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move tableData outside of the component

@@ -0,0 +1,17 @@
# HubSpot Getting Started Project Template
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as the other PR re: getting Product & UX content for this README so it matches other examples

const [search, setSearch] = useState("");
const [data, setData] = useState(tableData);

// Search for both name and publish status match, case insensitive
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation

Suggested change
// Search for both name and publish status match, case insensitive
// Search for both name and publish status match, case insensitive

<Heading>Table Example</Heading>
<Text>
Tables can be tricky, especially as they grow in complexity and size.
This is an example of how to input, buttons, and scrolling can be
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: typo?

Suggested change
This is an example of how to input, buttons, and scrolling can be
This is an example of how input, buttons, and scrolling can be

</Text>

<Flex direction="row"
>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: line-wrapping issue

/>
<Flex
justify="end"
>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend getting your prettier config setup and setting your editor to auto-fix on save so you don't have to worry about spacing and indentation like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants