Skip to content

Commit

Permalink
fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
eunjae-lee committed Sep 13, 2023
1 parent 97c362f commit 8fb28aa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
12 changes: 8 additions & 4 deletions packages/demo/src/components/FieldPluginDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { FunctionComponent } from 'react'
import { Box, Typography } from '@mui/material'
import { useFieldPlugin } from '../useFieldPlugin'
import { LoadingIcon, SquareErrorIcon } from '@storyblok/mui'
import { FieldPluginActions, FieldPluginData } from '@storyblok/field-plugin'
import { useFieldPlugin } from '@storyblok/field-plugin/react'
import { ModalView } from './ModalView'
import { NonModalView } from './NonModalView'

type Content = unknown

export type PluginComponent = FunctionComponent<{
data: FieldPluginData
actions: FieldPluginActions
data: FieldPluginData<Content>
actions: FieldPluginActions<Content>
}>

export const FieldPluginDemo: FunctionComponent = () => {
const { type, data, actions } = useFieldPlugin()
const { type, data, actions } = useFieldPlugin({
parseContent: (content: Content) => content,
})

if (type === 'loading') {
return (
Expand Down
16 changes: 0 additions & 16 deletions packages/demo/src/useFieldPlugin.ts

This file was deleted.

5 changes: 4 additions & 1 deletion packages/demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"moduleResolution": "Bundler"
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.tsx"
]
}
7 changes: 7 additions & 0 deletions packages/demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export default defineConfig({
'../field-plugin/src/index.ts',
),
},
{
find: /^@storyblok\/field-plugin\/react$/,
replacement: path.resolve(
__dirname,
'../field-plugin/helpers/react/src/index.ts',
),
},
],
},
server: {
Expand Down

0 comments on commit 8fb28aa

Please sign in to comment.