forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from Koniverse/issue-10
[Issue-6,9,10] Update file upload, icon components, switch storybook
- Loading branch information
Showing
9 changed files
with
152 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from 'react'; | ||
import type { UploadProps } from './interface'; | ||
import Upload from './Upload'; | ||
|
||
export type SingleFileDraggerProps = Omit<UploadProps, 'type' | 'multiple'>; | ||
|
||
const SingleFileDragger = React.forwardRef<unknown, SingleFileDraggerProps>( | ||
({ ...restProps }, ref) => ( | ||
<Upload ref={ref} {...restProps} type="single-file-drag" multiple={false} maxCount={1} /> | ||
), | ||
); | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
SingleFileDragger.displayName = 'SingleFileDragger'; | ||
} | ||
|
||
export default SingleFileDragger; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import Upload from '..'; | ||
|
||
const { SingleFileDragger } = Upload; | ||
|
||
export default { | ||
title: 'Core/SingleFileDragger', | ||
component: SingleFileDragger, | ||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes | ||
argTypes: {}, | ||
} as ComponentMeta<typeof SingleFileDragger>; | ||
|
||
const Template: ComponentStory<typeof SingleFileDragger> = (args) => ( | ||
<SingleFileDragger {...args} /> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
title: 'Import from Polkadot.js', | ||
hint: 'Please drag an drop the .json file you exported from Polkadot.js', | ||
}; |
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