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

change font styling #89

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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');
}

}
10 changes: 5 additions & 5 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
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="body2"
component="span"
sx={{ color: 'grey.500' }}
>
Expand All @@ -157,7 +157,7 @@ export default function Footer() {
<Grid container sx={{ mt: 2 }} justifyContent="space-between">
<Grid item xs={12} md={6}>
<Typography
variant="subtitle1"
variant="body1"
component="p"
sx={{
textAlign: { xs: 'center', md: 'left' },
Expand Down Expand Up @@ -194,10 +194,10 @@ export default function Footer() {
<Link
rel="noopener noreferrer"
target="_blank"
style={{ textDecoration: 'none' }}
style={{ textDecoration: 'none', color: 'inherit' }}
to={SUITE_RELEASES}
>
<Typography variant="body1" component="p" color="primary">
<Typography variant="body2" component="p" color="inherit">
{process.env.VERSION}
</Typography>
</Link>
Expand Down
23 changes: 11 additions & 12 deletions src/components/Navbar/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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 { getAccount, updateAccount, changeActiveApp } from '../../redux/slices/app-config'
import { mdiLogout, mdiCogOutline } from '@mdi/js'
import { mdiCogOutline, mdiLogout } from '@mdi/js'
import Icon from '@mdi/react'
import { Chip, IconButton, MenuItem, MenuList, Select, Typography, useTheme } from '@mui/material'
import { default as React } from 'react'
import { useNavigate } from 'react-router-dom'
import store from 'wallet/store'
import { useAppDispatch, useAppSelector } from '../../hooks/reduxHooks'
import { changeActiveApp, getAccount, updateAccount } from '../../redux/slices/app-config'
import { updateAuthStatus } from '../../redux/slices/utils'
import MHidden from '../@material-extend/MHidden'
import { LoadAccountMenu } from '../LoadAccountMenu'
import AliasPicker from './AliasPicker'
import { updateAuthStatus } from '../../redux/slices/utils'

interface LoginIconProps {
handleCloseSidebar: () => void
Expand Down Expand Up @@ -104,10 +104,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 @@ -120,7 +119,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 @@ -153,7 +152,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 @@ -161,7 +161,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 @@
}
/>
<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 All @@ -81,7 +81,7 @@
)}
data-cy="app-selector-menu"
>
{allApps?.map((app, index) => {

Check warning on line 84 in src/components/PlatformSwitcher.tsx

View workflow job for this annotation

GitHub Actions / yarn-build

Array.prototype.map() expects a value to be returned at the end of arrow function
if (!app.hidden && (!app.private || isAuth))
return (
<MenuItem
Expand All @@ -100,7 +100,7 @@
}}
>
<Typography
variant="h5"
variant="subtitle2"
component="span"
noWrap
fontWeight="500"
Expand All @@ -110,11 +110,7 @@
</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
Loading