feat: selected board style, boards spacing, text font size
This commit is contained in:
@ -3,5 +3,5 @@
|
|||||||
min-width: 130px;
|
min-width: 130px;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
gap: 3px;
|
gap: 3px;
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import React, { FC, useState } from "react";
|
import React, { FC, useState } from "react";
|
||||||
import { Box, Flex, Group, Text } from "@mantine/core";
|
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 BoardMenu from "@/app/deals/components/shared/BoardMenu/BoardMenu";
|
||||||
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
|
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
|
||||||
import SmallPageBlock from "@/components/layout/SmallPageBlock/SmallPageBlock";
|
import SmallPageBlock from "@/components/layout/SmallPageBlock/SmallPageBlock";
|
||||||
import InPlaceInput from "@/components/ui/InPlaceInput/InPlaceInput";
|
import InPlaceInput from "@/components/ui/InPlaceInput/InPlaceInput";
|
||||||
import { BoardSchema } from "@/lib/client";
|
import { BoardSchema } from "@/lib/client";
|
||||||
|
import styles from "./Board.module.css";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
board: BoardSchema;
|
board: BoardSchema;
|
||||||
@ -13,12 +13,18 @@ type Props = {
|
|||||||
|
|
||||||
const Board: FC<Props> = ({ board }) => {
|
const Board: FC<Props> = ({ board }) => {
|
||||||
const { selectedBoard } = useBoardsContext();
|
const { selectedBoard } = useBoardsContext();
|
||||||
|
const isSelected = selectedBoard?.id === board.id;
|
||||||
const [isHovered, setIsHovered] = useState(false);
|
const [isHovered, setIsHovered] = useState(false);
|
||||||
const { onUpdateBoard } = useBoardsContext();
|
const { onUpdateBoard } = useBoardsContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex p={"lg"}>
|
<Flex>
|
||||||
<SmallPageBlock active={selectedBoard?.id === board.id}>
|
<SmallPageBlock
|
||||||
|
style={{
|
||||||
|
borderBottomColor: "dodgerblue",
|
||||||
|
borderBottomWidth: isSelected ? "3px" : undefined,
|
||||||
|
}}
|
||||||
|
active={isSelected}>
|
||||||
<Group
|
<Group
|
||||||
px={"md"}
|
px={"md"}
|
||||||
py={"xs"}
|
py={"xs"}
|
||||||
|
|||||||
@ -37,7 +37,11 @@ const Boards = () => {
|
|||||||
renderItem={renderBoard}
|
renderItem={renderBoard}
|
||||||
onDragEnd={onDragEnd}
|
onDragEnd={onDragEnd}
|
||||||
onItemClick={selectBoard}
|
onItemClick={selectBoard}
|
||||||
containerStyle={{ flexWrap: "nowrap" }}
|
containerStyle={{
|
||||||
|
flexWrap: "nowrap",
|
||||||
|
gap: "var(--mantine-spacing-md)",
|
||||||
|
margin: "var(--mantine-spacing-md)",
|
||||||
|
}}
|
||||||
dragHandleStyle={{ cursor: "pointer" }}
|
dragHandleStyle={{ cursor: "pointer" }}
|
||||||
disabled={isMobile}
|
disabled={isMobile}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -14,7 +14,7 @@ const CreateBoardButton = () => {
|
|||||||
onComplete={onCreateBoard}
|
onComplete={onCreateBoard}
|
||||||
getChildren={startEditing => (
|
getChildren={startEditing => (
|
||||||
<Box
|
<Box
|
||||||
p={"sm"}
|
p={"xs"}
|
||||||
onClick={startEditing}>
|
onClick={startEditing}>
|
||||||
<IconPlus />
|
<IconPlus />
|
||||||
</Box>
|
</Box>
|
||||||
@ -22,6 +22,7 @@ const CreateBoardButton = () => {
|
|||||||
modalTitle={"Создание доски"}
|
modalTitle={"Создание доски"}
|
||||||
inputStyles={{
|
inputStyles={{
|
||||||
wrapper: {
|
wrapper: {
|
||||||
|
padding: 4,
|
||||||
marginLeft: 15,
|
marginLeft: 15,
|
||||||
marginRight: 15,
|
marginRight: 15,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Card } from "@mantine/core";
|
import { Card, Text } from "@mantine/core";
|
||||||
import { DealSchema } from "@/lib/client";
|
import { DealSchema } from "@/lib/client";
|
||||||
import styles from "./DealCard.module.css";
|
import styles from "./DealCard.module.css";
|
||||||
|
|
||||||
@ -7,7 +7,11 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const DealCard = ({ deal }: 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;
|
export default DealCard;
|
||||||
|
|||||||
@ -109,13 +109,12 @@ const SortableDnd = <T extends BaseItem>({
|
|||||||
items={items}
|
items={items}
|
||||||
disabled={disabled}>
|
disabled={disabled}>
|
||||||
<Flex
|
<Flex
|
||||||
gap={0}
|
|
||||||
style={{
|
style={{
|
||||||
|
gap: 0,
|
||||||
flexWrap: "nowrap",
|
flexWrap: "nowrap",
|
||||||
flexDirection: vertical ? "column" : "row",
|
flexDirection: vertical ? "column" : "row",
|
||||||
...containerStyle,
|
...containerStyle,
|
||||||
}}
|
}}>
|
||||||
role="application">
|
|
||||||
{items.map((item, index) => (
|
{items.map((item, index) => (
|
||||||
<Box
|
<Box
|
||||||
key={index}
|
key={index}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
.container {
|
.container {
|
||||||
|
border-width: 0;
|
||||||
@mixin dark {
|
@mixin dark {
|
||||||
background-color: var(--mantine-color-dark-7);
|
background-color: var(--mantine-color-dark-7);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import {
|
|||||||
useComputedColorScheme,
|
useComputedColorScheme,
|
||||||
useMantineColorScheme,
|
useMantineColorScheme,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
|
import SmallPageBlock from "@/components/layout/SmallPageBlock/SmallPageBlock";
|
||||||
import style from "./ColorSchemeToggle.module.css";
|
import style from "./ColorSchemeToggle.module.css";
|
||||||
|
|
||||||
export function ColorSchemeToggle() {
|
export function ColorSchemeToggle() {
|
||||||
@ -20,21 +21,23 @@ export function ColorSchemeToggle() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionIcon
|
<SmallPageBlock>
|
||||||
onClick={toggleColorScheme}
|
<ActionIcon
|
||||||
variant="default"
|
onClick={toggleColorScheme}
|
||||||
size="xl"
|
variant="default"
|
||||||
radius="lg"
|
size="xl"
|
||||||
aria-label="Toggle color scheme"
|
radius="lg"
|
||||||
className={style.container}>
|
aria-label="Toggle color scheme"
|
||||||
<IconSun
|
className={style.container}>
|
||||||
className={classNames(style.icon, style.light)}
|
<IconSun
|
||||||
stroke={1.5}
|
className={classNames(style.icon, style.light)}
|
||||||
/>
|
stroke={1.5}
|
||||||
<IconMoon
|
/>
|
||||||
className={classNames(style.icon, style.dark)}
|
<IconMoon
|
||||||
stroke={1.5}
|
className={classNames(style.icon, style.dark)}
|
||||||
/>
|
stroke={1.5}
|
||||||
</ActionIcon>
|
/>
|
||||||
|
</ActionIcon>
|
||||||
|
</SmallPageBlock>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,12 @@ export const theme = createTheme({
|
|||||||
Card: {
|
Card: {
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
radius,
|
radius,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
Text: {
|
||||||
|
defaultProps: {
|
||||||
|
size: "sm",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user