chore: fixed indentation

This commit is contained in:
Anusree Subash 2022-10-05 20:29:05 +05:30
parent 72a9567221
commit 114fe26fe2
2 changed files with 46 additions and 47 deletions

View File

@ -3,38 +3,37 @@ import React from "react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
const WorkspaceConfigurer = ({onClose}) => { const WorkspaceConfigurer = ({onClose}) => {
const { workspaces } = useSelector((state) => state.workspaces); const { workspaces } = useSelector((state) => state.workspaces);
const onSubmit = () => { const onSubmit = () => {
onClose(); onClose();
} }
return (
return ( <Modal
<Modal size="md"
size="md" title="Workspaces"
title="Workspaces" confirmText="Create"
confirmText="Create" handleConfirm={onSubmit}
handleConfirm={onSubmit} handleCancel={onClose}
handleCancel={onClose} >
> <ul className="mb-2">
<ul className="mb-2"> {workspaces && workspaces.length && workspaces.map((workspace) => (
{workspaces && workspaces.length && workspaces.map((workspace) => ( <div className="flex justify-between items-baseline w-4/5 mb-2">
<div className="flex justify-between items-baseline w-4/5 mb-2"> <li key={workspace.uid}>{workspace.name}</li>
<li key={workspace.uid}>{workspace.name}</li> <button
<button style={{backgroundColor: "var(--color-brand)"}}
style={{backgroundColor: "var(--color-brand)"}} className="flex items-center h-full text-white active:bg-blue-600 font-bold text-xs px-4 py-2 ml-2 uppercase rounded shadow hover:shadow-md outline-none focus:outline-none ease-linear transition-all duration-150"
className="flex items-center h-full text-white active:bg-blue-600 font-bold text-xs px-4 py-2 ml-2 uppercase rounded shadow hover:shadow-md outline-none focus:outline-none ease-linear transition-all duration-150" onClick={() => console.log("delete")}
onClick={() => console.log("delete")} >
> <span style={{marginLeft: 5}}>Delete</span>
<span style={{marginLeft: 5}}>Delete</span> </button>
</button> </div>
</div> ))}
))} </ul>
</ul> </Modal>
</Modal> )
)
} }
export default WorkspaceConfigurer; export default WorkspaceConfigurer;

View File

@ -10,7 +10,7 @@ const WorkspaceSelector = () => {
const dropdownTippyRef = useRef(); const dropdownTippyRef = useRef();
const [openWorkspacesModal, setOpenWorkspacesModal] = useState(false); const [openWorkspacesModal, setOpenWorkspacesModal] = useState(false);
const [activeWorkspace, setActiveWorkspace] = useState({}); const [activeWorkspace, setActiveWorkspace] = useState({});
const dispatch = useDispatch(); const dispatch = useDispatch();
const { workspaces, activeWorkspaceUid } = useSelector((state) => state.workspaces); const { workspaces, activeWorkspaceUid } = useSelector((state) => state.workspaces);
@ -21,14 +21,14 @@ const WorkspaceSelector = () => {
const Icon = forwardRef((props, ref) => { const Icon = forwardRef((props, ref) => {
return ( return (
<div ref={ref} className="current-workspace flex justify-between items-center pl-2 pr-2 py-1 select-none"> <div ref={ref} className="current-workspace flex justify-between items-center pl-2 pr-2 py-1 select-none">
<div className='flex items-center'> <div className='flex items-center'>
<span className='mr-2'> <span className='mr-2'>
<IconBox size={18} strokeWidth={1.5}/> <IconBox size={18} strokeWidth={1.5}/>
</span> </span>
<span> <span>
{activeWorkspace.name} {activeWorkspace.name}
</span> </span>
</div> </div>
<IconCaretDown className="caret" size={14} strokeWidth={2}/> <IconCaretDown className="caret" size={14} strokeWidth={2}/>
</div> </div>
); );
@ -36,19 +36,19 @@ const WorkspaceSelector = () => {
const onDropdownCreate = (ref) => dropdownTippyRef.current = ref; const onDropdownCreate = (ref) => dropdownTippyRef.current = ref;
const handleSelectWorkspace = (workspace) => { const handleSelectWorkspace = (workspace) => {
dispatch(selectWorkspace(workspace)); dispatch(selectWorkspace(workspace));
} }
return ( return (
<StyledWrapper> <StyledWrapper>
<div className="items-center cursor-pointer"> <div className="items-center cursor-pointer">
<Dropdown onCreate={onDropdownCreate} icon={<Icon />} placement='bottom-end'> <Dropdown onCreate={onDropdownCreate} icon={<Icon />} placement='bottom-end'>
{workspaces && workspaces.length && workspaces.map((workspace) => ( {workspaces && workspaces.length && workspaces.map((workspace) => (
<div className="dropdown-item" onClick={() => handleSelectWorkspace(workspace)}> <div className="dropdown-item" onClick={() => handleSelectWorkspace(workspace)}>
<span>{workspace.name}</span> <span>{workspace.name}</span>
</div> </div>
))} ))}
<div className="dropdown-item" style={{borderTop: 'solid 1px #e7e7e7'}} onClick={() => { <div className="dropdown-item" style={{borderTop: 'solid 1px #e7e7e7'}} onClick={() => {
setOpenWorkspacesModal(true); setOpenWorkspacesModal(true);