Add right-nav link

This commit is contained in:
Eric Bailey
2024-11-17 16:36:45 -06:00
parent 4cc2690365
commit a284df0cd5
4 changed files with 115 additions and 11 deletions
+21 -2
View File
@@ -4,8 +4,10 @@ import {atoms as a, tokens} from '#/alf'
export function GradientFill({
gradient,
rotate,
}: {
gradient:
| typeof tokens.gradients.primary
| typeof tokens.gradients.sky
| typeof tokens.gradients.midnight
| typeof tokens.gradients.sunrise
@@ -13,13 +15,30 @@ export function GradientFill({
| typeof tokens.gradients.bonfire
| typeof tokens.gradients.summer
| typeof tokens.gradients.nordic
rotate?: '90deg' | '180deg' | '270deg'
}) {
const {start, end} = React.useMemo(() => {
switch (rotate) {
case '90deg': {
return {start: {x: 1, y: 0}, end: {x: 1, y: 1}}
}
case '180deg': {
return {start: {x: 1, y: 1}, end: {x: 0, y: 0}}
}
case '270deg': {
return {start: {x: 0, y: 1}, end: {x: 0, y: 0}}
}
default: {
return {start: {x: 0, y: 0}, end: {x: 1, y: 1}}
}
}
}, [rotate])
return (
<LinearGradient
colors={gradient.values.map(c => c[1])}
locations={gradient.values.map(c => c[0])}
start={{x: 0, y: 0}}
end={{x: 1, y: 1}}
start={start}
end={end}
style={[a.absolute, a.inset_0]}
/>
)