-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
764 additions
and
1,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Box, Flex } from "@chakra-ui/react"; | ||
|
||
import { CustomColor } from "../../types/globals/interaction"; | ||
import PointCircle from "./PointCircle"; | ||
|
||
export interface ColorLabelProps { | ||
color?: CustomColor; | ||
colorText?: string; | ||
//이후 colorText를 color로 변경 | ||
text: string; | ||
} | ||
|
||
function ColorLabel({ text, color, colorText }: ColorLabelProps) { | ||
return ( | ||
<Flex h="24px" align="center"> | ||
<PointCircle color={!colorText ? color : null} colorText={colorText} /> | ||
<Box fontSize="12px" as="span" color={colorText || `var(--color-${color})`}> | ||
{text} | ||
</Box> | ||
</Flex> | ||
); | ||
} | ||
|
||
export default ColorLabel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,30 @@ | ||
import { Box, Flex } from "@chakra-ui/react"; | ||
import { Dayjs } from "dayjs"; | ||
import styled from "styled-components"; | ||
|
||
import { DispatchType } from "../../types/hooks/reactTypes"; | ||
|
||
interface IMonthNav { | ||
month: number; | ||
setNavMonth: DispatchType<Dayjs>; | ||
interface MonthNavProps { | ||
monthNum: number; | ||
changeMonth: DispatchType<Dayjs>; | ||
} | ||
|
||
function MonthNav({ month, setNavMonth }: IMonthNav) { | ||
const onClick = (dir: "left" | "right") => { | ||
if (dir === "left") setNavMonth((old) => old.subtract(1, "month")); | ||
else setNavMonth((old) => old.add(1, "month")); | ||
function MonthNav({ monthNum, changeMonth }: MonthNavProps) { | ||
const handleMonthChange = (dir: "left" | "right") => { | ||
if (dir === "left") changeMonth((old) => old.subtract(1, "month")); | ||
else changeMonth((old) => old.add(1, "month")); | ||
}; | ||
|
||
return ( | ||
<Layout> | ||
<IconWrapper onClick={() => onClick("left")}> | ||
<Flex align="center" fontSize="20px" fontWeight={800}> | ||
<Box as="button" px={2} onClick={() => handleMonthChange("left")}> | ||
<i className="fa-solid fa-caret-left fa-xs" /> | ||
</IconWrapper> | ||
<span>{month + 1}월</span> | ||
<IconWrapper onClick={() => onClick("right")}> | ||
</Box> | ||
<span>{monthNum + 1}월</span> | ||
<Box as="button" px={2} onClick={() => handleMonthChange("right")}> | ||
<i className="fa-solid fa-caret-right fa-xs" /> | ||
</IconWrapper> | ||
</Layout> | ||
</Box> | ||
</Flex> | ||
); | ||
} | ||
|
||
const Layout = styled.div` | ||
display: flex; | ||
align-items: center; | ||
font-size: 20px; | ||
font-weight: 700; | ||
`; | ||
|
||
const IconWrapper = styled.button` | ||
padding: 0 var(--gap-1); | ||
`; | ||
|
||
export default MonthNav; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Box, Flex } from "@chakra-ui/react"; | ||
|
||
import ColorLabel, { ColorLabelProps } from "../../atoms/ColorLabel"; | ||
|
||
interface ColorLabelRowProps { | ||
props: ColorLabelProps[]; | ||
} | ||
|
||
function ColorLabelRow({ props }: ColorLabelRowProps) { | ||
return ( | ||
<Flex> | ||
{props.map((prop, idx) => ( | ||
<Box key={idx} mr={idx !== props.length - 1 && 2}> | ||
<ColorLabel text={prop.text} color={prop.color} colorText={prop.colorText} /> | ||
</Box> | ||
))} | ||
</Flex> | ||
); | ||
} | ||
|
||
export default ColorLabelRow; |
Oops, something went wrong.