@@ -12,6 +12,7 @@ import { Instructions } from "./components/Instructions";
1212import { Output } from "./components/Output" ;
1313import { firstLetterUppercase } from "./util" ;
1414import type { AxisRegistry , FontFamily , Metadata } from "../../functions/src/metadata" ;
15+ import { ErrorBoundary } from "./components/ErrorBoundary" ;
1516
1617type AlertMessage = {
1718 title : string ,
@@ -110,59 +111,61 @@ function App() {
110111 } } defaultColorScheme = "auto" >
111112 < AppShell padding = { "xl" } >
112113 < Container size = "sm" >
113- < FontTitle />
114- < Text ta = "center" pb = "md" > Self host variable fonts from
115- < Anchor href = "https://fonts.google.com/?vfonly=true" target = "_blank" > Google Fonts</ Anchor >
116- </ Text >
117-
118- < Autocomplete
119- data = { fontData ?. familyMetadataList . map ( f => f . family ) ?? [ ] }
120- label = "Select your variable font"
121- size = "md"
122- placeholder = "Roboto Flex"
123- onChange = { onSelectFont }
124- />
125-
126- < Space h = "md" />
127-
128- { alert !== null && (
129- < Alert title = { alert . title } my = "md" color = "red" >
130- { alert . content }
131- < Text size = "sm" pt = "md" >
132- < span > If this issue persists, please file an issue on </ span >
133- < Anchor href = "https://github.com/aarol/variable-font-helper/issues/new" > Github</ Anchor >
134- </ Text >
135- </ Alert >
136- ) }
137-
138- { font !== undefined ? (
139- < >
140- < Text size = "xl" > { font . family } </ Text >
141- < Text > By { listFormatter . format ( font . designers ) } </ Text >
142-
143- < Button component = "a" target = "_blank" href = { `https://fonts.google.com/specimen/${ firstLetterUppercase ( font . family ) } /tester` } my = "sm" variant = "outline" leftSection = { < IconExternalLink size = { 14 } /> } >
144- Type tester
145- </ Button >
146-
147- < Instructions />
148-
149- < Configure
150- key = { font . family } // to refresh config on font family change
151- axes = { fontAxes }
152- font = { font }
153- showGenerate = { stylesheets . length === 0 }
154- onGenerate = { onGenerate }
155- onChange = { resetOutput } />
156-
157- < Collapse in = { stylesheets . length > 0 } >
158- < Output styles = { stylesheets }
159- fontName = { font . family . replaceAll ( ' ' , '_' ) }
160- />
161- </ Collapse >
162- </ >
163- ) : < Accordions />
164- }
165- < Footer />
114+ < ErrorBoundary >
115+
116+ < FontTitle />
117+ < Text ta = "center" pb = "md" > Self host variable fonts from < Anchor href = "https://fonts.google.com/?vfonly=true" target = "_blank" > Google Fonts</ Anchor >
118+ </ Text >
119+
120+ < Autocomplete
121+ data = { fontData ?. familyMetadataList . map ( f => f . family ) ?? [ ] }
122+ label = "Select your variable font"
123+ size = "md"
124+ placeholder = "Roboto Flex"
125+ onChange = { onSelectFont }
126+ />
127+
128+ < Space h = "md" />
129+
130+ { alert !== null && (
131+ < Alert title = { alert . title } my = "md" color = "red" >
132+ { alert . content }
133+ < Text size = "sm" pt = "md" >
134+ < span > If this issue persists, please file an issue on </ span >
135+ < Anchor href = "https://github.com/aarol/variable-font-helper/issues/new" > Github</ Anchor >
136+ </ Text >
137+ </ Alert >
138+ ) }
139+
140+ { font !== undefined ? (
141+ < >
142+ < Text size = "xl" > { font . family } </ Text >
143+ < Text > By { listFormatter . format ( font . designers ) } </ Text >
144+
145+ < Button component = "a" target = "_blank" href = { `https://fonts.google.com/specimen/${ firstLetterUppercase ( font . family ) } /tester` } my = "sm" variant = "outline" leftSection = { < IconExternalLink size = { 14 } /> } >
146+ Type tester
147+ </ Button >
148+
149+ < Instructions />
150+
151+ < Configure
152+ key = { font . family } // to refresh config on font family change
153+ axes = { fontAxes }
154+ font = { font }
155+ showGenerate = { stylesheets . length === 0 }
156+ onGenerate = { onGenerate }
157+ onChange = { resetOutput } />
158+
159+ < Collapse in = { stylesheets . length > 0 } >
160+ < Output styles = { stylesheets }
161+ fontName = { font . family . replaceAll ( ' ' , '_' ) }
162+ />
163+ </ Collapse >
164+ </ >
165+ ) : < Accordions />
166+ }
167+ < Footer />
168+ </ ErrorBoundary >
166169 </ Container >
167170 </ AppShell >
168171 </ MantineProvider >
0 commit comments