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

Dark theme support: restore and create wallet #3714

Merged
merged 66 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
2873612
update cards styles
SorinC6 Oct 10, 2024
324597a
update design tokens
SorinC6 Oct 11, 2024
72bdb49
update and fix colors
SorinC6 Oct 28, 2024
7748da6
update connect wallet colors section
SorinC6 Oct 28, 2024
75b317a
update recovery input colors
SorinC6 Oct 29, 2024
9b329f9
update bg color
SorinC6 Oct 29, 2024
c24b5a2
Merge branch 'develop' into sorin/YOEXT-1317/wallet-init
SorinC6 Oct 29, 2024
a8cb422
fix lint
SorinC6 Oct 29, 2024
39ad2eb
update tx colors
SorinC6 Oct 30, 2024
d987ab5
Merge branch 'develop' into sorin/YOEXT-1317/wallet-init
SorinC6 Oct 30, 2024
aad7278
fix text color
SorinC6 Oct 30, 2024
b39cd44
fix btn color
SorinC6 Oct 30, 2024
64727a6
highlight datepicker icons
SorinC6 Oct 30, 2024
27c79d4
fix color
SorinC6 Oct 30, 2024
406b5bd
change placeholder color
SorinC6 Oct 31, 2024
4ce19c2
update success dialog
SorinC6 Oct 31, 2024
25a71cf
fix textfield value color on disable
SorinC6 Nov 1, 2024
bf87f65
Merge branch 'develop' into sorin/YOEXT-1317/wallet-init
SorinC6 Nov 22, 2024
2899973
Update packages/yoroi-extension/app/components/wallet/summary/WalletS…
SorinC6 Nov 22, 2024
9e0f417
Update packages/yoroi-extension/app/components/wallet/summary/WalletS…
SorinC6 Nov 22, 2024
abf74fc
Update packages/yoroi-extension/app/components/wallet/summary/WalletS…
SorinC6 Nov 22, 2024
68a71c8
Update packages/yoroi-extension/app/components/wallet/summary/WalletS…
SorinC6 Nov 22, 2024
a5d9760
add hover color
SorinC6 Nov 22, 2024
0940bbc
add hover state
SorinC6 Nov 22, 2024
03d4a57
fix hit colors
SorinC6 Nov 22, 2024
31630de
update wallet card ilustration
SorinC6 Nov 22, 2024
2a699d6
fixed YOEXT-1278
Nebyt Nov 25, 2024
7d6c3a7
update dialog styles
SorinC6 Nov 25, 2024
4da4a9f
fix word style
SorinC6 Nov 25, 2024
fe349d5
remove double boder
SorinC6 Nov 25, 2024
51e2c11
update color
SorinC6 Nov 25, 2024
ddc3be4
update steps color
SorinC6 Nov 25, 2024
5985419
update text color
SorinC6 Nov 25, 2024
7478b16
update modal
SorinC6 Nov 25, 2024
dfdd657
update text in dialog
SorinC6 Nov 25, 2024
faad62b
again fixed YOEXT-1278
Nebyt Nov 25, 2024
73e2b06
update icon
SorinC6 Nov 26, 2024
c32d375
fix btn color
SorinC6 Nov 26, 2024
5bd3cd0
update placeholder color
SorinC6 Nov 26, 2024
3165bab
YOEXT-1136. working but not pretty solution
Nebyt Nov 26, 2024
7c583a4
add hover state
SorinC6 Nov 26, 2024
218aafc
Merge branch 'sorin/YOEXT-1317/wallet-init' into denis/minor-ui-fixes
Nebyt Nov 26, 2024
21e3ab5
fixed YOEXT-919
Nebyt Nov 26, 2024
24084e3
fix flow
SorinC6 Nov 26, 2024
e27fa25
fixed YOEXT-1531. Changed design.
Nebyt Nov 26, 2024
be20eaa
Merge pull request #3755 from Emurgo/denis/minor-ui-fixes
vsubhuman Nov 27, 2024
a80b506
Merge branch 'sorin/YOEXT-1317/wallet-init' into denis/yoext-1531/mem…
Nebyt Nov 27, 2024
154f08f
eslint fixes
Nebyt Nov 27, 2024
baf9eb3
Merge pull request #3756 from Emurgo/denis/yoext-1531/memo-alignment
vsubhuman Nov 27, 2024
9f2953a
Merge branch 'develop' into sorin/YOEXT-1317/wallet-init
Nebyt Nov 27, 2024
172445e
Merge branch 'develop' into sorin/YOEXT-1317/wallet-init
Nebyt Nov 28, 2024
8378bf3
Additional change for yoext-1493
Nebyt Nov 28, 2024
53b7a2b
using the correct colors for the yoroi logo
Nebyt Nov 28, 2024
a68481d
Using the correct text color
Nebyt Nov 28, 2024
82d9034
updated the dark pallete according to the design
Nebyt Nov 28, 2024
0065b14
updated colors for CLEAR ALL button
Nebyt Nov 28, 2024
b1e55ee
updated color of "Not found"
Nebyt Nov 28, 2024
2e5b770
rounded wallet plate icon
Nebyt Nov 28, 2024
397a26d
updated circle border color
Nebyt Nov 28, 2024
223efd9
updated link color
Nebyt Nov 28, 2024
acd9c5b
added cross button on the duplicate wallet dialog
Nebyt Nov 29, 2024
289c4bc
rounded wallet icon on duplicated wallet dialog
Nebyt Nov 29, 2024
e3c1642
updated colors for dropdowns
Nebyt Nov 29, 2024
8ea6f9d
input field fix
Nebyt Nov 29, 2024
1563618
Merge branch 'develop' into sorin/YOEXT-1317/wallet-init
Nebyt Nov 29, 2024
2ee304b
lint fixes and other
Nebyt Nov 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import type { Node } from 'react';
import { useState } from 'react';
import { useCombobox } from 'downshift';
import { Input, Box, FormControl } from '@mui/material';
import { styled } from '@mui/system';
import { Input, Box, FormControl, Typography, styled } from '@mui/material';

