mirror of
https://github.com/strapi/strapi.git
synced 2025-10-01 03:12:48 +00:00
Add button upload trads
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
a085c87cc1
commit
f179b9cf5d
@ -15,12 +15,14 @@ import pluginId from '../../pluginId';
|
||||
import stepper from './utils/stepper';
|
||||
import init from './init';
|
||||
import reducer, { initialState } from './reducer';
|
||||
import getTrad from '../../utils/getTrad';
|
||||
|
||||
const ModalStepper = ({ isOpen, onToggle }) => {
|
||||
const { formatMessage } = useGlobalContext();
|
||||
const [reducerState, dispatch] = useReducer(reducer, initialState, init);
|
||||
const { currentStep, filesToUpload } = reducerState.toJS();
|
||||
const { Component, headerTradId, next, prev } = stepper[currentStep];
|
||||
const filesToUploadLength = filesToUpload.length;
|
||||
|
||||
const addFilesToUpload = ({ target: { value } }) => {
|
||||
dispatch({
|
||||
@ -134,9 +136,20 @@ const ModalStepper = ({ isOpen, onToggle }) => {
|
||||
<Button type="button" color="cancel" onClick={onToggle}>
|
||||
{formatMessage({ id: 'app.components.Button.cancel' })}
|
||||
</Button>
|
||||
<Button type="button" color="success" onClick={handleUploadFiles}>
|
||||
{formatMessage({ id: 'app.components.Button.cancel' })}
|
||||
</Button>
|
||||
{currentStep === 'upload' && (
|
||||
<Button type="button" color="success" onClick={handleUploadFiles}>
|
||||
{formatMessage(
|
||||
{
|
||||
id: getTrad(
|
||||
`modal.upload-list.footer.button.${
|
||||
filesToUploadLength > 1 ? 'plural' : 'singular'
|
||||
}`
|
||||
),
|
||||
},
|
||||
{ number: filesToUploadLength }
|
||||
)}
|
||||
</Button>
|
||||
)}
|
||||
</section>
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
|
@ -16,6 +16,8 @@
|
||||
"modal.upload-list.sub-header-title.singular": "{number} asset selected",
|
||||
"modal.upload-list.sub-header-subtitle": "Manage the assets before adding them to the Media Library",
|
||||
"modal.upload-list.sub-header.button": "Add more assets",
|
||||
"modal.upload-list.footer.button.singular": "Upload {number} asset to the library",
|
||||
"modal.upload-list.footer.button.plural": "Upload {number} assets to the library",
|
||||
"plugin.name": "Media Library",
|
||||
"plugin.description.long": "Media file management.",
|
||||
"plugin.description.short": "Media file management.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user