Skip to content
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

Design #62

Merged
merged 47 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
943c5a5
wip-1
andreivcodes Aug 4, 2024
5e582e1
wip-2
andreivcodes Aug 4, 2024
b5b0ad7
wip-3
andreivcodes Aug 4, 2024
4c9b817
wip-4
andreivcodes Aug 5, 2024
be944e9
wip-5
andreivcodes Aug 5, 2024
68c8ce9
wip-6
andreivcodes Aug 5, 2024
811af94
wip-7
andreivcodes Aug 5, 2024
10f3a63
wip-8
andreivcodes Aug 5, 2024
4a28133
txs
andreivcodes Aug 5, 2024
7dcc1a0
Update RewardListItem.tsx
andreivcodes Aug 5, 2024
3757ad6
Update NetworksSeletion.tsx
andreivcodes Aug 5, 2024
67856d6
Update WelcomeScreen.tsx
andreivcodes Aug 5, 2024
3716e5c
wip-9
andreivcodes Aug 5, 2024
59845df
Update RewardListItem.tsx
andreivcodes Aug 5, 2024
675f223
wip-10
andreivcodes Aug 5, 2024
09c2890
wip-11
andreivcodes Aug 5, 2024
ce8ba8c
Update checkbox.ts
andreivcodes Aug 5, 2024
a589531
Merge branch 'main' into design
andreivcodes Aug 5, 2024
688ef41
Update WalletScreen.tsx
andreivcodes Aug 5, 2024
3442b02
mobile-1
andreivcodes Aug 5, 2024
9182fa6
alignment
andreivcodes Aug 5, 2024
58d1339
padding
andreivcodes Aug 5, 2024
b04acd9
Update KeyManager.tsx
andreivcodes Aug 5, 2024
47c98a9
mobile
andreivcodes Aug 5, 2024
89557df
mobile fixes
andreivcodes Aug 5, 2024
b836169
vault unlocked amounts
andreivcodes Aug 6, 2024
e7325ec
ledger connector
andreivcodes Aug 14, 2024
c644cf1
responsive key manager buttons
andreivcodes Aug 14, 2024
2986006
design changes
andreivcodes Aug 19, 2024
ea803bb
icon sizes
andreivcodes Aug 19, 2024
1420e04
paddings
andreivcodes Aug 19, 2024
2592a69
layout tweaks
andreivcodes Aug 19, 2024
9398506
layout and theme tweaks
andreivcodes Aug 25, 2024
2d1611e
Update UnlockScreen.tsx
andreivcodes Aug 25, 2024
f43ffb2
whitepill input text color
andreivcodes Aug 26, 2024
6d12f47
mnemonic visibility
andreivcodes Aug 26, 2024
8235e0f
Update CreateMnemonicScreen.tsx
andreivcodes Aug 26, 2024
85d677c
smaller modals
andreivcodes Aug 26, 2024
d171c23
design updates
andreivcodes Aug 27, 2024
376d3c7
design updates
andreivcodes Aug 27, 2024
9e5e12d
design updates
andreivcodes Aug 28, 2024
966fb2a
ledger design updates
andreivcodes Aug 28, 2024
0c8d9c8
Merge branch 'main' into design
andreivcodes Aug 28, 2024
cea2c28
yarn
andreivcodes Aug 28, 2024
1cf4420
review updates
andreivcodes Aug 29, 2024
44c9011
password placeholder color
andreivcodes Aug 29, 2024
2344f8c
network selector, buttons sizes, chevron alignment
andreivcodes Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
"cz": "cz"
},
"dependencies": {
"@chakra-ui/anatomy": "^2.2.2",
"@chakra-ui/icons": "^2.0.17",
"@chakra-ui/react": "^2.4.9",
"@chakra-ui/styled-system": "^2.9.2",
"@emotion/react": "^11.8.1",
"@emotion/styled": "^11.8.1",
"@hookform/resolvers": "^3.4.0",
Expand Down
Binary file added public/fonts/Univers LT W01 45 Light.otf
Binary file not shown.
Binary file added public/fonts/Univers LT W01 55 Roman.otf
Binary file not shown.
Binary file not shown.
Binary file added public/fonts/Univers LT W01 65 Bold.otf
Binary file not shown.
Binary file added public/fonts/Univers LT W01 93 X Black Ext.otf
Binary file not shown.
10 changes: 6 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { createHashRouter, redirect, RouterProvider } from 'react-router-dom';

import { ChakraProvider, ColorModeScript, Container } from '@chakra-ui/react';
import { ChakraProvider, ColorModeScript, Flex } from '@chakra-ui/react';

import IdleAlert from './components/IdleAlert';
import CreateMnemonicScreen from './screens/createWallet/CreateMnemonicScreen';
Expand All @@ -17,6 +17,7 @@ import ImportScreen from './screens/welcome/ImportScreen';
import WelcomeScreen from './screens/welcome/WelcomeScreen';
import WelcomeWrapper from './screens/welcome/WelcomeWrapper';
import useWallet from './store/useWallet';
import Fonts from './theme/Fonts';
import theme from './theme';

function App(): JSX.Element {
Expand Down Expand Up @@ -104,17 +105,18 @@ function App(): JSX.Element {

return (
<ChakraProvider theme={theme}>
<Fonts />
<ColorModeScript initialColorMode={theme.config.initialColorMode} />
<IdleAlert />
<Container
display="flex"
<Flex
flexDirection="column"
alignItems="center"
minH="100vh"
w="100vw"
p={4}
>
<RouterProvider router={router} />
</Container>
</Flex>
</ChakraProvider>
);
}
Expand Down
30 changes: 19 additions & 11 deletions src/assets/logo_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 11 additions & 6 deletions src/components/AccountSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {
MenuItemOption,
MenuList,
MenuOptionGroup,
useBreakpointValue,
} from '@chakra-ui/react';
import { IconChevronDown } from '@tabler/icons-react';

import { useCurrentHRP } from '../hooks/useNetworkSelectors';
import { useAccountsList } from '../hooks/useWalletSelectors';
Expand All @@ -23,19 +25,22 @@ function AccountSelection(): JSX.Element {
const { selectedAccount, selectAccount } = useWallet();
const hrp = useCurrentHRP();
const accounts = useAccountsList(hrp);
const iconSize = useBreakpointValue({ base: 14, md: 24 }, { ssr: false });

return (
<Menu>
<MenuButton
as={Button}
variant="outline"
ml={2}
mb={2}
textTransform="uppercase"
fontSize="xx-small"
variant="ghostGreen"
fontSize={{ base: '18px', md: '22px' }}
Copy link
Member

Choose a reason for hiding this comment

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

Let's use named sizes instead of pixels, e.g.:

Suggested change
fontSize={{ base: '18px', md: '22px' }}
fontSize={{ base: 'lg', md: 'x-large' }}

float="right"
rightIcon={<IconChevronDown size={iconSize} />}
px={0}
noOfLines={1}
justifyContent="center"
display="flex"
>
Switch
{accounts[selectedAccount]?.displayName ?? 'Switch account'}
</MenuButton>
<MenuList minWidth={240} maxW="100vw" maxH="80vh" overflow="auto">
<MenuOptionGroup
Expand Down
8 changes: 5 additions & 3 deletions src/components/AddNetworkDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ function AddNetworkDrawer({ isOpen, onClose }: Props): JSX.Element {
}
>
{!!apiError && (
<FormHelperText color="red">{apiError}</FormHelperText>
<FormHelperText textColor="brand.red">
{apiError}
</FormHelperText>
)}
</FormInput>
<FormInput
Expand Down Expand Up @@ -209,10 +211,10 @@ function AddNetworkDrawer({ isOpen, onClose }: Props): JSX.Element {
</DrawerBody>

<DrawerFooter>
<Button variant="outline" mr={3} onClick={close}>
<Button variant="whiteModal" mr={3} onClick={close}>
Copy link
Member

Choose a reason for hiding this comment

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

I don't like that all primary buttons and secondary ones (like Cancel / Back) now looks the same...

Cancel
</Button>
<Button type="submit" colorScheme="green" onClick={onSubmit}>
<Button type="submit" variant="whiteModal" onClick={onSubmit}>
Copy link
Member

Choose a reason for hiding this comment

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

And if it is a kinda standard style for the button (except some specific cases like buttons in the create wallet flow) — then mb let's make it default and don't put in every button?

Save
</Button>
</DrawerFooter>
Expand Down
1 change: 1 addition & 0 deletions src/components/BackButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function BackButton({ onClick = noop }: Props): JSX.Element {
onClick();
navigate(-1);
}}
variant="ghostWhite"
>
Back
</Button>
Expand Down
8 changes: 5 additions & 3 deletions src/components/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from 'react';

import { CopyIcon } from '@chakra-ui/icons';
import { IconButton, Tooltip } from '@chakra-ui/react';
import { IconButton, Tooltip, useBreakpointValue } from '@chakra-ui/react';
import { useCopyToClipboard } from '@uidotdev/usehooks';
import { IconCopy } from '@tabler/icons-react';

type CopyButtonProps = {
value: string;
Expand All @@ -11,12 +11,14 @@ type CopyButtonProps = {
function CopyButton({ value }: CopyButtonProps): JSX.Element {
const [isCopied, setIsCopied] = useState(false);
const [, copy] = useCopyToClipboard();
const iconSize = useBreakpointValue({ base: 14, md: 18 }, { ssr: false });

let timeout: ReturnType<typeof setTimeout>;

return (
<Tooltip label="Copied" isOpen={isCopied}>
<IconButton
variant="ghostWhite"
aria-label="Copy to clipboard"
size="xs"
onClick={() => {
Expand All @@ -28,7 +30,7 @@ function CopyButton({ value }: CopyButtonProps): JSX.Element {
}, 5000);
}}
disabled={isCopied}
icon={<CopyIcon />}
icon={<IconCopy size={iconSize} />}
ml={1}
/>
</Tooltip>
Expand Down
19 changes: 14 additions & 5 deletions src/components/CreateAccountModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ function CreateAccountModal({
};

return (
<Modal isOpen={isOpen} onClose={onClose} isCentered>
<Modal isOpen={isOpen} onClose={onClose} isCentered size="lg">
<Form control={control}>
<ModalOverlay />
<ModalContent>
<ModalCloseButton />
<ModalHeader>Create a new Account</ModalHeader>
<ModalHeader textAlign="center">Create a new Account</ModalHeader>
<ModalBody minH={0}>
<FormInput
label="Name"
Expand Down Expand Up @@ -319,12 +319,21 @@ function CreateAccountModal({
errors={errors}
isSubmitted={isSubmitted}
/>
<Card variant="outline">
<CardBody>{renderTemplateSpecificFields()}</CardBody>
<Card shadow={0}>
<CardBody
pt={2}
pr={0}
pb={1}
pl={0}
bg="brand.modalGreen"
color="brand.lightGray"
>
{renderTemplateSpecificFields()}
</CardBody>
</Card>
</ModalBody>
<ModalFooter>
<Button colorScheme="blue" onClick={submit} ml={2}>
<Button onClick={submit} variant="whiteModal" w="full">
Add
</Button>
</ModalFooter>
Expand Down
12 changes: 9 additions & 3 deletions src/components/CreateKeyPairModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ function CreateKeyPairModal({
);

return (
<Modal isOpen={isOpen} onClose={close} isCentered>
<Modal isOpen={isOpen} onClose={close} isCentered size="lg">
<Form control={control}>
<ModalOverlay />
<ModalContent>
<ModalCloseButton />
<ModalHeader>Create a new Key Pair</ModalHeader>
<ModalHeader textAlign="center">Create a new Key Pair</ModalHeader>
<ModalBody>
<Text mb={4}>
New key pair will be derived from your mnemonics using the
Expand Down Expand Up @@ -130,7 +130,13 @@ function CreateKeyPairModal({
</Checkbox>
</ModalBody>
<ModalFooter>
<Button colorScheme="blue" onClick={submit} ml={2}>
<Button
colorScheme="blue"
onClick={submit}
ml={2}
variant="whiteModal"
px={10}
>
Add
</Button>
</ModalFooter>
Expand Down
2 changes: 2 additions & 0 deletions src/components/ExplorerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function ExplorerButton({
target="_blank"
icon={<IconWorldSearch size={iconSize} />}
{...buttonProps}
variant="whiteOutline"
border="1px"
/>
);
}
Expand Down
Loading