Skip to content

Commit

Permalink
dev(core): add files workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner committed Jan 3, 2023
1 parent 125dc41 commit c5e8102
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
@@ -0,0 +1,25 @@
import {Button, Card, Container, Flex} from '@sanity/ui'
import React from 'react'
import {UploadPlaceholder} from '../common/UploadPlaceholder'

export default function UploadPlaceholderStory() {
return (
<Flex align="center" height="fill" justify="center" padding={3}>
<Container width={1}>
<Card>
<UploadPlaceholder
accept="image/*"
acceptedFiles={[{name: 'foo.jpg', type: 'image/jpeg'}]}
browse={<Button text="Browse btn" mode="ghost" />}
directUploads
hoveringFiles={[{name: 'foo.jpg', type: 'image/jpeg'}]}
onUpload={() => null}
readOnly={false}
rejectedFilesCount={0}
type="image"
/>
</Card>
</Container>
</Flex>
)
}
14 changes: 14 additions & 0 deletions packages/sanity/src/core/form/inputs/files/__workshop__/index.ts
@@ -0,0 +1,14 @@
import {defineScope} from '@sanity/ui-workshop'
import {lazy} from 'react'

export default defineScope({
name: 'sanity/form/files',
title: 'Files',
stories: [
{
name: 'upload-placeholder',
title: 'UploadPlaceholder',
component: lazy(() => import('./UploadPlaceholderStory')),
},
],
})

1 comment on commit c5e8102

@vercel
Copy link

@vercel vercel bot commented on c5e8102 Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio-git-next.sanity.build
test-studio.sanity.build

Please sign in to comment.