Skip to content

Commit

Permalink
feat(connect-popup): load suite-like fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Sep 16, 2022
1 parent bfbf44f commit 6ee22ca
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/connect-popup/src/static/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<link href="./popup.css" rel="stylesheet" />

<!-- suite-like fonts -->
<link media="all" rel="stylesheet" href="./fonts/fonts.css" />
</head>
<body>
<main>
Expand Down
9 changes: 9 additions & 0 deletions packages/connect-popup/webpack/prod.webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default {
},
],
}),
// legacy fonts, should be removed once refactoring into React is finished
new CopyPlugin({
patterns: [
{
Expand All @@ -89,6 +90,14 @@ export default {
},
],
}),
new CopyPlugin({
patterns: [
{
from: `${path.join(__dirname, '../../suite-data/files/fonts')}`,
to: `${DIST}/fonts`,
},
],
}),
new CopyPlugin({
patterns: [
{
Expand Down
2 changes: 2 additions & 0 deletions packages/connect-ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ErrorView, ErrorViewProps } from './views/Error';
import { ThemeWrapper } from './support/ThemeWrapper';
import { IntlWrapper } from './support/IntlWrapper';
import { ErrorBoundary } from './support/ErrorBoundary';
import { GlobalStyle } from './support/GlobalStyle';

export type ConnectUIProps = TransportProps | PassphraseProps | ErrorViewProps;

Expand All @@ -31,6 +32,7 @@ export const ConnectUI = (props: ConnectUIProps) => {

return (
<ErrorBoundary>
<GlobalStyle />
<ThemeWrapper>
{/* todo: load translations from somewhere and pass them to intl */}
<IntlWrapper>{getComponent()}</IntlWrapper>
Expand Down
7 changes: 7 additions & 0 deletions packages/connect-ui/src/support/GlobalStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createGlobalStyle } from 'styled-components';

export const GlobalStyle = createGlobalStyle`
* {
font-family: "TT Hoves", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
`;

0 comments on commit 6ee22ca

Please sign in to comment.