-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-docker-setup
- Loading branch information
Showing
13 changed files
with
140 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,62 @@ | ||
import { Template } from "tinacms"; | ||
import { productColors } from "../util/constants"; | ||
import classNames from "classnames"; | ||
|
||
export type ColorPaletteProps = { | ||
colorBlocks: Block[]; | ||
}; | ||
|
||
type Block = { | ||
color: keyof typeof productColors; | ||
text: string; | ||
}; | ||
|
||
export const ColorPalette = (props: ColorPaletteProps) => { | ||
const { colorBlocks } = props; | ||
return ( | ||
<div className="flex min-h-24 w-full flex-wrap"> | ||
{colorBlocks?.map((block, i) => ( | ||
<div | ||
className={classNames( | ||
block.color, | ||
"flex flex-grow flex-col items-center justify-center text-white" | ||
)} | ||
key={i} | ||
> | ||
<div>{block.text}</div> | ||
<div>{productColors[block.color]}</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export const colorPaletteSchema: Template = { | ||
name: "ColorPalette", | ||
label: "Color Palette", | ||
fields: [ | ||
{ | ||
type: "object", | ||
label: "Color Blocks", | ||
name: "colorBlocks", | ||
list: true, | ||
ui: { | ||
itemProps: (props) => ({ label: props?.text }), | ||
}, | ||
fields: [ | ||
{ | ||
type: "string", | ||
label: "Color", | ||
name: "color", | ||
options: Object.keys(productColors).map((color) => color), | ||
// options: productColors.map((color) => color), | ||
}, | ||
{ | ||
type: "string", | ||
label: "Text", | ||
name: "text", | ||
}, | ||
], | ||
}, | ||
], | ||
}; |
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
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