Skip to content

Commit f91c849

Browse files
committed
Fix typo
1 parent b1b2937 commit f91c849

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/mdx/src/mdx-client/scrollycoding.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function DynamicScrollycoding({
176176
<div className="ch-scrollycoding-content">
177177
<Scroller
178178
onStepChange={onStepChange}
179-
triggerPositon={codeConfig?.triggerPositon}
179+
triggerPosition={codeConfig?.triggerPosition}
180180
>
181181
{stepsChildren.map((children, i) => (
182182
<ScrollerStep

packages/mdx/src/scroller/index.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ type ScrollerProps = {
1818
children: React.ReactNode
1919
getRootMargin?: (
2020
vh: number,
21-
triggerPositon?: TriggerPositon
21+
triggerPosition?: TriggerPosition
2222
) => string
23-
triggerPositon?: TriggerPositon
23+
triggerPosition?: TriggerPosition
2424
debug?: boolean
2525
}
2626

@@ -32,7 +32,7 @@ function Scroller({
3232
onStepChange,
3333
children,
3434
getRootMargin = defaultRootMargin,
35-
triggerPositon,
35+
triggerPosition,
3636
debug = false,
3737
}: ScrollerProps) {
3838
const [observer, setObserver] =
@@ -56,7 +56,7 @@ function Scroller({
5656
}
5757
const observer = newIntersectionObserver(
5858
handleIntersect,
59-
getRootMargin(windowHeight, triggerPositon)
59+
getRootMargin(windowHeight, triggerPosition)
6060
)
6161
setObserver(observer)
6262

@@ -109,21 +109,21 @@ function newIntersectionObserver(
109109
})
110110
}
111111

112-
type TriggerPositon = `${number}px` | `${number}%`
112+
type TriggerPosition = `${number}px` | `${number}%`
113113

114114
function defaultRootMargin(
115115
vh: number,
116-
triggerPositon = "50%"
116+
triggerPosition = "50%"
117117
) {
118118
let y = vh * 0.5
119119

120-
if (triggerPositon.endsWith("%")) {
120+
if (triggerPosition.endsWith("%")) {
121121
const percent = parseFloat(
122-
triggerPositon.replace("%", "")
122+
triggerPosition.replace("%", "")
123123
)
124124
y = vh * (percent / 100)
125-
} else if (triggerPositon.endsWith("px")) {
126-
y = parseFloat(triggerPositon.replace("px", ""))
125+
} else if (triggerPosition.endsWith("px")) {
126+
y = parseFloat(triggerPosition.replace("px", ""))
127127
}
128128

129129
if (y < 0) {

packages/mdx/src/smooth-code/code-tween.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type HTMLProps = React.DetailedHTMLProps<
2525
HTMLDivElement
2626
>
2727

28-
type TriggerPositon = `${number}px` | `${number}%`
28+
type TriggerPosition = `${number}px` | `${number}%`
2929

3030
export type CodeTweenProps = {
3131
tween: FullTween<CodeStep>
@@ -51,7 +51,7 @@ export type CodeConfig = {
5151
showExpandButton?: boolean
5252
staticMediaQuery?: string
5353
rows?: number | "focus" | (number | "focus")[]
54-
triggerPositon?: TriggerPositon
54+
triggerPosition?: TriggerPosition
5555
debug?: boolean
5656
}
5757

0 commit comments

Comments
 (0)