-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Closes #1320 - Closes #1369 - Closes #1291 Co-authored-by: Luiz Gomes <[email protected]> Co-authored-by: LuizAsFight <[email protected]>
- Loading branch information
1 parent
3966aa9
commit 831e3d2
Showing
14 changed files
with
253 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { DOWNLOAD_LINK } from '../constants'; | ||
|
||
import { WALLET_DOWNLOAD_PATH } from '../constants'; | ||
import { useExtensionTitle } from '../hooks/useExtensionTitle'; | ||
import { Link } from './Link'; | ||
|
||
export function DownloadWalletZip() { | ||
return ( | ||
<Link href={DOWNLOAD_LINK} download> | ||
FuelWallet zip file | ||
</Link> | ||
); | ||
const title = useExtensionTitle(); | ||
|
||
return <Link href={WALLET_DOWNLOAD_PATH}>{`${title} zip file`}</Link>; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { Button, Dropdown, Icon, IconButton } from '@fuel-ui/react'; | ||
import { usePathname } from 'next/navigation'; | ||
import { useCurrentEnv } from '~/src/hooks/useCurrentEnv'; | ||
import { | ||
Environment, | ||
WALLET_LINK_NEXT, | ||
WALLET_LINK_PROD, | ||
WALLET_LINK_STAGING, | ||
} from '../constants'; | ||
import { HeaderFuelBranding } from './HeaderFuelBranding'; | ||
|
||
const environmentsTitles: Record<Environment, string> = { | ||
[Environment.PRODUCTION]: 'Fuel Wallet', | ||
[Environment.NEXT]: 'Fuel Wallet Next', | ||
[Environment.STAGING]: 'Fuel Wallet Development', | ||
}; | ||
|
||
const environments: Array<Environment> = Object.values(Environment); | ||
|
||
export function FuelBrandingDropdown() { | ||
const currentEnv = useCurrentEnv(); | ||
const currentPath = usePathname(); | ||
const onSelect = (e: Environment) => { | ||
switch (e) { | ||
case Environment.STAGING: | ||
window.location.href = `${WALLET_LINK_STAGING}${currentPath}`; | ||
break; | ||
case Environment.NEXT: | ||
window.location.href = `${WALLET_LINK_NEXT}${currentPath}`; | ||
break; | ||
default: | ||
window.location.href = `${WALLET_LINK_PROD}${currentPath}`; | ||
} | ||
}; | ||
|
||
return ( | ||
<Dropdown | ||
popoverProps={{ | ||
alignOffset: -10, | ||
align: 'start', | ||
sideOffset: -10, | ||
}} | ||
> | ||
<Dropdown.Trigger asChild> | ||
<Button | ||
variant="link" | ||
aria-label="Change Environment" | ||
css={{ | ||
borderWidth: '0px', | ||
backgorundColor: 'transparent', | ||
alignItems: 'center', | ||
gap: '$2', | ||
flexDirection: 'row', | ||
color: 'transparent', | ||
border: 'none', | ||
'&:hover': { | ||
color: 'transparent !important', | ||
border: 'none !important', | ||
}, | ||
'&:focus-visible': { | ||
outline: 'none', | ||
}, | ||
}} | ||
> | ||
<HeaderFuelBranding title={environmentsTitles[currentEnv]} /> | ||
<Icon icon="ChevronDown" /> | ||
</Button> | ||
</Dropdown.Trigger> | ||
<Dropdown.Menu | ||
css={{ | ||
gap: '$2', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}} | ||
onAction={(e) => { | ||
onSelect(e as Environment); | ||
}} | ||
> | ||
{environments.map((env) => ( | ||
<Dropdown.MenuItem | ||
key={env} | ||
textValue={environmentsTitles[env]} | ||
aria-label={`fuel_environment-dropdown-item-${env}`} | ||
css={{ | ||
paddingTop: '$3', | ||
paddingBottom: '$3', | ||
}} | ||
> | ||
<HeaderFuelBranding title={environmentsTitles[env]} /> | ||
</Dropdown.MenuItem> | ||
))} | ||
</Dropdown.Menu> | ||
</Dropdown> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { cssObj } from '@fuel-ui/css'; | ||
import { Box, FuelLogo } from '@fuel-ui/react'; | ||
|
||
export function HeaderFuelBranding({ | ||
title = 'Fuel Wallet', | ||
}: { title: string }) { | ||
return ( | ||
<Box.Flex css={{ alignItems: 'center' }}> | ||
<FuelLogo size={40} /> | ||
<Box.Flex css={styles.logoText}> | ||
<span>{title}</span> | ||
<Box as="span" css={styles.version}> | ||
beta | ||
</Box> | ||
</Box.Flex> | ||
</Box.Flex> | ||
); | ||
} | ||
|
||
const styles = { | ||
logoText: cssObj({ | ||
pl: '$6', | ||
alignItems: 'center', | ||
flex: 1, | ||
fontSize: '$2xl', | ||
fontWeight: '$normal', | ||
color: 'white', | ||
letterSpacing: '-0.05em', | ||
}), | ||
version: cssObj({ | ||
ml: '$2', | ||
color: '$intentsBase8', | ||
fontSize: '$sm', | ||
fontStyle: 'italic', | ||
}), | ||
}; |
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
Oops, something went wrong.