-
-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70eaf4a
commit e381fc9
Showing
9 changed files
with
599 additions
and
68 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,40 @@ | ||
import { Form, Radio } from 'antd'; | ||
import i18n from 'i18next'; | ||
import React from 'react'; | ||
|
||
import FileUpload from '../../../components/common/FileUpload'; | ||
|
||
export default { | ||
render(canvasRef, form, data) { | ||
if (!data) { | ||
return null; | ||
} | ||
const loadType = data.loadType || 'file'; | ||
return ( | ||
<React.Fragment> | ||
<Form.Item label={i18n.t('common.type')}> | ||
{form.getFieldDecorator('loadType', { | ||
initialValue: loadType, | ||
})( | ||
<Radio.Group onChange={this.handleChangeSvgType}> | ||
<Radio.Button value="file">{i18n.t('common.file')}</Radio.Button> | ||
<Radio.Button value="svg">{i18n.t('common.svg')}</Radio.Button> | ||
</Radio.Group>, | ||
)} | ||
</Form.Item> | ||
<Form.Item label={loadType === 'svg' ? i18n.t('common.svg') : i18n.t('common.file')}> | ||
{form.getFieldDecorator('src', { | ||
rules: [ | ||
{ | ||
required: true, | ||
message: i18n.t('validation.enter-property', { | ||
arg: loadType === 'svg' ? i18n.t('common.svg') : i18n.t('common.file'), | ||
}), | ||
}, | ||
], | ||
})(loadType === 'svg' ? <InputHtml /> : <FileUpload accept=".svg" />)} | ||
</Form.Item> | ||
</React.Fragment> | ||
); | ||
}, | ||
}; |