fixed bug with material icons, and reusable icon component

This commit is contained in:
Sriram Hariharan
2023-03-05 19:54:59 -06:00
parent 1f2374927d
commit 295b466505
5 changed files with 62 additions and 46 deletions

View File

@@ -1,13 +1,13 @@
import classNames from 'classnames';
import React, { PropsWithChildren } from 'react';
import colors, { ISassColors } from 'src/views/styles/colors.module.scss';
import fonts, { ISizes, IWeights } from 'src/views/styles/fonts.module.scss';
import fonts, { Size, Weight } from 'src/views/styles/fonts.module.scss';
import styles from './Text.module.scss';
type Props = {
color?: keyof ISassColors;
weight: keyof IWeights;
size: keyof ISizes;
weight: Weight;
size: Size;
span?: boolean;
className?: string;
onClick?: () => void;
@@ -23,8 +23,8 @@ export default function Text(props: PropsWithChildren<Props>) {
style.textAlign ??= props.align;
style.color ??= colors?.[props.color ?? 'charcoal'];
style.fontSize ??= fonts?.[props.size ?? 'medium'];
style.fontWeight ??= fonts?.[props.weight ?? 'regular'];
style.fontSize ??= fonts?.[`${props.size ?? 'medium'}_size`];
style.fontWeight ??= fonts?.[`${props.weight ?? 'regular'}_weight`];
if (props.span) {
return (