Skip to content

Commit

Permalink
feat: add Inter font
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed May 25, 2022
1 parent c8ecde7 commit f814b3a
Show file tree
Hide file tree
Showing 58 changed files with 305 additions and 63 deletions.
9 changes: 0 additions & 9 deletions packages/widget-embedded/src/index.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
html,
body,
#root {
/* height: 100%; */
}

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #F4F5F6;
Expand Down
66 changes: 36 additions & 30 deletions packages/widget/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ScopedCssBaseline } from '@mui/material';
import { ThemeProvider } from '@mui/material/styles';
import { FC, PropsWithChildren } from 'react';
import { QueryClientProvider, QueryClientProviderProps } from 'react-query';
Expand Down Expand Up @@ -31,36 +32,41 @@ export const App: React.FC<AppProps> = ({ config }) => {
<ThemeProvider theme={theme}>
<QueryProvider client={queryClient}>
<MemoryRouter>
<AppContainer sx={config.containerStyle}>
<WidgetProvider config={config}>
<WalletProvider>
<SwapFormProvider>
<Header />
<Routes>
<Route path={routes.home} element={<MainPage />} />
<Route
path={routes.selectWallet}
element={<SelectWalletPage />}
/>
<Route path={routes.settings} element={<SettingsPage />} />
<Route
path={routes.fromToken}
element={<SelectTokenPage formType="from" />}
/>
<Route
path={routes.toToken}
element={<SelectTokenPage formType="to" />}
/>
<Route
path={routes.swapRoutes}
element={<SwapRoutesPage />}
/>
<Route path={routes.swap} element={<SwapPage />} />
</Routes>
</SwapFormProvider>
</WalletProvider>
</WidgetProvider>
</AppContainer>
<WidgetProvider config={config}>
<WalletProvider>
<SwapFormProvider>
<ScopedCssBaseline enableColorScheme>
<AppContainer sx={config.containerStyle}>
<Header />
<Routes>
<Route path={routes.home} element={<MainPage />} />
<Route
path={routes.selectWallet}
element={<SelectWalletPage />}
/>
<Route
path={routes.settings}
element={<SettingsPage />}
/>
<Route
path={routes.fromToken}
element={<SelectTokenPage formType="from" />}
/>
<Route
path={routes.toToken}
element={<SelectTokenPage formType="to" />}
/>
<Route
path={routes.swapRoutes}
element={<SwapRoutesPage />}
/>
<Route path={routes.swap} element={<SwapPage />} />
</Routes>
</AppContainer>
</ScopedCssBaseline>
</SwapFormProvider>
</WalletProvider>
</WidgetProvider>
</MemoryRouter>
</QueryProvider>
</ThemeProvider>
Expand Down
1 change: 0 additions & 1 deletion packages/widget/src/components/Card/CardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { cardHeaderClasses } from '@mui/material/CardHeader';
import { styled } from '@mui/material/styles';

export const CardHeader = styled(MuiCardHeader)(({ theme }) => ({
height: '32px',
[`.${cardHeaderClasses.action}`]: {
marginTop: -2,
alignSelf: 'center',
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/src/components/Card/CardTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export const CardTitle = styled(Typography)(({ theme }) => ({
fontSize: '0.875rem',
lineHeight: '1.286',
letterSpacing: '0.01071em',
fontWeight: 'bold',
fontWeight: 700,
padding: theme.spacing(1.75, 2, 0, 2),
}));
2 changes: 1 addition & 1 deletion packages/widget/src/components/Header/NavigationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const NavigationHeader: React.FC = () => {
color="black"
fontSize={pathname === '/' ? 32 : 24}
align={pathname === '/' ? 'left' : 'center'}
fontWeight="bold"
fontWeight="700"
flex={1}
noWrap
>
Expand Down
4 changes: 2 additions & 2 deletions packages/widget/src/components/Header/WalletHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const WalletHeader: React.FC = () => {
variant="body2"
align="right"
color="black"
fontWeight="bold"
fontWeight="600"
>
{walletAddress}
</Typography>
Expand All @@ -58,7 +58,7 @@ export const WalletHeader: React.FC = () => {
variant="body2"
align="right"
color="black"
fontWeight="bold"
fontWeight="600"
flex={1}
mr={0.5}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/src/components/ReverseTokensButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ReverseTokensButton: React.FC = () => {
return (
<IconButton
onClick={handleClick}
size="medium"
size="small"
aria-label="swap-destinations"
color="inherit"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const Card = styled(MuiCard)(({ theme }) => ({
export const SelectTokenCardHeader = styled(CardHeader, {
shouldForwardProp: (prop) => prop !== 'selected',
})<{ selected?: boolean }>(({ theme, selected }) => ({
height: 64,
[`.${cardHeaderClasses.title}`]: {
color: selected ? theme.palette.text.primary : theme.palette.text.secondary,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export const StepConnector = styled(MuiStepConnector)(({ theme }) => ({
export const StepLabel = styled(MuiStepLabel)(({ theme }) => ({
padding: 0,
[`.${stepLabelClasses.iconContainer}`]: {
paddingLeft: theme.spacing(1),
paddingRight: theme.spacing(3),
paddingLeft: theme.spacing(1.25),
paddingRight: theme.spacing(3.25),
},
}));

export const StepContent = styled(MuiStepContent)(({ theme }) => ({
borderLeft: `2px solid ${theme.palette.grey[300]}`,
marginLeft: theme.spacing(1.875),
paddingLeft: theme.spacing(3.9375),
paddingLeft: theme.spacing(3.875),
[`&.${stepContentClasses.last}`]: {
borderLeft: 'none',
paddingLeft: theme.spacing(4.1875),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { styled } from '@mui/material/styles';

export const Input = styled(InputBase)(({ theme }) => ({
fontSize: 24,
fontWeight: 'bold',
fontWeight: 700,
padding: theme.spacing(2, 2, 2, 0),
[`.${inputBaseClasses.input}`]: {
height: 32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { styled } from '@mui/material/styles';

export const SwapMaxAmountTypography = styled(Typography)(({ theme }) => ({
fontSize: 24,
fontWeight: 'bold',
fontWeight: '700',
color: theme.palette.grey[600],
transition: theme.transitions.create(['color']),
padding: theme.spacing(0.5, 0),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box } from '@mui/material';
import { Box, Typography } from '@mui/material';
import { styled } from '@mui/material/styles';

export const Card = styled(Box, {
Expand All @@ -23,7 +23,7 @@ export const Card = styled(Box, {
}),
);

export const Label = styled(Box, {
export const Label = styled(Typography, {
shouldForwardProp: (prop) => prop !== 'active',
})<{ active?: boolean }>(({ theme, active }) => ({
backgroundColor: active
Expand All @@ -35,7 +35,9 @@ export const Label = styled(Box, {
color: active ? theme.palette.common.white : theme.palette.common.black,
padding: theme.spacing(0.5, 0.75),
fontSize: 12,
lineHeight: 1.2,
fontWeight: '600',
height: 24,
letterSpacing: '0.05rem',
textTransform: 'uppercase',
display: 'inline-flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const SwapRouteCard: React.FC<SwapRouteCardProps & BoxProps> = ({
{route.toToken.symbol[0]}
</Avatar>
<Box>
<Typography fontSize={32} fontWeight="bold" lineHeight="normal">
<Typography fontSize={32} fontWeight="700" lineHeight="normal">
{formatTokenAmount(route.toAmount, route.toToken.decimals)}
</Typography>
<Typography fontSize={14} color="text.secondary">
Expand Down Expand Up @@ -73,7 +73,12 @@ export const SwapRouteCard: React.FC<SwapRouteCardProps & BoxProps> = ({
</Typography>
</Box>
<Box>
<Typography fontSize={18} fontWeight="500">
<Typography
fontSize={18}
fontWeight="500"
display="flex"
justifyContent="flex-end"
>
~
{(
route.steps
Expand Down
Binary file added packages/widget/src/fonts/Inter-Black.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Black.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-BlackItalic.woff
Binary file not shown.
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Bold.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Bold.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-BoldItalic.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-BoldItalic.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-ExtraBold.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-ExtraBold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-ExtraLight.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-ExtraLight.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Italic.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Italic.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Light.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Light.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-LightItalic.woff
Binary file not shown.
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Medium.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Medium.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Regular.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Regular.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-SemiBold.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-SemiBold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Thin.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-Thin.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-ThinItalic.woff
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-ThinItalic.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-italic.var.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter-roman.var.woff2
Binary file not shown.
Binary file added packages/widget/src/fonts/Inter.var.woff2
Binary file not shown.
Loading

0 comments on commit f814b3a

Please sign in to comment.