Updates title sizes

This commit is contained in:
Alicia Sykes
2023-06-24 16:42:43 +01:00
parent bc15c94315
commit e0ffc8e418
14 changed files with 73 additions and 19 deletions

View File

@@ -1,11 +1,13 @@
import { ReactNode } from 'react';
import styled from 'styled-components';
import colors from 'styles/colors';
import Heading from 'components/Form/Heading';
export interface RowProps {
lbl: string,
val: string,
key?: string,
children?: JSX.Element[],
children?: ReactNode,
rowList?: RowProps[],
title?: string,
}
@@ -100,12 +102,28 @@ export const ExpandableRow = (props: RowProps) => {
);
};
export const ListRow = (props: { list: string[], title: string }) => {
const { list, title } = props;
return (
<>
<Heading as="h4" size="small" align="left" color={colors.primary}>{title}</Heading>
{ list.map((entry: string, index: number) => {
return (
<Row lbl="" val="" key={`${title.toLocaleLowerCase()}-${index}`}>
<span>{ entry }</span>
</Row>
)}
)}
</>
);
}
const Row = (props: RowProps) => {
const { lbl, val, key, title, children } = props;
if (children) return <StyledRow key={key}>{children}</StyledRow>;
return (
<StyledRow key={key}>
<span className="lbl" title={title}>{lbl}</span>
{ lbl && <span className="lbl" title={title}>{lbl}</span> }
<span className="val" title={val} onClick={() => copyToClipboard(val)}>
{formatValue(val)}
</span>