Skip to content

Commit

Permalink
refactor(#267): simplify color construction
Browse files Browse the repository at this point in the history
  • Loading branch information
saha80 authored and Rozhkow committed Dec 5, 2023
1 parent a9ad464 commit 49051f3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/common/BaseSwitch/BaseSwitch.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Switch = styled((props: React.ComponentProps<typeof AntSwitch>) =>
}
&.ant-switch[aria-checked='false'] {
background-image: linear-gradient(to right, ${({ theme }) => theme.disabled}, ${({ theme }) => theme.disabled}),
linear-gradient(to right, ${({ theme }) => theme.background}, ${({ theme }) => theme.background});
background-image: ${({ theme }) => `linear-gradient(to right, ${theme.disabled}, ${theme.disabled})`},
${({ theme }) => `linear-gradient(to right, ${theme.background}, ${theme.background})`};
}
`;
5 changes: 2 additions & 3 deletions src/components/common/BaseTable/BaseTable.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import styled, { useTheme } from 'styled-components';
import { Table as AntTable, ConfigProvider } from 'antd';
import { hexToRGB } from '@app/utils/utils';

export const Table = styled((props: React.ComponentProps<typeof AntTable>) => {
const theme = useTheme();
Expand All @@ -12,10 +11,10 @@ export const Table = styled((props: React.ComponentProps<typeof AntTable>) => {
borderRadiusLG: 0,
colorBorderSecondary: '#b3cbe1',
colorTextHeading: theme.primary,
colorFillAlter: `rgba(${hexToRGB(theme.primary)}, 0.05)`,
colorFillAlter: `rgba(${theme.rgb.primary}, 0.05)`,
controlItemBgActive: theme.primary1,
colorSplit: 'rgba(0, 0, 0, 0.15)',
controlItemBgActiveHover: `rgba(${hexToRGB(theme.primary)}, 0.12)`,
controlItemBgActiveHover: `rgba(${theme.rgb.primary}, 0.12)`,
},
},
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ export const DoctorName = styled.span`
`;

export const DoctorCard = styled(BaseCard)`
background: linear-gradient(
to bottom,
${({ theme }) => theme.primary} 5rem,
${({ theme }) => theme.secondaryBackground} 5rem
);
background: ${({ theme }) => `linear-gradient(to bottom, ${theme.primary} 5rem, ${theme.secondaryBackground} 5rem)`};
`;

export const DoctorCardBody = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const FullnessLine = styled.div<FullnessLineProps>`
padding-right: 0.625rem;
border-radius: 50px;
width: ${(props) => props.width}%;
background: linear-gradient(90deg, ${({ theme }) => theme.warning} 0%, ${({ theme }) => theme.error} 100%);
background: ${({ theme }) => `linear-gradient(90deg, ${theme.warning} 0%, ${theme.error} 100%)`};
color: ${({ theme }) => theme.textSecondary};
@media only screen and (${media('xl')}) {
Expand Down

0 comments on commit 49051f3

Please sign in to comment.