Skip to content

Commit 1c51c5b

Browse files
committed
✨ Feat: Add IconProvider for consistent icon sizing
1 parent 64e2d37 commit 1c51c5b

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

packages/web/src/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { sagaMiddleware } from "@web/common/store/middlewares";
1414
import { GlobalStyle } from "@web/components/GlobalStyle";
1515
import { sagas } from "@web/store/sagas";
1616
import { theme } from "./common/styles/theme";
17+
import { IconProvider } from "./components/IconProvider/IconProvider";
1718
import { RootRouter } from "./routers";
1819
import { 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}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
};

packages/web/src/views/Calendar/components/Dedication/Dedication.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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).

packages/web/src/views/Calendar/components/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const Header: FC<Props> = ({
5959
onClick={() => dispatch(viewSlice.actions.toggleSidebar())}
6060
shortcut="["
6161
>
62-
<SidebarIcon size={25} isFocused={isSidebarOpen} />
62+
<SidebarIcon isFocused={isSidebarOpen} />
6363
</TooltipWrapper>
6464
<StyledLeftGroup>
6565
<StyledHeaderLabel aria-level={1} role="heading">

packages/web/src/views/Calendar/components/Sidebar/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const Sidebar: FC<Props & React.HTMLAttributes<HTMLDivElement>> = ({
5252
/>
5353
)}
5454
</SidebarTabContainer>
55-
<SidebarIconRow />
55+
{/* <SidebarIconRow /> */}
5656
</SidebarContainer>
5757
);
5858
};

packages/web/src/views/Calendar/components/Sidebar/SidebarIconRow/SidebarIconRow.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ export const SidebarIconRow = () => {
3232
shortcut="CMD + K"
3333
onClick={toggleCmdPalette}
3434
>
35-
<CommandIcon isFocused={isCmdPaletteOpen} size={25} />
35+
<CommandIcon isFocused={isCmdPaletteOpen} />
3636
</TooltipWrapper>
3737
<TooltipWrapper
3838
description="Open tasks"
3939
shortcut="SHIFT + 1"
4040
onClick={() => dispatch(viewSlice.actions.updateSidebarTab("tasks"))}
4141
>
42-
<TodoIcon isFocused={tab === "tasks"} size={25} />
42+
<TodoIcon isFocused={tab === "tasks"} />
4343
</TooltipWrapper>
4444
<TooltipWrapper
4545
description="Open month"
@@ -48,7 +48,7 @@ export const SidebarIconRow = () => {
4848
dispatch(viewSlice.actions.updateSidebarTab("monthWidget"))
4949
}
5050
>
51-
<CalendarIcon isFocused={tab === "monthWidget"} size={25} />
51+
<CalendarIcon isFocused={tab === "monthWidget"} />
5252
</TooltipWrapper>
5353
</LeftIconGroup>
5454
</IconRow>

0 commit comments

Comments
 (0)