refactor: theme icon for icon size setting

This commit is contained in:
2025-09-04 09:56:05 +04:00
parent b5934a7ed2
commit 604238ca43
4 changed files with 26 additions and 6 deletions

View File

@ -1,8 +1,8 @@
import React, { FC } from "react"; import React, { FC } from "react";
import { IconDotsVertical, IconEdit, IconTrash } from "@tabler/icons-react"; import { IconDotsVertical, IconEdit, IconTrash } from "@tabler/icons-react";
import { Box, Group, Menu, Text } from "@mantine/core"; import { Box, Group, Menu, Text } from "@mantine/core";
import ThemeIcon from "@/components/ui/ThemeIcon/ThemeIcon";
import { BoardSchema } from "@/lib/client"; import { BoardSchema } from "@/lib/client";
import { iconSizeSm } from "@/theme";
type Props = { type Props = {
board: BoardSchema; board: BoardSchema;
@ -26,7 +26,9 @@ const BoardMenu: FC<Props> = ({
cursor: "pointer", cursor: "pointer",
}} }}
onClick={e => e.stopPropagation()}> onClick={e => e.stopPropagation()}>
<IconDotsVertical size={iconSizeSm} /> <ThemeIcon size={"sm"}>
<IconDotsVertical />
</ThemeIcon>
</Box> </Box>
</Menu.Target> </Menu.Target>
<Menu.Dropdown> <Menu.Dropdown>

View File

@ -9,7 +9,7 @@ import { Box, Group, Menu, Text } from "@mantine/core";
import { useDrawersContext } from "@/drawers/DrawersContext"; import { useDrawersContext } from "@/drawers/DrawersContext";
import useIsMobile from "@/hooks/utils/useIsMobile"; import useIsMobile from "@/hooks/utils/useIsMobile";
import { BoardSchema, StatusSchema } from "@/lib/client"; import { BoardSchema, StatusSchema } from "@/lib/client";
import { iconSizeSm } from "@/theme"; import ThemeIcon from "@/components/ui/ThemeIcon/ThemeIcon";
type Props = { type Props = {
status: StatusSchema; status: StatusSchema;
@ -37,7 +37,9 @@ const StatusMenu: FC<Props> = ({
<Box <Box
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
onClick={e => e.stopPropagation()}> onClick={e => e.stopPropagation()}>
<IconDotsVertical size={iconSizeSm} /> <ThemeIcon size={"sm"}>
<IconDotsVertical />
</ThemeIcon>
</Box> </Box>
</Menu.Target> </Menu.Target>
<Menu.Dropdown> <Menu.Dropdown>

View File

@ -0,0 +1,18 @@
import React, { FC } from "react";
import { Center, ThemeIconProps } from "@mantine/core";
type Props = ThemeIconProps;
const ThemeIcon: FC<Props> = props => {
return (
<Center>
<ThemeIcon
bg={"transparent"}
{...props}>
{props.children}
</ThemeIcon>
</Center>
);
};
export default ThemeIcon;

View File

@ -14,8 +14,6 @@ export const myColor: MantineColorsTuple = [
"#00718c", "#00718c",
]; ];
export const iconSizeSm = 21;
const radius = "md"; const radius = "md";
const font = Roboto({ const font = Roboto({