forked from Code-4-Community/scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 0
[SSF-202] Dashboard Stats #183
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6e45629
Add empty state components for dashboard
jxuistrying 07fce24
connected dashboard stats to API endpoint to display top 4 stats
jxuistrying 4a18736
Merge branch 'main' into jx/SSF-202-dashboard-stats
jxuistrying 55ffb39
Address PR review comments: rename empty state files to camelCase, fi…
jxuistrying 8133dfe
move userStates to own try catch for more accurate error messages
jxuistrying 32c59f9
Merge main into SSF-202, keep stats feature with correct API calls
jxuistrying 7dde91d
Revert husky files to main
jxuistrying File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import React from 'react'; | ||
| import { Box, Button, Text } from '@chakra-ui/react'; | ||
| import { CircleCheck } from 'lucide-react'; | ||
| import { useNavigate } from 'react-router-dom'; | ||
|
|
||
| interface PageEmptyStateProps { | ||
| entity?: string; | ||
| subtitle?: string; | ||
| primaryButtonText: string; | ||
| primaryButtonLink: string; | ||
| secondaryButtonText: string; | ||
| secondaryButtonLink: string; | ||
| } | ||
|
|
||
| const PageEmptyState: React.FC<PageEmptyStateProps> = ({ | ||
| entity, | ||
| subtitle, | ||
| primaryButtonText, | ||
| primaryButtonLink, | ||
| secondaryButtonText, | ||
| secondaryButtonLink, | ||
| }) => { | ||
| const navigate = useNavigate(); | ||
| const message = subtitle ?? `You have no ${entity} at this time`; | ||
|
|
||
| return ( | ||
| <Box | ||
| display="flex" | ||
| flexDirection="column" | ||
| alignItems="center" | ||
| justifyContent="center" | ||
| textAlign="center" | ||
| py={10} | ||
| gap={2} | ||
| > | ||
| <Box mb={2}> | ||
| <CircleCheck size={24} color="var(--chakra-colors-neutral-800)" /> | ||
| </Box> | ||
| <Text fontWeight="600" textStyle="p" color="neutral.800"> | ||
| Nothing to see here! | ||
| </Text> | ||
| <Text textStyle="p2" color="neutral.700" fontWeight="400"> | ||
| {message} | ||
| </Text> | ||
| <Box display="flex" gap={3} mt={4}> | ||
| <Button | ||
| size="sm" | ||
| bg="neutral.700" | ||
| color="white" | ||
| _hover={{ bg: 'neutral.800' }} | ||
| onClick={() => navigate(primaryButtonLink)} | ||
| > | ||
| {primaryButtonText} | ||
| </Button> | ||
| <Button | ||
| size="sm" | ||
| variant="outline" | ||
| borderColor="neutral.200" | ||
| color="neutral.700" | ||
| _hover={{ bg: 'neutral.50' }} | ||
| onClick={() => navigate(secondaryButtonLink)} | ||
| > | ||
| {secondaryButtonText} | ||
| </Button> | ||
| </Box> | ||
| </Box> | ||
| ); | ||
| }; | ||
|
|
||
| export default PageEmptyState; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { Box, Text } from '@chakra-ui/react'; | ||
|
|
||
| interface EmptyStateProps { | ||
| entity?: string; | ||
| subtitle?: string; | ||
| } | ||
|
|
||
| const SectionEmptyState: React.FC<EmptyStateProps> = ({ entity, subtitle }) => { | ||
| const message = subtitle ?? `You have no ${entity} at this time`; | ||
| return ( | ||
| <Box | ||
| display="flex" | ||
| flexDirection="column" | ||
| alignItems="center" | ||
| justifyContent="center" | ||
| textAlign="center" | ||
| py={10} | ||
| gap={2} | ||
| > | ||
| <Text fontWeight="600" textStyle="p" color="neutral.800"> | ||
| Nothing to see here! | ||
| </Text> | ||
| <Text textStyle="p2" color="neutral.700" fontWeight="400"> | ||
| {message} | ||
| </Text> | ||
| </Box> | ||
| ); | ||
| }; | ||
|
|
||
| export default SectionEmptyState; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls remove these duplicate files / changes of your other pr!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the dashboards need the pageEmptyState and sectionEmptyState files so should i wait until my ssf-206 merges