@@ -166,12 +166,19 @@ class Document extends Component<DocumentProps, DocumentState> {
166166 // the listed tokens may not actually be used by this component.
167167 const isLegacyTheme = this . context ?. componentVersion === 'v11_6'
168168 const dotStrippedId = doc . id ?. replace ( / \. / g, '' )
169- const borrowedThemeId =
170- doc . themeId || doc . componentInstance ?. themeId
169+ const borrowedThemeId = doc . themeId || doc . componentInstance ?. themeId
171170 const borrowsTokens =
172- ! isLegacyTheme &&
173- borrowedThemeId &&
174- borrowedThemeId !== dotStrippedId
171+ ! isLegacyTheme && borrowedThemeId && borrowedThemeId !== dotStrippedId
172+
173+ // Point the theme-override guide link at the page that matches the
174+ // selected component version: legacy theming (v11_6) vs. the new
175+ // token-based system (v11_7+).
176+ const themeOverridesPage = isLegacyTheme
177+ ? 'legacy-theme-overrides'
178+ : 'new-theme-overrides'
179+ const themeOverridesLabel = isLegacyTheme
180+ ? 'Legacy theme overrides'
181+ : 'New theme overrides'
175182
176183 return themeVariables &&
177184 componentTheme &&
@@ -184,9 +191,9 @@ class Document extends Component<DocumentProps, DocumentState> {
184191 { borrowsTokens ? (
185192 < View as = "div" margin = "0 0 small 0" >
186193 Note: < code > { doc . id } </ code > shares its theme tokens with{ ' ' }
187- < code > { borrowedThemeId } </ code > , so the table below lists every
188- token of < code > { borrowedThemeId } </ code > . Some of these may not
189- actually be used by < code > { doc . id } </ code > .
194+ < code > { borrowedThemeId } </ code > , so the table below lists every token
195+ of < code > { borrowedThemeId } </ code > . Some of these may not actually be
196+ used by < code > { doc . id } </ code > .
190197 </ View >
191198 ) : null }
192199 { doc . themePath ? (
@@ -217,7 +224,7 @@ class Document extends Component<DocumentProps, DocumentState> {
217224
218225 < View margin = "small 0" display = "block" >
219226 In case you need to change the appearance of the{ ' ' }
220- < code > { doc . id } </ code > component, you can override it's
227+ < code > { doc . id } </ code > component, you can override its
221228 { doc . themePath
222229 ? this . renderThemeLink ( doc , ' default theme variables.' )
223230 : ' default theme variables.' }
@@ -226,13 +233,13 @@ class Document extends Component<DocumentProps, DocumentState> {
226233 The easiest way to do this is to utilize the{ ' ' }
227234 < code > themeOverride</ code > property. See the{ ' ' }
228235 < Link
229- href = "legacy-theme-overrides"
236+ href = { themeOverridesPage }
230237 onClick = { ( e ) => {
231238 e . preventDefault ( )
232- navigateTo ( 'legacy-theme-overrides' )
239+ navigateTo ( themeOverridesPage )
233240 } }
234241 >
235- Legacy theme overrides
242+ { themeOverridesLabel }
236243 </ Link > { ' ' }
237244 guide for more info and alternative methods.
238245 </ View >
0 commit comments