Link component, Card component, Course Popup component styling, and wrangling with the serialization type"

This commit is contained in:
Sriram Hariharan
2023-03-05 22:52:11 -06:00
parent 6d69cd2548
commit ad8a06d831
10 changed files with 147 additions and 49 deletions

View File

@@ -0,0 +1,5 @@
.link {
font-family: 'Inter', sans-serif;
text-decoration: underline;
cursor: pointer;
}

View File

@@ -0,0 +1,25 @@
import classNames from 'classnames';
import React, { PropsWithChildren } from 'react';
import { bMessenger } from 'src/shared/messages';
import Text, { TextProps } from '../Text/Text';
import styles from './Link.module.scss';
type Props = TextProps & {
url?: string;
};
/**
* A reusable Text component with props that build on top of the design system for the extension
*/
export default function Link(props: PropsWithChildren<Props>) {
let passedProps = {
...props,
};
const { url } = props;
if (url && !props.onClick) {
passedProps.onClick = () => bMessenger.openNewTab({ url });
}
return <Text {...passedProps} className={classNames(styles.link, props.className)} />;
}