-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(doc): fix lint error and optimize Component
- Loading branch information
1 parent
9c71030
commit ff5ff8a
Showing
7 changed files
with
59 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
apps/docs/app/ui/components/componentExample/ComponentExampleWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ComponentCodeWrapper } from "@/app/ui/components/componentExample/ComponentCodeWrapper.tsx"; | ||
import ComponentPreview from "@/app/ui/components/componentExample/ComponentPreview.tsx"; | ||
import PreviewComponent from "@/app/ui/components/previewComponent/PreviewComponent.tsx"; | ||
import ComponentExample from "@/app/ui/components/componentExample/ComponentExample.tsx"; | ||
|
||
export interface ComponentExampleWrapperProps { | ||
src: string; | ||
type?: "preview" | "example"; | ||
} | ||
|
||
const ComponentExampleWrapper = ({ src, type = "example" }: ComponentExampleWrapperProps) => { | ||
if (!src) { | ||
return null; | ||
} | ||
|
||
if (type === "preview") { | ||
return <PreviewComponent | ||
code={<ComponentCodeWrapper src={src} />} | ||
preview={<ComponentPreview src={src} />} | ||
/>; | ||
} | ||
|
||
return <ComponentExample | ||
type="both" | ||
code={<ComponentCodeWrapper src={src} />} | ||
preview={<ComponentPreview src={src} />} | ||
/>; | ||
}; | ||
|
||
export default ComponentExampleWrapper; |
17 changes: 0 additions & 17 deletions
17
apps/docs/app/ui/components/componentExample/ComponentPreview.stories.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters