-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2083966
commit 7eb6743
Showing
26 changed files
with
288 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 0 additions & 82 deletions
82
packages/web/src/views/Calendar/components/LeftSidebar/LeftSidebar.tsx
This file was deleted.
Oops, something went wrong.
90 changes: 90 additions & 0 deletions
90
packages/web/src/views/Calendar/components/LeftSidebar/Sidebar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { FC } from "react"; | ||
import { WeekProps } from "@web/views/Calendar/hooks/useWeek"; | ||
import { DateCalcs } from "@web/views/Calendar/hooks/grid/useDateCalcs"; | ||
import { Measurements_Grid } from "@web/views/Calendar/hooks/grid/useGridLayout"; | ||
import { Divider } from "@web/components/Divider/Divider"; | ||
import { useAppSelector } from "@web/store/store.hooks"; | ||
import { selectSidebarTab } from "@web/ducks/events/selectors/view.selectors"; | ||
import { Text } from "@web/components/Text"; | ||
import { theme } from "@web/common/styles/theme"; | ||
|
||
import { | ||
SidebarContainer, | ||
CalendarLabel, | ||
CalendarListContainer, | ||
SidebarTabContainer, | ||
} from "./styled"; | ||
import { SomedaySection } from "./SomedaySection"; | ||
import { SidebarIconRow } from "./SidebarIconRow"; | ||
import { ToggleableMonthWidget } from "./ToggleableMonthWidget/ToggleableMonthWidget"; | ||
import { useSidebar } from "../../hooks/draft/sidebar/useSidebar"; | ||
|
||
interface Props { | ||
dateCalcs: DateCalcs; | ||
measurements: Measurements_Grid; | ||
weekProps: WeekProps; | ||
} | ||
|
||
export const Sidebar: FC<Props & React.HTMLAttributes<HTMLDivElement>> = ({ | ||
dateCalcs, | ||
measurements, | ||
weekProps, | ||
}: Props) => { | ||
const weekStart = weekProps.component.startOfView; | ||
const weekEnd = weekProps.component.endOfView; | ||
|
||
const tab = useAppSelector(selectSidebarTab); | ||
const sidebarProps = useSidebar(measurements, dateCalcs); | ||
|
||
return ( | ||
<SidebarContainer | ||
id="sidebar" | ||
role="complementary" | ||
onClick={sidebarProps.util.discardIfDrafting} | ||
> | ||
<SidebarTabContainer> | ||
{tab === "tasks" && ( | ||
<SomedaySection | ||
dateCalcs={dateCalcs} | ||
measurements={measurements} | ||
sidebarProps={sidebarProps} | ||
viewStart={weekStart} | ||
viewEnd={weekEnd} | ||
/> | ||
)} | ||
{tab === "monthWidget" && ( | ||
<> | ||
<ToggleableMonthWidget | ||
monthsShown={1} | ||
setStartOfView={weekProps.state.setStartOfView} | ||
isCurrentWeek={weekProps.component.isCurrentWeek} | ||
weekStart={weekProps.component.startOfView} | ||
/> | ||
<Divider | ||
role="separator" | ||
title="right sidebar divider" | ||
withAnimation={false} | ||
/> | ||
<CalendarListContainer> | ||
<Text color={theme.color.text.light} size="xl"> | ||
Calendars | ||
</Text> | ||
<CalendarLabel> | ||
<input | ||
checked={true} | ||
disabled={true} | ||
type="checkbox" | ||
style={{ marginRight: "6px" }} | ||
/> | ||
<Text color={theme.color.text.light} size="m"> | ||
primary | ||
</Text> | ||
</CalendarLabel> | ||
</CalendarListContainer> | ||
</> | ||
)} | ||
</SidebarTabContainer> | ||
<SidebarIconRow /> | ||
</SidebarContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.