feat: selected board style, boards spacing, text font size

This commit is contained in:
2025-08-16 09:20:01 +04:00
parent 3ece4677fb
commit 219689b947
9 changed files with 52 additions and 29 deletions

View File

@ -3,5 +3,5 @@
min-width: 130px;
flex-wrap: nowrap;
gap: 3px;
}
}

View File

@ -1,11 +1,11 @@
import React, { FC, useState } from "react";
import { Box, Flex, Group, Text } from "@mantine/core";
import styles from "@/app/deals/components/desktop/Board/Board.module.css";
import BoardMenu from "@/app/deals/components/shared/BoardMenu/BoardMenu";
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
import SmallPageBlock from "@/components/layout/SmallPageBlock/SmallPageBlock";
import InPlaceInput from "@/components/ui/InPlaceInput/InPlaceInput";
import { BoardSchema } from "@/lib/client";
import styles from "./Board.module.css";
type Props = {
board: BoardSchema;
@ -13,12 +13,18 @@ type Props = {
const Board: FC<Props> = ({ board }) => {
const { selectedBoard } = useBoardsContext();
const isSelected = selectedBoard?.id === board.id;
const [isHovered, setIsHovered] = useState(false);
const { onUpdateBoard } = useBoardsContext();
return (
<Flex p={"lg"}>
<SmallPageBlock active={selectedBoard?.id === board.id}>
<Flex>
<SmallPageBlock
style={{
borderBottomColor: "dodgerblue",
borderBottomWidth: isSelected ? "3px" : undefined,
}}
active={isSelected}>
<Group
px={"md"}
py={"xs"}

View File

@ -37,7 +37,11 @@ const Boards = () => {
renderItem={renderBoard}
onDragEnd={onDragEnd}
onItemClick={selectBoard}
containerStyle={{ flexWrap: "nowrap" }}
containerStyle={{
flexWrap: "nowrap",
gap: "var(--mantine-spacing-md)",
margin: "var(--mantine-spacing-md)",
}}
dragHandleStyle={{ cursor: "pointer" }}
disabled={isMobile}
/>

View File

@ -14,7 +14,7 @@ const CreateBoardButton = () => {
onComplete={onCreateBoard}
getChildren={startEditing => (
<Box
p={"sm"}
p={"xs"}
onClick={startEditing}>
<IconPlus />
</Box>
@ -22,6 +22,7 @@ const CreateBoardButton = () => {
modalTitle={"Создание доски"}
inputStyles={{
wrapper: {
padding: 4,
marginLeft: 15,
marginRight: 15,
},

View File

@ -1,4 +1,4 @@
import { Card } from "@mantine/core";
import { Card, Text } from "@mantine/core";
import { DealSchema } from "@/lib/client";
import styles from "./DealCard.module.css";
@ -7,7 +7,11 @@ type Props = {
};
const DealCard = ({ deal }: Props) => {
return <Card className={styles.container}>{deal.name}</Card>;
return (
<Card className={styles.container}>
<Text>{deal.name}</Text>
</Card>
);
};
export default DealCard;

View File

@ -109,13 +109,12 @@ const SortableDnd = <T extends BaseItem>({
items={items}
disabled={disabled}>
<Flex
gap={0}
style={{
gap: 0,
flexWrap: "nowrap",
flexDirection: vertical ? "column" : "row",
...containerStyle,
}}
role="application">
}}>
{items.map((item, index) => (
<Box
key={index}

View File

@ -1,4 +1,5 @@
.container {
border-width: 0;
@mixin dark {
background-color: var(--mantine-color-dark-7);
}

View File

@ -7,6 +7,7 @@ import {
useComputedColorScheme,
useMantineColorScheme,
} from "@mantine/core";
import SmallPageBlock from "@/components/layout/SmallPageBlock/SmallPageBlock";
import style from "./ColorSchemeToggle.module.css";
export function ColorSchemeToggle() {
@ -20,6 +21,7 @@ export function ColorSchemeToggle() {
};
return (
<SmallPageBlock>
<ActionIcon
onClick={toggleColorScheme}
variant="default"
@ -36,5 +38,6 @@ export function ColorSchemeToggle() {
stroke={1.5}
/>
</ActionIcon>
</SmallPageBlock>
);
}

View File

@ -40,7 +40,12 @@ export const theme = createTheme({
Card: {
defaultProps: {
radius,
}
}
},
},
Text: {
defaultProps: {
size: "sm",
},
},
},
});