-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tasks): update description input to create blocks
- Loading branch information
1 parent
f568e14
commit ba07e5a
Showing
11 changed files
with
94 additions
and
29 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
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
21 changes: 21 additions & 0 deletions
21
.../tasks/src/tasks/components/form/fields/descriptionInput/blocks/DescriptionInputBlock.tsx
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,21 @@ | ||
import {Box, Text} from '@sanity/ui' | ||
import type * as React from 'react' | ||
import styled from 'styled-components' | ||
|
||
const NormalText = styled(Text)` | ||
word-break: break-word; | ||
` | ||
|
||
interface NormalBlockProps { | ||
children: React.ReactNode | ||
} | ||
|
||
export function DescriptionInputBlock(props: NormalBlockProps) { | ||
const {children} = props | ||
|
||
return ( | ||
<Box paddingTop={2} paddingBottom={3}> | ||
<NormalText size={1}>{children}</NormalText> | ||
</Box> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/sanity/src/tasks/src/tasks/components/form/fields/descriptionInput/blocks/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './DescriptionInputBlock' |
1 change: 1 addition & 0 deletions
1
packages/sanity/src/tasks/src/tasks/components/form/fields/descriptionInput/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './DescriptionInput' |
1 change: 1 addition & 0 deletions
1
packages/sanity/src/tasks/src/tasks/components/form/fields/descriptionInput/render/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './renderBlock' |
9 changes: 9 additions & 0 deletions
9
...sanity/src/tasks/src/tasks/components/form/fields/descriptionInput/render/renderBlock.tsx
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,9 @@ | ||
import {type RenderBlockFunction} from '@sanity/portable-text-editor' | ||
|
||
import {DescriptionInputBlock} from '../blocks' | ||
|
||
export const renderBlock: RenderBlockFunction = (blockProps) => { | ||
const {children} = blockProps | ||
|
||
return <DescriptionInputBlock>{children}</DescriptionInputBlock> | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/sanity/src/tasks/src/tasks/components/form/fields/index.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