-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move gradientSelector function to keystatic helper
- Loading branch information
1 parent
9700e59
commit 4528786
Showing
2 changed files
with
19 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { fields } from '@keystatic/core' | ||
|
||
type Gradient = 'grad1' | 'grad2' | 'grad3' | 'grad4' | ||
|
||
export function gradientSelector ({ defaultValue = 'grad1' }: { defaultValue: Gradient }) { | ||
return fields.select({ | ||
label: 'Gradient', | ||
description: 'The gradient to use for the group', | ||
options: [ | ||
{ label: '1', value: 'grad1' }, | ||
{ label: '2', value: 'grad2' }, | ||
{ label: '3', value: 'grad3' }, | ||
{ label: '4', value: 'grad4' }, | ||
], | ||
defaultValue: defaultValue, | ||
}) | ||
} |