mirror of
https://github.com/strapi/strapi.git
synced 2025-11-09 22:59:14 +00:00
parent
7b1e75a495
commit
27a19dc9ed
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { Button } from '@buffetjs/core';
|
import { Button } from '@buffetjs/core';
|
||||||
import { CheckPermissions } from 'strapi-helper-plugin';
|
import { CheckPermissions } from 'strapi-helper-plugin';
|
||||||
import useModalContext from '../../hooks/useModalContext';
|
import useModalContext from '../../hooks/useModalContext';
|
||||||
@ -12,7 +11,7 @@ import SelectedAssets from '../SelectedAssets';
|
|||||||
import IntlText from '../IntlText';
|
import IntlText from '../IntlText';
|
||||||
import BaselineAlignmentWrapper from './BaselineAlignmentWrapper';
|
import BaselineAlignmentWrapper from './BaselineAlignmentWrapper';
|
||||||
|
|
||||||
const ListModal = ({ noNavigation }) => {
|
const ListModal = () => {
|
||||||
const { currentTab, goTo, handleModalTabChange, selectedFiles } = useModalContext();
|
const { currentTab, goTo, handleModalTabChange, selectedFiles } = useModalContext();
|
||||||
|
|
||||||
const handleClick = to => {
|
const handleClick = to => {
|
||||||
@ -48,10 +47,12 @@ const ListModal = ({ noNavigation }) => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const renderRightContent = noNavigation ? null : renderUploadModalButton;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalNavWrapper initialTab={currentTab} links={links} renderRightContent={renderRightContent}>
|
<ModalNavWrapper
|
||||||
|
initialTab={currentTab}
|
||||||
|
links={links}
|
||||||
|
renderRightContent={renderUploadModalButton}
|
||||||
|
>
|
||||||
{to => (
|
{to => (
|
||||||
<ModalSection>
|
<ModalSection>
|
||||||
{to === 'browse' && <BrowseAssets />}
|
{to === 'browse' && <BrowseAssets />}
|
||||||
@ -62,12 +63,4 @@ const ListModal = ({ noNavigation }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
ListModal.defaultProps = {
|
|
||||||
noNavigation: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
ListModal.propTypes = {
|
|
||||||
noNavigation: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ListModal;
|
export default ListModal;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user