Skip to content

Commit 1647dbf

Browse files
committed
Add spring config to scrollytelling
1 parent 67b5154 commit 1647dbf

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

packages/scrollycoding/src/editor.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ type EditorProps = {
1212
contentProps: EditorStep
1313
frameProps: MiniEditorProps["frameProps"]
1414
codeProps: MiniEditorProps["codeProps"]
15+
springConfig: MiniEditorProps["springConfig"]
1516
}
1617

1718
function Editor({
1819
contentProps,
1920
codeProps,
2021
frameProps,
22+
springConfig,
2123
}: EditorProps) {
2224
const finalFrameProps = {
2325
button: <CodeSandboxIcon url={useCodeSandboxLink()} />,
@@ -33,6 +35,7 @@ function Editor({
3335
{...contentProps}
3436
frameProps={finalFrameProps}
3537
codeProps={finalCodeProps}
38+
springConfig={springConfig}
3639
/>
3740
)
3841
}

packages/scrollycoding/src/hike.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ function useStepsFromChildren({
141141
...editorProps?.frameProps,
142142
...stepFrameProps,
143143
},
144+
springConfig: editorProps?.springConfig,
144145
},
145146
previewPreset: preset,
146147
previewProps: {

packages/storybook/src/scrollycoding.story.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ function Hike({ codeProps, ...props }) {
8282
<HikeComponent
8383
{...props}
8484
preset={preset}
85-
codeProps={{
86-
minColumns: 46,
87-
minZoom: 0.9,
88-
...codeProps,
85+
editorProps={{
86+
codeProps: {
87+
minColumns: 40,
88+
minZoom: 0.9,
89+
...codeProps,
90+
},
8991
}}
9092
/>
9193
)

0 commit comments

Comments
 (0)