Skip to content

Commit

Permalink
#6 Fix requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tina-e committed Aug 18, 2022
1 parent 2b91cc5 commit 99afdd0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ export const Sidebar = () => {
className={cx(
"h-full overflow-y-clip shadow-lg divide-y-[1px] divide-lightGrey transition-width duration-300",
{
"w-[40px] pt-4 px-1 overflow-hidden": !sidebarOpen,
"w-[400px] p-4": sidebarOpen,
"w-[65px] overflow-hidden": !sidebarOpen,
"w-[400px]": sidebarOpen,
}
)}
>
<SidebarHeader
setActiveSidebar={setActiveSidebar}
setSidebarOpenForContent={setSidebarOpen}
sidebarOpen={sidebarOpen}
setSidebarOpen={setSidebarOpen}
/>
{sidebars.map(
(sidebar) =>
Expand Down
10 changes: 5 additions & 5 deletions src/components/sidebar/SidebarHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Button } from "../Button";

interface SidebarProps {
setActiveSidebar: Dispatch<SetStateAction<string>>;
setSidebarOpenForContent: Dispatch<SetStateAction<boolean>>;
sidebarOpen: boolean;
setSidebarOpen: Dispatch<SetStateAction<boolean>>;
}

const buttons = [
Expand All @@ -25,14 +26,14 @@ const buttons = [

export const SidebarHeader: React.FC<SidebarProps> = ({
setActiveSidebar,
setSidebarOpenForContent,
sidebarOpen,
setSidebarOpen,
}) => {
const [activeButton, setActiveButton] = useState<string>(buttons[0].name);
const [sidebarOpen, setSidebarOpen] = useState<boolean>(true);

return (
<div
className={cx("flex flex-row mb-1", {
className={cx("flex flex-row mb-1 pt-4 pb-1 px-4", {
"justify-between": sidebarOpen,
"justify-end": !sidebarOpen,
})}
Expand All @@ -53,7 +54,6 @@ export const SidebarHeader: React.FC<SidebarProps> = ({
icon={<List size={18} />}
onClick={() => {
setSidebarOpen(!sidebarOpen);
setSidebarOpenForContent(!sidebarOpen);
}}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/SidebarNotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const SidebarNotes = () => {
textColor="text-white"
hasText={false}
alternativePadding="p-1"
icon={<Plus size={18} />}
icon={<Plus size={18} weight="bold" />}
></Button>
</div>
{notes.length <= 0 && (
Expand Down

0 comments on commit 99afdd0

Please sign in to comment.