Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add Sandpack component to Delay #1193

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion docs/suspensive.org/src/pages/docs/react/Delay.en.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Callout } from '@/components'
import { Callout, Sandpack } from '@/components'

# Delay

Expand All @@ -16,6 +16,22 @@ const Example = () => (
)
```

<Sandpack>

```tsx Example.tsx active
import { Delay } from '@suspensive/react'

export const Example = () => (
<Delay ms={1000}>
<div style={{ padding: 20, backgroundColor: 'lightblue' }}>
1s delayed Text
</div>
</Delay>
)
```

</Sandpack>

<Callout type='info'>

Delayed loading UI sometimes provides better usability
Expand Down Expand Up @@ -59,3 +75,21 @@ const Example = () => (
</Delay>
)
```

<Sandpack>

```tsx Example.tsx active
import { Delay } from '@suspensive/react'

export const Example = () => {
return (
<div style={{ padding: 20, backgroundColor: 'lightblue' }}>
<Delay ms={1000} fallback={<>Fallback Text</>}>
1s delayed Text
</Delay>
</div>
)
}
```

</Sandpack>
44 changes: 40 additions & 4 deletions docs/suspensive.org/src/pages/docs/react/Delay.ko.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Callout } from '@/components'
import { Callout, Sandpack } from '@/components'

# Delay

Expand All @@ -9,13 +9,31 @@ import { Callout } from '@/components'
```tsx /ms/
import { Delay } from '@suspensive/react'

const Example = () => (
<Delay ms={200}>
<Delayed />
export const Example = () => {
return (
<Delay ms={200}>
<Delayed />
</Delay>
)
}
```

<Sandpack>

```tsx Example.tsx active
import { Delay } from '@suspensive/react'

export const Example = () => (
<Delay ms={1000}>
<div style={{ padding: 20, backgroundColor: 'lightblue' }}>
1s delayed Text
</div>
</Delay>
)
```

</Sandpack>

<Callout type='info'>

로딩 UI가 지연되어 노출되는 것이 때에 따라 더 좋은 사용성을 제공합니다.
Expand Down Expand Up @@ -59,3 +77,21 @@ const Example = () => (
</Delay>
)
```

<Sandpack>

```tsx Example.tsx active
import { Delay } from '@suspensive/react'

export const Example = () => {
return (
<div style={{ padding: 20, backgroundColor: 'lightblue' }}>
<Delay ms={1000} fallback={<>Fallback Text</>}>
1s delayed Text
</Delay>
</div>
)
}
```

</Sandpack>
Loading