Skip to content

[SSF-206] Add empty state components for dashboard#181

Open
jxuistrying wants to merge 1 commit into
mainfrom
jx/SSF-206-empty-state-components
Open

[SSF-206] Add empty state components for dashboard#181
jxuistrying wants to merge 1 commit into
mainfrom
jx/SSF-206-empty-state-components

Conversation

@jxuistrying
Copy link
Copy Markdown

ℹ️ Issue

Closes #206

📝 Description

I implemented SectionEmptyState and PageEmptyState components to update the ui when there isn't any data to display to users.

  1. Created SectionEmptyState component for section-level empty states
  2. Created PageEmptyState for page-level empty states
  3. Updated Admin dashboard to show empty state for pending actions, recent orders and recent donations sections
  4. Updated Volunteer dashboard to show empty state
  5. Updated Pantry dashboard to show empty state

✔️ Verification

Tested empty state by setting conditionals that check if a section is empty to true

Dashboard empty state
image

Section empty state
image

🏕️ (Optional) Future Work / Notes

I had trouble testing Pantry dashboard specifically if(!pantry) { return null } in apps/frontend/src/containers/pantryDashboard.tsx made it so that the empty state message doesnt show so I added an error message for when there isn't data to display which seems to fix the empty state message not showing but I don't think that error message is needed.

@jxuistrying jxuistrying changed the title Add empty state components for dashboard [SSF-206]Add empty state components for dashboard May 24, 2026
@jxuistrying jxuistrying changed the title [SSF-206]Add empty state components for dashboard [SSF-206] Add empty state components for dashboard May 24, 2026
@jiang-h-y jiang-h-y self-requested a review May 24, 2026 17:06
@Yurika-Kan Yurika-Kan self-assigned this May 25, 2026
Copy link
Copy Markdown

@jiang-h-y jiang-h-y May 27, 2026

Choose a reason for hiding this comment

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

Make sure you implement the empty-state dashboard for FMs too

Edit: Sorry, just realized the FM dashboard isn't merged yet. Not sure if we want to wait to merge this PR until we can also add an empty state for the FM dashboard.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes fm dashboard should be in soon~ let's wait to merge until we can add empty state there!

</Box>
{isPageEmpty ? (
<PageEmptyState
subtitle="You have no orders or applications to review at this time."
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure if this is strictly necessary, but it might be good to pass in the entity to PageEmptyState and SectionEmptyState instead of hard coding the entire subtitle.

e.g. You have no {entity} at this time.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

im liking the sound of dis

@Yurika-Kan Yurika-Kan self-requested a review May 29, 2026 06:24
Copy link
Copy Markdown
Collaborator

@Yurika-Kan Yurika-Kan left a comment

Choose a reason for hiding this comment

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

awesome job implementing this! tested pages & overall a great first pr ><

commented on matching the figma, edge cases, and frontend styling!

take a look at apps/frontend/src/theme.ts for our repo design system

  • specifically we use <Text textStyle="p2 (...etc)"> and <Heading textStyle="h1 (...etc)"> instead of hardcoding fontSize, fontWeight, fontFamily
  • we also have color tokens there to use instead of hardcoding hex numbers
  • we have our font tokens there wired so we also don't have to hardcode those

can you update the styling to follow our conventions? ik seems tomato tomato but routing all styling through one source makes the app easier to maintain, extend, and look at :)

<CircleCheck size={24} color="#262626" />
</Box>
<Box fontWeight="600" fontSize="lg" color="neutral.800">
Nothing to see here.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit - designs end with exclamation mark instead of period

gap={2}
>
<Box mb={2}>
<CircleCheck size={24} color="#262626" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: designs don't have the circle check for section empty states!

</Box>
<Box display="flex" gap={3} mt={4}>
<Button
bg="neutral.700"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we make this size=sm to match the thinner designed buttons?

nice job using our repo frontend values here~

{primaryButtonText}
</Button>
<Button
bg="neutral.300"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

add size="sm" here too
remove bg color -> white/clear in design
define the button by setting it to outline & defining border color.

good example is the outline button in adminOrderManagement.tsx:387-394 - take their outline and border (variant="outline", borderColor="") use neutral.200 as border color.

{isPageEmpty ? (
<PageEmptyState
subtitle="You have no food requests or orders at this time."
primaryButtonText="View Assigned Pantries"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

design says: "View Pantries" - can we reflect that here?

justifyContent="center"
textAlign="center"
fontFamily="'Inter', sans-serif"
fontSize="sm"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we also have project pixel defined scale values of textStyle = "p/ p2/ p3/ h4" ~ consider which one would fit the best for this size!

<Box mb={2}>
<CircleCheck size={24} color="#262626" />
</Box>
<Box fontWeight="600" fontSize="lg" color="neutral.800">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use for text content - it's also what makes the testStyle work!

gap={2}
>
<Box mb={2}>
<CircleCheck size={24} color="#262626" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use neutral.800 here!

<Heading textStyle="h1" color="gray.600" mb={6}>
Pantry Dashboard
</Heading>
<PageEmptyState
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

when a pantry fetch fails (!pantry), this is an early return over line 88 which renders an error message toast. can we remove this block so the default for this case is the alert?

</Box>
{isPageEmpty ? (
<PageEmptyState
subtitle="You have no orders or applications to review at this time."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit drop the period!

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