You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(components): this commit reverses code blocks toggler mechanism behavior
- prop `isInitiallyExpanded` doesn't make sense anymore, so it is renamed to `heightTogglers` in CodeGroup and `showHeightToggler` in Code components
- toggler logic abstracted to custom hook
If you are using`CodeGroup`wrapper you can specify the initial state of code blocks via `isInitiallyExpanded` prop which works very similarly to the other available props:
335
+
Prop `heightTogglers` passed to`CodeGroup`component makes it possible, which works very similar to `labels` and `lineNumbers` props:
336
336
337
-
<CodeGroup labels={["Nice code!", "This one is better", "Oh my.."]} lineNumbers={[true, true, true]} isInitiallyExpanded=[true, false, false]>
337
+
<CodeGroup labels={["Nice code!", "This one is better", "Oh my.."]} lineNumbers={[true, true, true]} heightTogglers=[true, false, false]>
338
338
339
339
```javascript
340
-
// a lot of lines of important code
340
+
// a lot of lines of code,
341
+
// maxHeight of this code block will be set to `400px`
0 commit comments