Skip to content

Commit

Permalink
[ refactor ] colors typing for using theme color
Browse files Browse the repository at this point in the history
  • Loading branch information
leeJooHaem committed Feb 24, 2023
1 parent 62dc662 commit a16b064
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { getTrackBackground } from "react-range";
import styled, { css } from "styled-components";
import styled, { css, DefaultTheme } from "styled-components";

interface RangeTrackProps {
min: number;
max: number;
price: number[];
theme: DefaultTheme & {
newColors: {
[key: string]: string;
};
};
}

interface RangeThumbAriaProps {
Expand Down Expand Up @@ -57,12 +62,12 @@ const RangeTrack = styled.div`
height: 1.1rem;
background: ${(props: RangeTrackProps) =>
background: ${({ theme, price, min, max }: RangeTrackProps) =>
getTrackBackground({
values: props.price,
colors: ["#19BE7E", "#E0E0E0"], // [newColors.green, newColors.gray300]
min: props.min,
max: props.max,
values: price,
colors: [theme.newColors.green, theme.newColors.gray300], // [newColors.green, newColors.gray300]
min: min,
max: max,
})};
`;

Expand Down

0 comments on commit a16b064

Please sign in to comment.