-
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.
feature/add sb generator, update sanity generators (#28)
* add sb generator * fix generators, update according to generated types * fix sb types template * bump turbo eslint version * fix lock * remove test component
- Loading branch information
1 parent
15c9289
commit 9206f81
Showing
13 changed files
with
188 additions
and
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/*.hbs |
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ module.exports = { | |
"prettier-plugin-tailwindcss", | ||
], | ||
tailwindConfig: "./packages/ui/tailwind.config.ts", | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
export interface I{{ capitialize sectionName }} { | ||
_key: string; | ||
title: string; | ||
} | ||
import type { Section{{ capitialize sectionName }} } from "@/generated/extracted-types"; | ||
|
||
export interface I{{ capitialize sectionName }}SectionProps { | ||
data: I{{ capitialize sectionName }} | ||
export interface I{{ capitialize sectionName }}Props { | ||
data: Section{{ capitialize sectionName }} & { | ||
_key: string; | ||
}; | ||
} |
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,27 @@ | ||
import EmptyBlock from "@shared/ui/components/EmptyBlock"; | ||
|
||
import { {{capitialize sectionName}} as {{capitialize sectionName}}UI } from "@shared/ui"; | ||
|
||
import { prepareImageProps } from "@/lib/adapters/prepareImageProps"; | ||
import { prepareLinkProps } from "@/lib/adapters/prepareLinkProps"; | ||
import { prepareRichTextProps } from "@/lib/adapters/prepareRichTextProps"; | ||
import SectionContainer from "@/components/SectionContainer"; | ||
|
||
import type { I{{capitialize sectionName}}Props } from "./types"; | ||
|
||
export default function {{capitialize sectionName}}({ blok }: I{{capitialize sectionName}}Props) { | ||
const { text, image, link } = blok; | ||
|
||
if (text.length === 0 && image.length === 0 && link.length === 0) | ||
return <EmptyBlock name={blok.component as string} />; | ||
|
||
return ( | ||
<SectionContainer blok={blok}> | ||
<{{capitialize sectionName}}UI | ||
text={prepareRichTextProps(text[0])} | ||
image={prepareImageProps(image[0])} | ||
link={prepareLinkProps(link[0])} | ||
/> | ||
</SectionContainer> | ||
); | ||
} |
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,5 @@ | ||
import type { {{capitialize sectionName}}Storyblok } from "@/generated/extracted-types"; | ||
|
||
export interface I{{capitialize sectionName}}Props { | ||
blok: {{capitialize sectionName}}Storyblok; | ||
} |
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 |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import type { I{{ capitialize componentName }}Props } from "./types" | ||
|
||
export function {{ capitialize componentName }} ({ title }: I{{ capitialize componentName }}Props) { | ||
return ( | ||
<div> | ||
new UI component: Table | ||
title: {title || 'title not provided'} | ||
</div> | ||
) | ||
} | ||
import type { I{{capitialize sectionName}}Props } from "./types" export function | ||
{{capitialize sectionName}} | ||
({ title }: I{{capitialize sectionName}}Props) { return ( | ||
<div> | ||
new UI component: Table title: {title || 'title not provided'} | ||
</div> | ||
) } |
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
export interface I{{ capitialize componentName }}Props { | ||
title: string; | ||
} | ||
export interface I{{capitialize sectionName}}Props { title: string; } |