type Props = {|
+options: Array<string>,
Expand Down Expand Up @@ -31,9 +30,7 @@ function useCachedOptions(options) {
if (!inputValue) return [];

if (!cachedOptions[inputValue]) {
cachedOptions[inputValue] = options.filter(w =>
w.toLowerCase().startsWith(inputValue?.toLowerCase() ?? '')
);
cachedOptions[inputValue] = options.filter(w => w.toLowerCase().startsWith(inputValue?.toLowerCase() ?? ''));
}

return cachedOptions[inputValue];
Expand Down Expand Up @@ -66,15 +63,7 @@ function Autocomplete({
const filteredList = isInputPresent ? getCachedOptions(inputValue) : [];
const hasError = isInputPresent && filteredList.length === 0;

const {
isOpen,
getMenuProps,
getInputProps,
getComboboxProps,
highlightedIndex,
getItemProps,
closeMenu,
} = useCombobox({
const { isOpen, getMenuProps, getInputProps, getComboboxProps, highlightedIndex, getItemProps, closeMenu } = useCombobox({
inputValue,
defaultHighlightedIndex: 0,
selectedItem: '',
Expand Down Expand Up @@ -168,12 +157,7 @@ function Autocomplete({

return (
<SFormControl error={Boolean(error)} onKeyDownCapture={handleKeyDownEvent}>
<InputWrapper
isVerified={isVerified}
onClick={() => !isOpen}
error={hasError}
isOpen={isOpen}
>
<InputWrapper isVerified={isVerified} onClick={() => !isOpen} error={hasError} isOpen={isOpen}>
<Box {...getComboboxProps()}>
<Input
inputRef={inputRef}
Expand Down Expand Up @@ -206,27 +190,31 @@ function Autocomplete({
{isOpen && (
<>
{filteredList.length === 0 ? (
<Box sx={{ padding: '16px', bgcolor: 'ds.bg_color_max' }}>{noResultsMessage}</Box>
<Typography color="ds.text_primary_medium" sx={{ padding: '16px', bgcolor: 'ds.bg_color_min' }}>
{noResultsMessage}
</Typography>
) : (
<Box sx={{ paddingY: '8px' }}>
{filteredList.map((item, index) => {
const regularPart = inputValue != null ? item.replace(inputValue.toLowerCase(), '') : item;
return (
<Box
key={`${item}${index}`}
sx={{
padding: '16px',
backgroundColor: highlightedIndex === index ? 'ds.gray_50' : 'ds.bg_color_max',
cursor: 'pointer',
}}
{...getItemProps({ item, index })}
>
<span style={{ fontWeight: 'bold' }}>{inputValue?.toLowerCase()}</span>
<span>{regularPart}</span>
</Box>
);
})}
</Box>
filteredList.map((item, index) => {
const regularPart = inputValue != null ? item.replace(inputValue.toLowerCase(), '') : item;
return (
<Box
key={`${item}${index}`}
sx={{
padding: '16px',
backgroundColor: highlightedIndex === index ? 'ds.gray_200' : 'ds.bg_color_min',
cursor: 'pointer',
}}
{...getItemProps({ item, index })}
>
<Typography component="span" color="ds.text_primary_medium" style={{ fontWeight: 'bold' }}>
{inputValue?.toLowerCase()}
</Typography>
<Typography component="span" color="ds.text_primary_medium">
{regularPart}
</Typography>
</Box>
);
})
)}
</>
)}
Expand All @@ -244,9 +232,8 @@ Autocomplete.defaultProps = {
noResultsMessage: '',
};

const ULList = styled(Box)(({ theme }) => ({
const ULList = styled(Box)(() => ({
width: '100%',
background: theme.palette.ds.bg_color_max,
margin: 0,
borderTop: 0,
position: 'absolute',
Expand All @@ -264,7 +251,7 @@ const ULList = styled(Box)(({ theme }) => ({
const InputWrapper = styled(Box)(
({ theme, error, isVerified }) => `
width: 100%;
background-color: transparent;
background-color: ${theme.palette.ds.bg_color_max};
height: 40px;
align-content: baseline;
display: inline-flex;
Expand Down Expand Up @@ -295,8 +282,8 @@ const InputWrapper = styled(Box)(
? `&:not([value=""]):not(:focus) {
border-color: transparent;
border: 0;
color: ${isVerified && theme.palette.ds.black_static};
background: ${isVerified ? theme.palette.ds.el_secondary : theme.palette.ds.primary_100};
color: ${isVerified ? theme.palette.ds.black_static : theme.palette.ds.primary_600};
}`
: ''
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function CenteredLayout({ children }: Props): Node {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
backgroundColor: 'var(--yoroi-loading-background-color)',
backgroundColor: 'ds.bg_color_max',
height: '100%',
}}
>
Expand Down
20 changes: 10 additions & 10 deletions packages/yoroi-extension/app/components/topbar/WalletCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@ export default class WalletCard extends Component<Props, State> {
/>
</div>
<div className={styles.extraInfo}>
<div className={styles.label}>
{intl.formatMessage(messages.tokenTypes)}{' '}
<span className={styles.value} id={walletTokensAmountId}>
<Typography className={styles.label} color="ds.text_gray_medium">
{intl.formatMessage(messages.tokenTypes)}:{' '}
<Typography component="span" id={walletTokensAmountId} fontWeight="500">
{tokenTypes}
</span>
</div>
<div className={styles.label}>
NFTs{' '}
<span className={styles.value} id={walletNFTsAmountId}>
</Typography>
</Typography>
<Typography className={styles.label} color="ds.text_gray_medium">
NFTs:{' '}
<Typography component="span" id={walletNFTsAmountId} fontWeight="500">
{nfts}
</span>
</div>
</Typography>
</Typography>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,9 @@
flex: 1;
text-align: left;
.label {
color: var(--yoroi-palette-gray-600);
line-height: 22px;
}
.value {
color: var(--yoroi-palette-gray-900);
}

}
.actions {
opacity: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import OptionBlock from '../../../widgets/options/OptionBlock';
import environment from '../../../../environment';

import styles from '../../../widgets/options/OptionListWrapperStyle.scss';
import { Typography, Link } from '@mui/material';

const messages = defineMessages({
dialogTitle: {
Expand All @@ -24,7 +25,8 @@ const messages = defineMessages({
},
testnetDescription: {
id: 'wallet.currency.pick.testnetDescription',
defaultMessage: '!!!Testnet are alternative chain to be used for testing. This allows application developers or testers to experiment, without having to use real coins.',
defaultMessage:
'!!!Testnet are alternative chain to be used for testing. This allows application developers or testers to experiment, without having to use real coins.',
},
});

Expand All @@ -39,7 +41,7 @@ type Props = {|

@observer
export default class PickCurrencyOptionDialog extends Component<Props> {
static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = {
static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = {
intl: intlShape.isRequired,
};

Expand All @@ -62,17 +64,15 @@ export default class PickCurrencyOptionDialog extends Component<Props> {
title="Cardano"
learnMoreText={
<>
{intl.formatMessage(messages.cardanoDescription)}<br />
<a
href="https://cardano.org"
onClick={event => this.props.onExternalLinkClick(event)}
>
<Typography color="ds.text_gray_low">{intl.formatMessage(messages.cardanoDescription)}</Typography>
<Link href="https://cardano.org" onClick={event => this.props.onExternalLinkClick(event)}>
{intl.formatMessage(globalMessages.learnMore)}
</a>
</>}
</Link>
</>
}
onSubmit={this.props.onCardano}
/>
{(!environment.isProduction() || environment.isNightly() || environment.isTest()) &&
{(!environment.isProduction() || environment.isNightly() || environment.isTest()) && (
<>
<OptionBlock
parentName="PickCurrencyOptionDialog"
Expand All @@ -81,18 +81,17 @@ export default class PickCurrencyOptionDialog extends Component<Props> {
onSubmit={this.props.onCardanoPreprodTestnet}
learnMoreText={
<>
{intl.formatMessage(messages.testnetDescription)}<br />
<a
href="https://testnets.cardano.org/"
onClick={event => this.props.onExternalLinkClick(event)}
>
{intl.formatMessage(messages.testnetDescription)}
<br />
<a href="https://testnets.cardano.org/" onClick={event => this.props.onExternalLinkClick(event)}>
{intl.formatMessage(globalMessages.learnMore)}
</a>
</>}
</>
}
/>
</>
}
{(!environment.isProduction() || environment.isNightly() || environment.isTest()) &&
)}
{(!environment.isProduction() || environment.isNightly() || environment.isTest()) && (
<>
<OptionBlock
parentName="PickCurrencyOptionDialog"
Expand All @@ -101,18 +100,17 @@ export default class PickCurrencyOptionDialog extends Component<Props> {
onSubmit={this.props.onCardanoPreviewTestnet}
learnMoreText={
<>
{intl.formatMessage(messages.testnetDescription)}<br />
<a
href="https://testnets.cardano.org/"
onClick={event => this.props.onExternalLinkClick(event)}
>
{intl.formatMessage(messages.testnetDescription)}
<br />
<a href="https://testnets.cardano.org/" onClick={event => this.props.onExternalLinkClick(event)}>
{intl.formatMessage(globalMessages.learnMore)}
</a>
</>}
</>
}
/>
</>
}
{(!environment.isProduction() || environment.isNightly() || environment.isTest()) &&
)}
{(!environment.isProduction() || environment.isNightly() || environment.isTest()) && (
<>
<OptionBlock
parentName="PickCurrencyOptionDialog"
Expand All @@ -121,17 +119,16 @@ export default class PickCurrencyOptionDialog extends Component<Props> {
onSubmit={this.props.onCardanoSanchoTestnet}
learnMoreText={
<>
{intl.formatMessage(messages.testnetDescription)}<br />
<a
href="https://testnets.cardano.org/"
onClick={event => this.props.onExternalLinkClick(event)}
>
{intl.formatMessage(messages.testnetDescription)}
<br />
<a href="https://testnets.cardano.org/" onClick={event => this.props.onExternalLinkClick(event)}>
{intl.formatMessage(globalMessages.learnMore)}
</a>
</>}
</>
}
/>
</>
}
)}
</ul>
</div>
</Dialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ const messages: Object = defineMessages({
},
thirdTip: {
id: 'wallet.create.dialog.howToSaveRecoveryPhrase.thirdTip',
defaultMessage:
'!!!Write the recovery phrase on a piece of paper and store in a secure location like a safety deposit box. ',
defaultMessage: '!!!Write the recovery phrase on a piece of paper and store in a secure location like a safety deposit box. ',
},
forthTip: {
id: 'wallet.create.dialog.howToSaveRecoveryPhrase.forthTip',
defaultMessage:
'!!!It is recommended to have 2 or 3 copies of the recovery phrase in different secure locations.',
defaultMessage: '!!!It is recommended to have 2 or 3 copies of the recovery phrase in different secure locations.',
},
});

Expand All @@ -53,13 +51,13 @@ function HowToSaveRecoveryPhraseTipsDialog(props: Props & Intl): Node {

return (
<InfoDialog open={open} onClose={onClose}>
<Typography component="div" textAlign="center" variant="body1" fontWeight="500" mb="16px">
<Typography component="div" textAlign="center" variant="body1" fontWeight="500" mb="16px" color="ds.text_gray_medium">
{intl.formatMessage(messages.title)}
</Typography>
<Box component="ul" sx={{ listStyle: 'outside', px: '24px' }}>
{tips.map(([tipId, tipTxt]) => (
<Box key={tipId} component="li">
<Typography component="div" variant="body1" color="grey.800">
<Typography component="div" variant="body1" color="ds.text_gray_medium">
{intl.formatMessage(tipTxt)}
</Typography>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function RecoveryPhrase(props: Props & Intl): Node {
key={word}
columns={7}
sx={{
backgroundColor: 'ds.primary_100',
textAlign: 'center',
borderRadius: '8px',
display: 'flex',
Expand All @@ -56,7 +57,8 @@ function RecoveryPhrase(props: Props & Intl): Node {
}}
id={'recoveryPhraseWord' + idx}
>
<Typography component="div"
<Typography
component="div"
sx={{
width: '124px',
whiteSpace: 'nowrap',
Expand Down Expand Up @@ -90,11 +92,7 @@ function RecoveryPhrase(props: Props & Intl): Node {
>
{shouldShowRecoveryPhrase ? <ClosedEyeIcon /> : <OpenedEyeIcon />}
<Typography component="div" variant="body2" fontWeight="500">
{intl.formatMessage(
shouldShowRecoveryPhrase
? messages.hideRecoveryPhraseBtn
: messages.showRecoveryPhraseBtn
)}
{intl.formatMessage(shouldShowRecoveryPhrase ? messages.hideRecoveryPhraseBtn : messages.showRecoveryPhraseBtn)}
</Typography>
</Button>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ function StepController(props: Props): Node {
const { actions } = props;

return (
<Stack
direction="row"
alignItems="center"
justifyContent="center"
mt="14px"
py="24px"
gap="24px"
>
<Stack direction="row" alignItems="center" justifyContent="center" mt="14px" py="24px" gap="24px">
{actions.map(({ type, label, disabled, onClick }, idx) => {
const isPrimary = type === 'primary';
return (
Expand Down
Loading
Loading