Skip to content

Commit ceba217

Browse files
committed
fix(docs): resolve SSR crash and webpack warnings in docs build
- Inject polyfills/dev.js via getClientModules to define globalThis.__DEV__ for both client and SSR bundles; needed because the new Switch pulls in react-native-reanimated which assumes this global exists - Alias @expo/vector-icons/MaterialCommunityIcons to material-design-icons (already present) and @react-native-vector-icons/get-image to false - Flatten CSS nesting in custom.css to fix CSS minimizer warnings about unsupported & selector syntax - Add isDynamicColorSupported = false to the non-Android DynamicTheme fallback, which was missing the re-exported symbol - Fix TypescaleKey re-export to use the type keyword
1 parent 8720eac commit ceba217

5 files changed

Lines changed: 24 additions & 12 deletions

File tree

docs/plugins/docusaurus-react-native-plugin.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@ module.exports = function () {
1414
'react-native-vector-icons/MaterialCommunityIcons': path.resolve(
1515
'node_modules/@react-native-vector-icons/material-design-icons'
1616
),
17+
'@expo/vector-icons/MaterialCommunityIcons': path.resolve(
18+
'node_modules/@react-native-vector-icons/material-design-icons'
19+
),
20+
'@react-native-vector-icons/get-image': false,
1721
},
1822
extensions: ['.web.js'],
1923
},
2024
};
2125
},
26+
getClientModules() {
27+
return [path.resolve(__dirname, 'polyfills/dev.js')];
28+
},
2229
};
2330
};

docs/plugins/polyfills/dev.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
globalThis.__DEV__ = process.env.NODE_ENV !== 'production';

docs/src/css/custom.css

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ html[data-theme='light'] .gallery-dark {
128128
height: 124px;
129129
align-items: center;
130130
text-align: center;
131+
}
131132

132-
@media (max-width: 680px) {
133+
@media (max-width: 680px) {
134+
.icons-list-icon-container {
133135
width: 96px;
134136
}
135137
}
@@ -153,10 +155,10 @@ html[data-theme='light'] .gallery-dark {
153155
flex-wrap: wrap;
154156
justify-content: center;
155157
margin: 24px 0;
158+
}
156159

157-
&:last-child {
158-
justify-content: flex-start;
159-
}
160+
.icons-list-results:last-child {
161+
justify-content: flex-start;
160162
}
161163

162164
.icons-list-searchbar {
@@ -171,15 +173,15 @@ html[data-theme='light'] .gallery-dark {
171173
border-radius: 3px;
172174
transition: background-color 0.3s;
173175
outline: 0;
176+
}
174177

175-
&:focus,
176-
&:hover {
177-
background-color: #e7e7e7;
178-
}
178+
.icons-list-searchbar:focus,
179+
.icons-list-searchbar:hover {
180+
background-color: #e7e7e7;
181+
}
179182

180-
*:focus-visible {
181-
outline: auto;
182-
}
183+
.icons-list-searchbar:focus-visible {
184+
outline: auto;
183185
}
184186

185187
@font-face {

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ export type { Props as SegmentedButtonsProps } from './components/SegmentedButto
137137
export type { Props as ListImageProps } from './components/List/ListImage';
138138
export type { Props as TooltipProps } from './components/Tooltip/Tooltip';
139139

140-
export { TypescaleKey, type Theme, type Elevation } from './types';
140+
export { type TypescaleKey, type Theme, type Elevation } from './types';

src/theme/schemes/DynamicTheme.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
export { DarkTheme as DynamicDarkTheme } from './DarkTheme';
22
export { LightTheme as DynamicLightTheme } from './LightTheme';
3+
4+
export const isDynamicColorSupported = false;

0 commit comments

Comments
 (0)