File tree Expand file tree Collapse file tree 8 files changed +58
-16
lines changed
Forms/EventForm/DateTimeSection Expand file tree Collapse file tree 8 files changed +58
-16
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { sagaMiddleware } from "@web/common/store/middlewares";
1414import { GlobalStyle } from "@web/components/GlobalStyle" ;
1515import { sagas } from "@web/store/sagas" ;
1616import { theme } from "./common/styles/theme" ;
17+ import { IconProvider } from "./components/IconProvider/IconProvider" ;
1718import { RootRouter } from "./routers" ;
1819import { store } from "./store" ;
1920
@@ -39,7 +40,9 @@ export const App = () => {
3940 < SuperTokensWrapper >
4041 < GlobalStyle />
4142 < ThemeProvider theme = { theme } >
42- < RootRouter />
43+ < IconProvider >
44+ < RootRouter />
45+ </ IconProvider >
4346 < ToastContainer
4447 position = "bottom-left"
4548 autoClose = { 5000 }
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { IconContext } from "@phosphor-icons/react" ;
3+
4+ export const IconProvider = ( { children } : { children : React . ReactNode } ) => {
5+ return (
6+ < IconContext . Provider
7+ value = { {
8+ size : 25 ,
9+ } }
10+ >
11+ { children }
12+ </ IconContext . Provider >
13+ ) ;
14+ } ;
Original file line number Diff line number Diff line change 11import { css } from "styled-components" ;
22import { IconProps } from "@phosphor-icons/react" ;
33
4- interface Props extends IconProps {
5- isFocused : boolean ;
6- }
7-
8- export const iconStyles = css < Props > `
9- color: ${ ( { theme, isFocused } ) =>
10- isFocused ? theme . color . text . light : theme . color . text . lightInactive } ;
4+ export const iconStyles = css < IconProps > `
115 transition: filter 0.2s ease;
126
137 &:hover {
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export const Dedication = () => {
4141 justifyContent = { JustifyContent . SPACE_BETWEEN }
4242 >
4343 < h2 > For Derek</ h2 >
44- < StyledXIcon size = { 20 } onClick = { close } />
44+ < StyledXIcon onClick = { close } />
4545 </ Flex >
4646 < StyledDedicationText >
4747 This app is dedicated to Derek John Benton (1993-2014).
Original file line number Diff line number Diff line change 11import dayjs , { Dayjs } from "dayjs" ;
22import React , { FC } from "react" ;
3+ import { theme } from "@web/common/styles/theme" ;
34import { getCalendarHeadingLabel } from "@web/common/utils/web.date.util" ;
45import { AlignItems } from "@web/components/Flex/styled" ;
56import { SidebarIcon } from "@web/components/Icons/Sidebar" ;
@@ -59,7 +60,13 @@ export const Header: FC<Props> = ({
5960 onClick = { ( ) => dispatch ( viewSlice . actions . toggleSidebar ( ) ) }
6061 shortcut = "["
6162 >
62- < SidebarIcon size = { 25 } isFocused = { isSidebarOpen } />
63+ < SidebarIcon
64+ color = {
65+ isSidebarOpen
66+ ? theme . color . text . light
67+ : theme . color . text . lightInactive
68+ }
69+ />
6370 </ TooltipWrapper >
6471 < StyledLeftGroup >
6572 < StyledHeaderLabel aria-level = { 1 } role = "heading" >
Original file line number Diff line number Diff line change 11import React from "react" ;
2+ import { Command } from "@phosphor-icons/react" ;
3+ import { theme } from "@web/common/styles/theme" ;
24import { CalendarIcon } from "@web/components/Icons/Calendar" ;
35import { CommandIcon } from "@web/components/Icons/Command" ;
46import { TodoIcon } from "@web/components/Icons/Todo" ;
@@ -32,14 +34,26 @@ export const SidebarIconRow = () => {
3234 shortcut = "CMD + K"
3335 onClick = { toggleCmdPalette }
3436 >
35- < CommandIcon isFocused = { isCmdPaletteOpen } size = { 25 } />
37+ < CommandIcon
38+ color = {
39+ isCmdPaletteOpen
40+ ? theme . color . text . darkPlaceholder
41+ : theme . color . text . light
42+ }
43+ />
3644 </ TooltipWrapper >
3745 < TooltipWrapper
3846 description = "Open tasks"
3947 shortcut = "SHIFT + 1"
4048 onClick = { ( ) => dispatch ( viewSlice . actions . updateSidebarTab ( "tasks" ) ) }
4149 >
42- < TodoIcon isFocused = { tab === "tasks" } size = { 25 } />
50+ < TodoIcon
51+ color = {
52+ tab === "tasks"
53+ ? theme . color . text . light
54+ : theme . color . text . darkPlaceholder
55+ }
56+ />
4357 </ TooltipWrapper >
4458 < TooltipWrapper
4559 description = "Open month"
@@ -48,7 +62,13 @@ export const SidebarIconRow = () => {
4862 dispatch ( viewSlice . actions . updateSidebarTab ( "monthWidget" ) )
4963 }
5064 >
51- < CalendarIcon isFocused = { tab === "monthWidget" } size = { 25 } />
65+ < CalendarIcon
66+ color = {
67+ tab === "monthWidget"
68+ ? theme . color . text . light
69+ : theme . color . text . darkPlaceholder
70+ }
71+ />
5272 </ TooltipWrapper >
5373 </ LeftIconGroup >
5474 </ IconRow >
Original file line number Diff line number Diff line change @@ -159,7 +159,9 @@ export const DatePickers: FC<Props> = ({
159159 } }
160160 onChange = { ( ) => null }
161161 onInputClick = { ( ) => {
162- isEndDatePickerOpen && setIsEndDatePickerOpen ( false ) ;
162+ if ( isEndDatePickerOpen ) {
163+ setIsEndDatePickerOpen ( false ) ;
164+ }
163165 setIsStartDatePickerOpen ( true ) ;
164166 } }
165167 onKeyDown = { ( e ) => onPickerKeyDown ( "start" , e ) }
@@ -182,7 +184,9 @@ export const DatePickers: FC<Props> = ({
182184 onCalendarOpen = { ( ) => setIsEndDatePickerOpen ( true ) }
183185 onChange = { ( ) => null }
184186 onInputClick = { ( ) => {
185- isStartDatePickerOpen && setIsStartDatePickerOpen ( false ) ;
187+ if ( isStartDatePickerOpen ) {
188+ setIsStartDatePickerOpen ( false ) ;
189+ }
186190 setIsEndDatePickerOpen ( true ) ;
187191 } }
188192 onKeyDown = { ( e ) => onPickerKeyDown ( "end" , e ) }
Original file line number Diff line number Diff line change 11import dayjs from "dayjs" ;
22import customParseFormat from "dayjs/plugin/customParseFormat" ;
3- import React , { FC , SetStateAction , useRef } from "react" ;
3+ import React , { FC , SetStateAction } from "react" ;
44import { Categories_Event , Schema_Event } from "@core/types/event.types" ;
55import { SelectOption } from "@web/common/types/component.types" ;
66import { AlignItems } from "@web/components/Flex/styled" ;
You can’t perform that action at this time.
0 commit comments