turned template into create cli
This commit is contained in:
21
template/apps/studio/components/TextAlignComponent.tsx
Normal file
21
template/apps/studio/components/TextAlignComponent.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import React from 'react'
|
||||
import {BlockDecoratorProps} from 'sanity'
|
||||
|
||||
type TextAlignValue = 'left' | 'center' | 'right'
|
||||
interface TextAlignBlockDecoratorProps extends BlockDecoratorProps {
|
||||
value: TextAlignValue
|
||||
}
|
||||
|
||||
export const TextAlign = (props: TextAlignBlockDecoratorProps) => {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
// props.value exists and is of type TextAlignValue
|
||||
textAlign: props.value ? props.value : 'left',
|
||||
width: '100%',
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user