mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-20 19:58:10 +02:00
refactor: AddFolder to NewFolder
This commit is contained in:
parent
e833493bce
commit
686894e0bd
@ -98,12 +98,12 @@ const CollectionItem = ({item, collectionId}) => {
|
|||||||
dropdownTippyRef.current.hide();
|
dropdownTippyRef.current.hide();
|
||||||
addRequest();
|
addRequest();
|
||||||
}}>
|
}}>
|
||||||
Add Request
|
New Request
|
||||||
</div>
|
</div>
|
||||||
<div className="dropdown-item" onClick={(e) => {
|
<div className="dropdown-item" onClick={(e) => {
|
||||||
dropdownTippyRef.current.hide();
|
dropdownTippyRef.current.hide();
|
||||||
}}>
|
}}>
|
||||||
Add Folder
|
New Folder
|
||||||
</div>
|
</div>
|
||||||
<div className="dropdown-item" onClick={(e) => {
|
<div className="dropdown-item" onClick={(e) => {
|
||||||
dropdownTippyRef.current.hide();
|
dropdownTippyRef.current.hide();
|
||||||
|
@ -5,13 +5,13 @@ import { IconChevronRight, IconDots } from '@tabler/icons';
|
|||||||
import Dropdown from 'components/Dropdown';
|
import Dropdown from 'components/Dropdown';
|
||||||
import actions from 'providers/Store/actions'
|
import actions from 'providers/Store/actions'
|
||||||
import { useStore } from 'providers/Store';
|
import { useStore } from 'providers/Store';
|
||||||
import AddFolder from 'components/Sidebar/AddFolder';
|
import NewFolder from 'components/Sidebar/NewFolder';
|
||||||
import CollectionItem from './CollectionItem';
|
import CollectionItem from './CollectionItem';
|
||||||
|
|
||||||
import StyledWrapper from './StyledWrapper';
|
import StyledWrapper from './StyledWrapper';
|
||||||
|
|
||||||
const Collection = ({collection}) => {
|
const Collection = ({collection}) => {
|
||||||
const [showAddFolderModal, setShowAddFolderModal] = useState(false);
|
const [showNewFolderModal, setShowNewFolderModal] = useState(false);
|
||||||
const [store, storeDispatch] = useStore();
|
const [store, storeDispatch] = useStore();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -48,13 +48,13 @@ const Collection = ({collection}) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const hideAddFolderModal = () => setShowAddFolderModal(false);
|
const hideAddFolderModal = () => setShowNewFolderModal(false);
|
||||||
const collectionItems = get(collection, 'current.items');
|
const collectionItems = get(collection, 'current.items');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledWrapper className="flex flex-col">
|
<StyledWrapper className="flex flex-col">
|
||||||
{showAddFolderModal && (
|
{showNewFolderModal && (
|
||||||
<AddFolder
|
<NewFolder
|
||||||
collectionUid={collection.uid}
|
collectionUid={collection.uid}
|
||||||
handleCancel={hideAddFolderModal}
|
handleCancel={hideAddFolderModal}
|
||||||
handleClose={hideAddFolderModal}
|
handleClose={hideAddFolderModal}
|
||||||
@ -68,13 +68,13 @@ const Collection = ({collection}) => {
|
|||||||
<div className="dropdown-item" onClick={(e) => {
|
<div className="dropdown-item" onClick={(e) => {
|
||||||
menuDropdownTippyRef.current.hide();
|
menuDropdownTippyRef.current.hide();
|
||||||
}}>
|
}}>
|
||||||
Add Request
|
New Request
|
||||||
</div>
|
</div>
|
||||||
<div className="dropdown-item" onClick={(e) => {
|
<div className="dropdown-item" onClick={(e) => {
|
||||||
menuDropdownTippyRef.current.hide();
|
menuDropdownTippyRef.current.hide();
|
||||||
setShowAddFolderModal(true)
|
setShowNewFolderModal(true)
|
||||||
}}>
|
}}>
|
||||||
Add Folder
|
New Folder
|
||||||
</div>
|
</div>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,7 +5,7 @@ import Modal from 'components/Modal';
|
|||||||
import actions from 'providers/Store/actions'
|
import actions from 'providers/Store/actions'
|
||||||
import { useStore } from 'providers/Store';
|
import { useStore } from 'providers/Store';
|
||||||
|
|
||||||
const AddFolder = ({collectionUid, handleCancel, handleClose}) => {
|
const NewFolder = ({collectionUid, handleCancel, handleClose}) => {
|
||||||
const [store, storeDispatch] = useStore();
|
const [store, storeDispatch] = useStore();
|
||||||
const inputRef = useRef();
|
const inputRef = useRef();
|
||||||
const formik = useFormik({
|
const formik = useFormik({
|
||||||
@ -40,8 +40,8 @@ const AddFolder = ({collectionUid, handleCancel, handleClose}) => {
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
size="sm"
|
size="sm"
|
||||||
title='Add Folder'
|
title='New Folder'
|
||||||
confirmText='Add Folder'
|
confirmText='Create'
|
||||||
handleConfirm={onSubmit}
|
handleConfirm={onSubmit}
|
||||||
handleCancel={handleCancel}
|
handleCancel={handleCancel}
|
||||||
>
|
>
|
||||||
@ -64,4 +64,4 @@ const AddFolder = ({collectionUid, handleCancel, handleClose}) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddFolder;
|
export default NewFolder;
|
Loading…
x
Reference in New Issue
Block a user