-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: LuizAsFight <[email protected]>
- Loading branch information
1 parent
7159c5b
commit 857ec11
Showing
101 changed files
with
1,739 additions
and
743 deletions.
There are no files selected for viewing
89 changes: 26 additions & 63 deletions
89
packages/app-commons/src/components/PageTitle/PageTitle.tsx
This file contains 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 |
---|---|---|
@@ -1,72 +1,35 @@ | ||
'use client'; | ||
import type { BaseProps } from '@fuels/ui'; | ||
import { Badge, HStack, Heading } from '@fuels/ui'; | ||
import { tv } from 'tailwind-variants'; | ||
import { Flex, HStack, HStackProps, Text } from '@fuels/ui'; | ||
|
||
export type PageTitleProps = BaseProps<{ | ||
as?: string; | ||
size?: '1' | '2' | '3'; | ||
children: React.ReactNode; | ||
icon?: React.ReactNode; | ||
rightElement?: React.ReactNode; | ||
}>; | ||
export type PageTitleProps = { | ||
title: string; | ||
children?: React.ReactNode; | ||
subtitle?: React.ReactNode; | ||
inverse?: boolean; | ||
mb?: HStackProps['mb']; | ||
}; | ||
|
||
export function PageTitle({ | ||
title, | ||
children, | ||
as = 'h2', | ||
size = '1', | ||
icon, | ||
rightElement, | ||
className, | ||
subtitle, | ||
inverse = false, | ||
mb = '7', | ||
}: PageTitleProps) { | ||
const classes = styles({ size }); | ||
return ( | ||
<Heading as={as} className={classes.root({ className })}> | ||
{icon && ( | ||
<Badge color="gray" size="2" className={classes.icon()}> | ||
{icon} | ||
</Badge> | ||
)} | ||
<HStack className={classes.title()}>{children}</HStack> | ||
<div className="flex items-center h-full tablet:self-center"> | ||
{rightElement} | ||
</div> | ||
</Heading> | ||
<HStack justify="between" mb={mb}> | ||
<Flex gap="2" direction={inverse ? 'column-reverse' : 'column'}> | ||
<Text as="h1" className="font-mono" size="5"> | ||
{title} | ||
</Text> | ||
{subtitle && ( | ||
<Text as="div" color="gray" size="2"> | ||
{subtitle} | ||
</Text> | ||
)} | ||
</Flex> | ||
|
||
{children} | ||
</HStack> | ||
); | ||
} | ||
|
||
const styles = tv({ | ||
slots: { | ||
root: [ | ||
'first:mb-8 flex items-center justify-between gap-2', | ||
'border-border border-b', | ||
'tablet:flex-nowrap tablet:gap-4', | ||
], | ||
icon: ['h-full flex-shrink-0 px-2', 'tablet:self-start tablet:mt-1.5'], | ||
title: [ | ||
'items-center basis-full gap-3 order-3 flex-shrink-0 justify-between', | ||
'tablet:flex-col tablet:items-start tablet:gap-0', | ||
'text-[1.7rem] tablet:text-[2rem] laptop:text-[2.2rem]', | ||
'tablet:order-none tablet:flex-1 tablet:justify-start', | ||
], | ||
}, | ||
variants: { | ||
size: { | ||
'1': { | ||
root: 'flex-wrap pb-2 tablet:pb-4', | ||
title: 'text-[1.7rem] tablet:text-[2rem] laptop:text-[2.2rem]', | ||
}, | ||
'2': { | ||
title: 'text-[1.4rem] tablet:text-[1.7rem] laptop:text-[1.9rem]', | ||
root: 'pb-2 tablet:pb-4', | ||
}, | ||
'3': { | ||
title: 'text-[1.2rem] tablet:text-[1.4rem] laptop:text-[1.6rem]', | ||
root: 'pb-2', | ||
}, | ||
}, | ||
}, | ||
defaultVariants: { | ||
size: '1', | ||
}, | ||
}); |
This file contains 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 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
Binary file not shown.
Binary file not shown.
This file contains 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 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 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 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 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
11 changes: 4 additions & 7 deletions
11
packages/app-explorer/src/systems/Account/components/AccountTitle/AccountTitle.tsx
This file contains 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 |
---|---|---|
@@ -1,18 +1,15 @@ | ||
'use client'; | ||
|
||
import { Address, useBreakpoints } from '@fuels/ui'; | ||
import { IconHash } from '@tabler/icons-react'; | ||
import { PageTitle } from 'app-commons'; | ||
|
||
export function AccountTitle({ id }: { id: string }) { | ||
const { isLaptop } = useBreakpoints(); | ||
|
||
return ( | ||
<PageTitle | ||
icon={<IconHash size={20} stroke={1.2} />} | ||
className="border-b-gray-3" | ||
> | ||
Account | ||
<Address full={isLaptop} value={id} /> | ||
</PageTitle> | ||
title="Account" | ||
subtitle={<Address full={isLaptop} value={id} />} | ||
/> | ||
); | ||
} |
This file contains 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 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
11 changes: 2 additions & 9 deletions
11
packages/app-explorer/src/systems/Bridge/components/BridgeScreenLoader.tsx
This file contains 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 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.