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

fix(opentrons-ai-client): apply GlobalStyle to the application #14936

Merged
merged 1 commit into from
Apr 17, 2024
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
fix(opentrons-ai-client): apply GlobalStyle to the application
apply GlobalStyle to the application

close AUTH-351
  • Loading branch information
koji committed Apr 17, 2024
commit a4649daa6cc7b62cd9a5a8143d7a48b9c7c6a67b
1 change: 0 additions & 1 deletion opentrons-ai-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
},
"homepage": "https://github.com/Opentrons/opentrons",
"dependencies": {
"@fontsource/dejavu-sans": "5.0.3",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this to display Greek characters, but OpenAI API cannot handle Greek characters well, so we don't need to use the font for this application.

"@fontsource/public-sans": "5.0.3",
"@opentrons/components": "link:../components",
"i18next": "^19.8.3",
Expand Down
7 changes: 2 additions & 5 deletions opentrons-ai-client/src/atoms/GlobalStyle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ import '@fontsource/public-sans'
import '@fontsource/public-sans/600.css'
import '@fontsource/public-sans/700.css'

export const GlobalStyle = createGlobalStyle<{ isOnDevice?: boolean }>`
export const GlobalStyle = createGlobalStyle`
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: ${props =>
props.isOnDevice ?? false
? 'Public Sans, DejaVu Sans'
: 'Open Sans'}, sans-serif;
font-family: 'Public Sans', 'sans-serif';
}

html,
Expand Down
2 changes: 2 additions & 0 deletions opentrons-ai-client/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { I18nextProvider } from 'react-i18next'
import { GlobalStyle } from './atoms/GlobalStyle'

import { i18n } from './i18n'
import { App } from './App'
Expand All @@ -9,6 +10,7 @@ const rootElement = document.getElementById('root')
if (rootElement != null) {
ReactDOM.createRoot(rootElement).render(
<React.StrictMode>
<GlobalStyle />
<I18nextProvider i18n={i18n}>
<App />
</I18nextProvider>
Expand Down
Loading