diff --git a/src/App.tsx b/src/App.tsx index 07ee015..e00c640 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -39,7 +39,7 @@ function App() { - + { size, todayBoldColor, totalBoldColor, + titleColor, + todayTitleColor, + totalTitleColor, } = props; return ( - + {title} - + {todayTitle} {todayVisitor} - + {totalTitle} {totalVisitor} @@ -46,6 +49,7 @@ const Wrap = styled.div` padding: 10px; flex-grow: 1; font-weight: bold; + color: ${({ titleColor }) => titleColor ?? 'black'}; } `; @@ -54,6 +58,7 @@ const Today = styled.div` padding: 10px; .today { margin-right: 5em; + color: ${({ todayTitleColor }) => todayTitleColor ?? 'black'}; } .today-visitor { font-weight: bold; @@ -66,6 +71,7 @@ const Total = styled.div` padding: 10px; .total { margin-right: 5em; + color: ${({ totalTitleColor }) => totalTitleColor ?? 'black'}; } .total-visitor { font-weight: bold; diff --git a/src/lib/components/VisitorCounter/Default.tsx b/src/lib/components/VisitorCounter/Default.tsx index 4f32171..2b3eec9 100644 --- a/src/lib/components/VisitorCounter/Default.tsx +++ b/src/lib/components/VisitorCounter/Default.tsx @@ -6,11 +6,11 @@ import { } from '../../common/types/ComponentTypes/VisitorCounterType'; const Default = (props: VisitorCounterPropsType) => { - const { title, todayVisitor, totalVisitor, backgroundColor, size } = props; + const { title, todayVisitor, totalVisitor, backgroundColor, size, titleColor } = props; return ( - + {title} {todayVisitor} {totalVisitor} @@ -35,8 +35,10 @@ const Counter = styled.div` border: 1px solid #989898; border-radius: 5px; overflow: hidden; + background-color: white; .title { background-color: ${({ backgroundColor }) => backgroundColor ?? '#91c230c4'}; + color: ${({ titleColor }) => titleColor ?? 'black'}; } .today { border-left: 1px solid #989898; diff --git a/src/lib/components/VisitorCounter/Simple.tsx b/src/lib/components/VisitorCounter/Simple.tsx index 2f0e252..7eac2ce 100644 --- a/src/lib/components/VisitorCounter/Simple.tsx +++ b/src/lib/components/VisitorCounter/Simple.tsx @@ -6,10 +6,26 @@ import { } from '../../common/types/ComponentTypes/VisitorCounterType'; export const Simple = (props: VisitorCounterPropsType) => { - const { todayTitle, todayVisitor, totalTitle, totalVisitor, size, todayBoldColor, totalBoldColor } = props; + const { + todayTitle, + todayVisitor, + totalTitle, + totalVisitor, + size, + todayBoldColor, + totalBoldColor, + todayTitleColor, + totalTitleColor, + } = props; return ( - + {todayTitle} {todayVisitor} {totalTitle} @@ -23,6 +39,9 @@ const Wrap = styled.div` span { padding: 3px; } + .today { + color: ${({ todayTitleColor }) => todayTitleColor ?? 'black'}; + } .today-visitor { font-weight: bold; color: ${({ todayBoldColor }) => todayBoldColor ?? 'red'}; @@ -33,6 +52,9 @@ const Wrap = styled.div` color: black; } } + .total { + color: ${({ totalTitleColor }) => totalTitleColor ?? 'black'}; + } .total-visitor { font-weight: bold; color: ${({ totalBoldColor }) => totalBoldColor ?? 'black'};