refactor: AddFolder to NewFolder

This commit is contained in:
Anoop M D 2022-03-13 23:01:16 +05:30
parent e833493bce
commit 686894e0bd
3 changed files with 14 additions and 14 deletions

View File

@ -98,12 +98,12 @@ const CollectionItem = ({item, collectionId}) => {
dropdownTippyRef.current.hide();
addRequest();
}}>
Add Request
New Request
</div>
<div className="dropdown-item" onClick={(e) => {
dropdownTippyRef.current.hide();
}}>
Add Folder
New Folder
</div>
<div className="dropdown-item" onClick={(e) => {
dropdownTippyRef.current.hide();

View File

@ -5,13 +5,13 @@ import { IconChevronRight, IconDots } from '@tabler/icons';
import Dropdown from 'components/Dropdown';
import actions from 'providers/Store/actions'
import { useStore } from 'providers/Store';
import AddFolder from 'components/Sidebar/AddFolder';
import NewFolder from 'components/Sidebar/NewFolder';
import CollectionItem from './CollectionItem';
import StyledWrapper from './StyledWrapper';
const Collection = ({collection}) => {
const [showAddFolderModal, setShowAddFolderModal] = useState(false);
const [showNewFolderModal, setShowNewFolderModal] = useState(false);
const [store, storeDispatch] = useStore();
const {
@ -48,13 +48,13 @@ const Collection = ({collection}) => {
});
};
const hideAddFolderModal = () => setShowAddFolderModal(false);
const hideAddFolderModal = () => setShowNewFolderModal(false);
const collectionItems = get(collection, 'current.items');
return (
<StyledWrapper className="flex flex-col">
{showAddFolderModal && (
<AddFolder
{showNewFolderModal && (
<NewFolder
collectionUid={collection.uid}
handleCancel={hideAddFolderModal}
handleClose={hideAddFolderModal}
@ -68,13 +68,13 @@ const Collection = ({collection}) => {
<div className="dropdown-item" onClick={(e) => {
menuDropdownTippyRef.current.hide();
}}>
Add Request
New Request
</div>
<div className="dropdown-item" onClick={(e) => {
menuDropdownTippyRef.current.hide();
setShowAddFolderModal(true)
setShowNewFolderModal(true)
}}>
Add Folder
New Folder
</div>
</Dropdown>
</div>

View File

@ -5,7 +5,7 @@ import Modal from 'components/Modal';
import actions from 'providers/Store/actions'
import { useStore } from 'providers/Store';
const AddFolder = ({collectionUid, handleCancel, handleClose}) => {
const NewFolder = ({collectionUid, handleCancel, handleClose}) => {
const [store, storeDispatch] = useStore();
const inputRef = useRef();
const formik = useFormik({
@ -40,8 +40,8 @@ const AddFolder = ({collectionUid, handleCancel, handleClose}) => {
return (
<Modal
size="sm"
title='Add Folder'
confirmText='Add Folder'
title='New Folder'
confirmText='Create'
handleConfirm={onSubmit}
handleCancel={handleCancel}
>
@ -64,4 +64,4 @@ const AddFolder = ({collectionUid, handleCancel, handleClose}) => {
);
};
export default AddFolder;
export default NewFolder;