Skip to content

Commit

Permalink
feat(dropdown): updated fonts in dropdown option
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleXBai committed Jul 26, 2024
1 parent 3eed236 commit b24a0c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/molecules/DropdownFiltered/Option.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import { colors, typography } from '../../../constants';
import styled, { css } from 'styled-components';
import { AppTheme } from '../../styles/Theme';
import { AppThemeProps } from '../../styles/Theme';

interface OptionProps extends React.HTMLAttributes<HTMLDivElement> {
highLighted?: boolean;
selected?: boolean;
}
interface OptionThemeProps extends AppThemeProps, OptionProps {}

const Option = styled.div<OptionProps & { theme: AppTheme }>`
const Option = styled.div<OptionThemeProps>`
cursor: pointer;
padding: 8px;
line-height: 32px;
font-family: ${({ theme }) => theme.typography.primary};
line-height: ${({ theme }: OptionThemeProps) => theme.typography.lineHeight.body ?? '32px'};
font-family: ${({ theme }: OptionThemeProps) => theme.typography.primary};
font-size: ${typography.sizes.text.body};
font-weight: 600;
font-weight: ${({ theme }: OptionThemeProps) => theme.typography.weights.regular ?? '600'};
color: ${colors.greyDarkest};
${({ selected, highLighted }) =>
(selected || highLighted) &&
css`
color: ${({ theme }) => theme.input.searchInput.options.hover.color};
color: ${({ theme }: OptionThemeProps) => theme.input.searchInput.options.hover.color};
background-color: ${({ theme }) => theme.input.searchInput.options.hover.backgroundColor};
`};
`;
Expand Down
6 changes: 6 additions & 0 deletions src/components/styles/Theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export interface LabelTheme {
margin: string;
}

export interface OptionTheme {
margin: string;
}

export interface LegendTheme {
className?: string;
lineHeightClassName?: string;
Expand Down Expand Up @@ -208,6 +212,7 @@ export interface NavbarTheme {
export interface ProgressBarTheme {
color: string;
}

export interface ScrollableAreaTheme {
scrollBarThumb: {
borderRadius: string;
Expand Down Expand Up @@ -336,6 +341,7 @@ export interface AppTheme {
spinner: SpinnerTheme;
productTemplate?: ProductTemplate;
radio: RadioTheme;
option?: OptionTheme;
}

export interface AppThemeProps {
Expand Down

0 comments on commit b24a0c0

Please sign in to comment.