Skip to content

Commit cab06cb

Browse files
committed
chore: dot-migration
1 parent be08ba3 commit cab06cb

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

src/lib/dot.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import styled from "styled-components";
2-
import { borderBox } from "../styles/common-style";
3-
1+
import React from "react";
2+
import { cn } from "../utils";
43
interface DotProps {
54
color: string;
5+
className?: string;
66
}
77

8-
const Dot = styled.div<DotProps>`
9-
${borderBox}
10-
background: ${({ color }) => color};
11-
border-radius: 50%;
12-
width: 8px;
13-
height: 8px;
14-
`;
15-
8+
function Dot({ color, className }: Readonly<DotProps>) {
9+
return (
10+
<div
11+
style={{ background: color }}
12+
className={cn("box-border h-2 w-2 rounded-full", className)}
13+
/>
14+
);
15+
}
1616
export default Dot;

src/lib/dropdown/base-item.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ const StyledText = styled.p`
4747
user-select: none;
4848
`;
4949

50-
const StyledDot = styled(Dot)`
51-
margin-right: 8px;
52-
`;
53-
5450
const CountDisplay = styled.label`
5551
width: 24px;
5652
height: 24px;
@@ -89,7 +85,7 @@ const BaseItem: React.FC<IBaseItem> = ({
8985
{...{ onClick, ...props }}
9086
>
9187
{icon ?? (Icon && <Icon className="item-icon" />)}
92-
{dot && <StyledDot color={dot} />}
88+
{dot && <Dot className="mr-2" color={dot} />}
9389
<StyledText>{text}</StyledText>
9490
{childrenCount !== undefined ? (
9591
<CountDisplay className="count-display">

0 commit comments

Comments
 (0)