Skip to content

Commit 1f6b4c8

Browse files
committed
docs: docs component default themes not respecting theme change
INSTUI-4497
1 parent f37161d commit 1f6b4c8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/__docs__/src/ComponentTheme/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ class ComponentTheme extends Component<ComponentThemeProps> {
4545
colorPrimitives: object
4646
) {
4747
if (!value) {
48-
return <code>$aposundefined$apos</code>
49-
}
50-
if (typeof value === 'object') {
51-
return <code>{JSON.stringify(value)}</code>
48+
return <code>ERROR - possible bug</code>
5249
}
5350
if (typeof value === 'object') {
5451
return <code>{JSON.stringify(value)}</code>

packages/__docs__/src/Document/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ class Document extends Component<DocumentProps, DocumentState> {
9090
}
9191
}
9292

93-
componentDidUpdate() {
93+
componentDidUpdate(prevProps: typeof this.props) {
9494
this.props.makeStyles?.()
95+
if (this.props.themeVariables?.key !== prevProps.themeVariables?.key) {
96+
this.fetchGenerateComponentTheme()
97+
}
9598
}
9699

97100
handleDetailsTabChange: TabsProps['onRequestTabChange'] = (

packages/__docs__/src/Document/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type DocDataType = DocData & { legacyGitBranch?: string }
3636
type DocumentOwnProps = {
3737
doc: DocDataType
3838
description: string
39-
themeVariables?: BaseThemeVariables
39+
themeVariables?: BaseThemeVariables & { key: string }
4040
repository?: string
4141
layout?: 'small' | 'medium' | 'large' | 'x-large'
4242
}

0 commit comments

Comments
 (0)