-
Notifications
You must be signed in to change notification settings - Fork 26
feat: application summary page #431
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
Open
brunomenezes
wants to merge
11
commits into
main
Choose a base branch
from
feat/application-summary-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9675d51
feat(dave): Add summary support components and react-spring as new deps.
brunomenezes 357c386
feat(dave): Add application summary page. Include page Story.
brunomenezes d22979c
refactor(dave): Adjust link generation for hierarchy and other parts.
brunomenezes a9c692e
refactor: Extend Spoiler in the ui-theme with defaults.
brunomenezes e982dda
refactor: remove negative offset for the hierarchy and make page-titl…
brunomenezes 28b71b6
refactor: Reuse QueryPagination in the OutputsList component.
brunomenezes 48159bc
refactor: Safer divisions and clear logic for hiding the content.
brunomenezes a9d974f
refactor: Use theme icon sizes.
brunomenezes f20c629
fix: Missing commitments that cause unwanted message to display.
brunomenezes c353fd1
refactor: Storybook to sync dark/light mode between toolbar and the U…
brunomenezes 8cd61ac
chore: Ignore the generated content on prettier checks.
brunomenezes 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,5 @@ node_modules | |
| .storybook | ||
| graphql | ||
| contracts.ts | ||
| **/src/generated/** | ||
| **/rollups-wagmi/src/index.tsx | ||
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
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,6 @@ | ||
| import { ApplicationSummaryContainer } from "../../../containers/ApplicationSummaryContainer"; | ||
|
|
||
| export default async function Page(props: PageProps<"/apps/[application]">) { | ||
| const { application } = await props.params; | ||
| return <ApplicationSummaryContainer application={application} />; | ||
| } |
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,28 @@ | ||
| import { | ||
| Card, | ||
| Center, | ||
| Text, | ||
| type CardProps, | ||
| type TextProps, | ||
| } from "@mantine/core"; | ||
| import type { FC } from "react"; | ||
|
|
||
| interface CenteredTextProps { | ||
| text: string; | ||
| cardProps?: CardProps; | ||
| textProps?: TextProps; | ||
| } | ||
|
|
||
| const CenteredText: FC<CenteredTextProps> = (props) => { | ||
| return ( | ||
| <Card shadow="md" {...props.cardProps}> | ||
| <Center> | ||
| <Text c="dimmed" size="xl" tt="uppercase" {...props.textProps}> | ||
| {props.text} | ||
| </Text> | ||
| </Center> | ||
| </Card> | ||
| ); | ||
| }; | ||
|
|
||
| export default CenteredText; |
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,44 @@ | ||
| "use client"; | ||
| import { Card, Flex, Skeleton, Text } from "@mantine/core"; | ||
| import { type FC } from "react"; | ||
| import { type IconType } from "react-icons"; | ||
| import TweenedNumber from "./TweenedNumber"; | ||
|
|
||
| export type SummaryCardProps = { | ||
| icon?: IconType; | ||
| title: string; | ||
| value: number; | ||
| displaySkeleton: boolean; | ||
| }; | ||
|
|
||
| const SummarySkeletonCard = () => ( | ||
| <Card shadow="xs" w="100%"> | ||
| <Skeleton animate={false} height={20} circle mb={18} /> | ||
| <Skeleton animate={false} height={8} radius="xl" /> | ||
| <Skeleton animate={false} height={8} mt={6} radius="xl" /> | ||
| <Skeleton animate={false} height={8} mt={6} width="70%" radius="xl" /> | ||
| </Card> | ||
| ); | ||
|
|
||
| export const SummaryCard: FC<SummaryCardProps> = (props) => { | ||
| if (props.displaySkeleton) return <SummarySkeletonCard />; | ||
|
|
||
| return ( | ||
| <Card key={`${props.title}-summary`} shadow="xs"> | ||
| <Flex gap={5} align="center"> | ||
| {props.icon && ( | ||
| <props.icon | ||
| size={28} | ||
| data-testid={`summary-card-${props.title?.toLowerCase()}-icon`} | ||
| /> | ||
| )} | ||
| <Text c="dimmed" size="lg" inline> | ||
| {props.title} | ||
| </Text> | ||
| </Flex> | ||
| <Text fw="bold" fz="2rem"> | ||
| <TweenedNumber value={props.value} /> | ||
| </Text> | ||
| </Card> | ||
| ); | ||
| }; |
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,19 @@ | ||
| "use client"; | ||
| import { animated, useSpring } from "@react-spring/web"; | ||
|
|
||
| interface TweenedNumberProps { | ||
| value: number; | ||
| } | ||
|
|
||
| const TweenedNumber = ({ value }: TweenedNumberProps) => { | ||
| const { number } = useSpring({ | ||
| from: { number: 0 }, | ||
| number: value, | ||
| delay: 200, | ||
| config: { mass: 1, tension: 20, friction: 10 }, | ||
| }); | ||
|
|
||
| return <animated.span>{number.to((n) => n.toFixed(0))}</animated.span>; | ||
| }; | ||
|
|
||
| export default TweenedNumber; |
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
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.
Uh oh!
There was an error while loading. Please reload this page.