Skip to content

Commit

Permalink
change font styling
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddaqqa committed Oct 16, 2023
1 parent dc6e944 commit 9f66b0c
Show file tree
Hide file tree
Showing 24 changed files with 265 additions and 648 deletions.
67 changes: 23 additions & 44 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,44 +96,29 @@ Cypress.Commands.add('changeNetwork', (network: string = 'Kopernikus') => {
})
})
Cypress.Commands.add('accessWallet', (type, keyName, networkName: string = 'kopernikus') => {
//cy.get('header > .MuiToolbar-root > .MuiBox-root:nth-child(2)').as('elPreferenceMenu')
// cy.get('@elPreferenceMenu').find('> .MuiBox-root').as('btnWallet')
// cy.get('@btnWallet').click()

cy.selectWalletApp()
cy.wait(5000)
cy.get('h6 + .MuiGrid-container').as('elWalletOptions')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(1)')
.as('elPrivateKeyOption')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(2)')
.as('elMnemonicOption')
switch (type) {
case 'privateKey':
{
cy.get('@elPrivateKeyOption').click()
cy.fixture(`${networkName}/private_key_wallet`).then(privateKeys => {
cy.get('[data-cy="field-private-key"]').type(
privateKeys[keyName || 'privateKey'],
)
})
cy.get('button[type="button"]').contains('Access Wallet').click()
}
break
case 'mnemonic':
{
cy.get('@elMnemonicOption').find('> .MuiButtonBase-root').click()
console.log(networkName)
cy.fixture(`${networkName}/mnemonic_wallet`).then(phraseArr => {
const mnemonicStr = phraseArr.join(' ')
cy.get('input.phrase_word').first()?.type(mnemonicStr)
cy.get('button[type="button"]').contains('Access Wallet').click()
})
cy.get('[data-cy="app-selector-menu"]').click()
cy.get('[data-cy="app-selector-Wallet"]').click()

if (type === 'mnemonic') {
cy.get('[data-cy="btn-wallet-access-mnemonic"]').click()
cy.readFile(`cypress/temp/wallets/mnemonic_wallet.json`).then(data => {
let phraseArr = data
for (let i = 0; i < phraseArr.length; i++) {
let indexInput = i + 1
cy.get(`[data-cy="mnemonic-field-${indexInput}"]`).type(phraseArr[i])
}
break
default:
break
cy.get('[data-cy="btn-submit-mnemonic-phrase"]').click({ force: true })
})
}
if (type === 'privateKey') {
cy.get('[data-cy="btn-wallet-access-private-key"]', { timeout: 10000 }).click()
cy.readFile('cypress/temp/wallets/private_key_wallet.json').then(privateKey => {
const privateKeyCChain = privateKey.privateKey
cy.get('[data-cy="field-private-key"]', { timeout: 10000 }).type(privateKeyCChain)
})
cy.get('[data-cy="btn-submit-private-key"]').click()
}
cy.get('[data-cy="btn-show-breakdown"]', { timeout: 20000 }).should('be.visible')
// cy.intercept('GET', '**/api/v1/verified/*').as('apiVerifiedAddress')
Expand Down Expand Up @@ -217,17 +202,11 @@ Cypress.Commands.add(
cy.changeNetwork(network)

cy.wait(5000)
cy.get('h6 + .MuiGrid-container').as('elWalletOptions')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(1)')
.as('elPrivateKeyOption')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(2)')
.as('elMnemonicOption')

switch (walletAccessType) {
case 'privateKey':
{
cy.get('@elPrivateKeyOption').click()
cy.get('[data-cy="btn-wallet-access-private-key"]').click()
cy.fixture(`${network.toLowerCase()}/private_key_wallet`).then(privateKeys => {
cy.get('[data-cy="field-private-key"]').type(
privateKeys[keyName || 'privateKey'],
Expand All @@ -238,7 +217,7 @@ Cypress.Commands.add(
break
case 'mnemonic':
{
cy.get('@elMnemonicOption').find('> .MuiButtonBase-root').click()
cy.get('[data-cy="btn-wallet-access-mnemonic"]').click()
console.log(network)
cy.fixture(`${network.toLowerCase()}/mnemonic_wallet`).then(phraseArr => {
const mnemonicStr = phraseArr.join(' ')
Expand Down
Binary file removed public/fonts/ClashDisplay-200.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-200.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-300.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-300.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-400.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-400.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-500.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-500.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-600.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-600.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-700.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-700.woff2
Binary file not shown.
51 changes: 1 addition & 50 deletions public/fonts/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,53 +38,4 @@
font-style: normal;
font-weight: 700;
src: url('Inter-700.woff2') format('woff2'), url('Inter-700.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 200;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-200.woff2') format('woff2'), url('ClashDisplay-200.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 300;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-300.woff2') format('woff2'), url('ClashDisplay-300.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 400;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-400.woff2') format('woff2'), url('ClashDisplay-400.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 500;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-500.woff2') format('woff2'), url('ClashDisplay-500.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 600;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-600.woff2') format('woff2'), url('ClashDisplay-600.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 700;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-700.woff2') format('woff2'), url('ClashDisplay-700.woff') format('woff');
}

}
6 changes: 3 additions & 3 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function Footer() {
</Grid>
<Grid item>
<Typography
variant="body1"
variant="caption"
component="p"
sx={{
color: 'grey.500',
Expand Down Expand Up @@ -106,7 +106,7 @@ export default function Footer() {
sx={{ display: 'flex', flexDirection: 'column' }}
>
<Typography
variant="subtitle1"
variant="body1"
component="span"
fontWeight="fontWeightBold"
sx={{
Expand Down Expand Up @@ -139,7 +139,7 @@ export default function Footer() {
style={{ textDecoration: 'none' }}
>
<Typography
variant="body1"
variant="caption"
component="span"
sx={{ color: 'grey.500' }}
>
Expand Down
21 changes: 10 additions & 11 deletions src/components/Navbar/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { mdiCogOutline, mdiLogout } from '@mdi/js'
import Icon from '@mdi/react'
import { Chip, IconButton, MenuItem, MenuList, Select, Typography, useTheme } from '@mui/material'
import React from 'react'
import { useAppDispatch, useAppSelector } from '../../hooks/reduxHooks'
import { MenuItem, MenuList, Select, IconButton, useTheme, Typography, Chip } from '@mui/material'
import store from 'wallet/store'
import { useNavigate } from 'react-router-dom'
import store from 'wallet/store'
import { useAppDispatch, useAppSelector } from '../../hooks/reduxHooks'
import {
changeActiveApp,
getAccount,
updateAuthStatus,
updateAccount,
changeActiveApp,
updateAuthStatus,
} from '../../redux/slices/app-config'
import { mdiLogout, mdiCogOutline } from '@mdi/js'
import Icon from '@mdi/react'
import MHidden from '../@material-extend/MHidden'
import { LoadAccountMenu } from '../LoadAccountMenu'
import AliasPicker from './AliasPicker'
Expand Down Expand Up @@ -108,10 +108,9 @@ export default function LoginButton({ handleCloseSidebar }: LoginIconProps) {
handleKeyDown(e)
}}
sx={{
typography: 'body1',
typography: 'body2',
width: '100%',
maxWidth: '326px',
display: 'flex',
justifyContent: { xs: 'flex-end', sm: 'center' },
}}
>
Expand All @@ -124,7 +123,7 @@ export default function LoginButton({ handleCloseSidebar }: LoginIconProps) {
onKeyDown={e => {
handleKeyDown(e)
}}
sx={{ typography: 'body1', width: '100%', maxWidth: '326px' }}
sx={{ typography: 'body2', width: '100%', maxWidth: '326px' }}
>
<LoadAccountMenu type="kyc" />
</MenuItem>
Expand Down Expand Up @@ -157,7 +156,7 @@ export default function LoginButton({ handleCloseSidebar }: LoginIconProps) {
onKeyDown={e => handleKeyDown(e)}
onClick={logout}
sx={{
typography: 'body1',
typography: 'body2',
width: '100%',
maxWidth: '326px',
display: 'flex',
Expand Down
11 changes: 6 additions & 5 deletions src/components/Navbar/NetworkSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
<MenuList sx={{ bgcolor: 'transparent' }}>
<MenuItem
sx={{
typography: 'h6',
typography: 'body2',
fontWeight: theme.typography.fontWeightMedium,
color: theme.palette.text.disabled,
}}
Expand Down Expand Up @@ -111,7 +111,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
}}
/>
<Typography
variant="subtitle1"
variant="body2"
component="span"
noWrap
sx={{ maxWidth: '180px' }}
Expand Down Expand Up @@ -153,7 +153,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
<MenuItem
onClick={openModal}
sx={{
typography: 'body1',
typography: 'body2',
width: '100%',
maxWidth: '326px',
justifyContent: 'space-between',
Expand Down Expand Up @@ -182,6 +182,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
value={activeNetwork?.name ? activeNetwork?.name : ''}
renderValue={() => <SelectedNetwork />}
sx={{
typography: 'body2',
maxWidth: '13rem',
'.MuiOutlinedInput-notchedOutline': { border: 'none' },
'.MuiSvgIcon-root': { color: theme.palette.text.primary },
Expand All @@ -199,7 +200,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
sx={{ gap: '.6rem', justifyContent: 'space-between' }}
data-cy={`network-name-${network.name}`}
>
<Typography variant="subtitle1" component="span" noWrap>
<Typography variant="body2" component="span" noWrap>
{network.name}
</Typography>
{!network.readonly && network.url !== activeNetwork.url && (
Expand Down Expand Up @@ -248,7 +249,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
))}
<MenuItem
onClick={handleOpenModal}
sx={{ typography: 'body1', width: '100%', maxWidth: '326px' }}
sx={{ typography: 'body2', width: '100%', maxWidth: '326px' }}
data-cy="add-custom-network"
>
Add Custom Network
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/SelectNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function SelectedNetwork() {
}}
/>
<Typography
variant="subtitle1"
variant="body2"
component="span"
sx={{ overflow: 'hidden', textOverflow: 'ellipsis' }}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function ThemeSwitcher() {
'.MuiButton-startIcon': { mr: isDesktop ? '0.5rem' : '0rem' },
}}
>
{isDesktop && <Typography variant="subtitle1">{theme.palette.mode}</Typography>}
{isDesktop && <Typography variant="body2">{theme.palette.mode}</Typography>}
</Button>
)
}
2 changes: 1 addition & 1 deletion src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default function Navbar() {
}}
>
<Icon path={mdiWalletOutline} size={1} />
<Typography variant="subtitle1" component="span">
<Typography variant="body2" component="span">
Login
</Typography>
</Box>
Expand Down
22 changes: 9 additions & 13 deletions src/components/PlatformSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react'
import { Box, MenuItem, Select, useTheme, Typography } from '@mui/material'
import { mdiChevronRight } from '@mdi/js'
import useWidth from '../hooks/useWidth'
import Icon from '@mdi/react'
import { Box, MenuItem, Select, Typography, useTheme } from '@mui/material'
import React from 'react'
import { useDispatch } from 'react-redux'
import { useNavigate } from 'react-router-dom'
import { useAppSelector } from '../hooks/reduxHooks'
import useWidth from '../hooks/useWidth'
import {
changeActiveApp,
getActiveApp,
getAllApps,
getAuthStatus,
} from '../redux/slices/app-config'
import { useNavigate } from 'react-router-dom'
import { useAppSelector } from '../hooks/reduxHooks'

export default function PlatformSwitcher() {
const theme = useTheme()
Expand Down Expand Up @@ -70,9 +70,9 @@ export default function PlatformSwitcher() {
}
/>
<Typography
variant="h4"
variant={!isDesktop ? 'h6' : 'h4'}
component="span"
fontWeight="400"
fontWeight="500"
sx={{ ml: '.5rem', color: theme.palette.logo.primary }}
>
{allApps[activeApp].name}
Expand Down Expand Up @@ -100,7 +100,7 @@ export default function PlatformSwitcher() {
}}
>
<Typography
variant="h5"
variant="subtitle2"
component="span"
noWrap
fontWeight="500"
Expand All @@ -110,11 +110,7 @@ export default function PlatformSwitcher() {
</Typography>
<Icon path={mdiChevronRight} size={0.9} />
</Box>
<Typography
variant="subtitle2"
component="span"
fontWeight="300"
>
<Typography variant="caption" component="span" fontWeight="300">
{app.subText}
</Typography>
</Box>
Expand Down
Loading

0 comments on commit 9f66b0c

Please sign in to comment.