Skip to content

Commit

Permalink
Merge branch 'main' into react-18
Browse files Browse the repository at this point in the history
  • Loading branch information
benhammondmusic authored Feb 1, 2024
2 parents ba87039 + 8f76715 commit b103cbf
Show file tree
Hide file tree
Showing 20 changed files with 225 additions and 1,230 deletions.
6 changes: 6 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@fontsource-variable/dm-sans": "^5.0.3",
"@fontsource-variable/inter": "^5.0.16",
"@fontsource/roboto": "^5.0.8",
"@fontsource/roboto-condensed": "^5.0.14",
"@fontsource/taviraj": "^5.0.18",
"@mui/icons-material": "^5.15.6",
"@mui/lab": "^5.0.0-alpha.124",
Expand Down
2 changes: 1 addition & 1 deletion frontend/playwright-tests/ami.nightly.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '@playwright/test';

test('PHRMA: Medicare AMI', async ({ page }) => {
await page.goto('/exploredata?mls=1.medicare_cardiovascular-3.12&group1=85PLUS&dt1=ami&demo=age');
await page.goto('/exploredata?mls=1.medicare_cardiovascular-3.12&group1=85PLUS&dt1=medicare_ami&demo=age');
await page.locator('#rate-map').getByRole('heading', { name: 'Rates of Acute MI in Florida' }).click();
await page.getByRole('heading', { name: 'Ages 85+, Medicare' }).click();
await page.getByLabel('Legend for rate map').getByRole('img').click();
Expand Down
1 change: 1 addition & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import '@fontsource/taviraj/500.css'
import '@fontsource-variable/inter'
import '@fontsource-variable/dm-sans'
import '@fontsource/roboto'
import '@fontsource/roboto-condensed'

// TODO: Delete these imports if possible once MUI is removed/isolated in HetComponents
import CssBaseline from '@mui/material/CssBaseline'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/cards/ui/MultiMapDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default function MultiMapDialog(props: MultiMapDialogProps) {
<h4 className='m-0 text-smallest font-medium leading-lhTight sm:text-small sm:leading-lhNormal md:text-text'>
{mapLabel}
</h4>
<div className=''>
<div>
{props.metricConfig && dataForValue.length > 0 && (
<ChoroplethMap
demographicType={props.demographicType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({
minWidth = 700,
}) => {
return (
<TableContainer className=''>
<TableContainer>
<Table
className={
border
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
import React from 'react'
import { FractionFormat, type FractionProps } from './FractionFormat'
import FractionFormat, { type FractionFormatProps } from './FractionFormat'

type RightSideItem = string | FractionProps

interface FormulaProps {
leftSide?: string
rightSide: RightSideItem[]
interface FormulaFormatProps {
leftSide?: string | FractionFormatProps
rightSide: Array<string | FractionFormatProps>
}

const FormulaFormat: React.FC<FormulaProps> = ({ leftSide, rightSide }) => (
<div className='flex flex-row items-center justify-between overflow-x-scroll rounded-md bg-standardInfo'>
<code className='mx-auto my-0 flex w-max max-w-lg flex-col items-center justify-center self-start border-none bg-opacity-0 text-smallest lg:flex-row'>
<b>{leftSide}</b>
<div>{' = '}</div>

{rightSide.map((item, index) => (
<div key={index}>
{typeof item === 'string' ? (
item
export default function FormulaFormat(props: FormulaFormatProps) {
return (
<div className='flex w-full flex-row items-center justify-center rounded-md bg-standardInfo '>
<code className='flex flex-col flex-wrap items-center justify-center self-start border-none bg-opacity-0 font-robotoCondensed text-smallest smMd:text-text md:flex-row md:gap-1 lg:text-title'>
<div className='p-2'>
{typeof props.leftSide === 'string' ? (
props.leftSide
) : (
<FractionFormat
numerator={item.numerator}
denominator={item.denominator}
numerator={props.leftSide?.numerator}
denominator={props.leftSide?.denominator}
/>
)}
</div>
))}
</code>
</div>
)
<div className='px-2 py-1'>{' = '}</div>

export default FormulaFormat
{props.rightSide.map((item, index) => (
<div className='p-2' key={index}>
{typeof item === 'string' ? (
item
) : (
<FractionFormat
numerator={item.numerator}
denominator={item.denominator}
/>
)}
</div>
))}
</code>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
import React from 'react'

export interface FractionProps {
export interface FractionFormatProps {
numerator?: any
denominator?: any
}

export const FractionFormat: React.FC<FractionProps> = ({
numerator,
denominator,
}) => (
<div className='flex w-max flex-row items-center justify-center lg:inline-flex '>
{numerator ? (
<div className='mx-auto my-0 flex flex-col items-center justify-center self-center leading-lhTight'>
<div className='inline-block w-max break-words border-0 border-b border-solid border-black text-center text-smallest'>
{numerator}
</div>
<div className='inline-block w-max text-center text-smallest'>
{denominator}
export default function FractionFormat(props: FractionFormatProps) {
return (
<div className='flex flex-row items-center justify-center lg:inline-flex '>
{props.numerator ? (
<div className='flex'>
<span className='text-bigHeader font-light text-altBlack'>(</span>
<div className='mx-auto my-0 flex flex-col items-center justify-center self-center leading-lhTight'>
<div className='inline-block flex-wrap border-0 border-b border-solid border-altBlack p-2 text-center'>
{props.numerator}
</div>
<div className='inline-block w-max p-2 text-center'>
{props.denominator}
</div>
</div>
<span className='text-bigHeader font-light text-altBlack'>)</span>
</div>
</div>
) : (
<div className='mx-auto my-0 flex flex-col items-center justify-center self-center leading-lhTight'>
<div className='inline-block w-max text-center text-smallest'>
{denominator}
) : (
<div className='mx-auto my-0 flex flex-col items-center justify-center self-center leading-lhTight'>
<div className='inline-block w-max p-2 text-center '>
{props.denominator}
</div>
</div>
</div>
)}
</div>
)
)}
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ export default function MethodologyPage() {
exact: true,
})
return match && route.subLinks.length > 0 ? (
<HetOnThisPageMenu
key={index}
links={route.subLinks}
className=''
/>
<HetOnThisPageMenu key={index} links={route.subLinks} />
) : null
})}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import {
Paper,
TableBody,
} from '@mui/material'
import { het } from '../../../styles/DesignTokens'

export const StyledTableRow = styled(TableRow)(({ theme }) => ({
'&:nth-of-type(odd)': {
backgroundColor: '#fafafa',
backgroundColor: het.standardInfo,
},
'&:nth-of-type(even)': {
backgroundColor: '#fff',
backgroundColor: het.white,
},
// hide last border
'&:last-child td, &:last-child th': {
Expand All @@ -39,7 +40,7 @@ interface StripedTableProps {
export default function StripedTable(props: StripedTableProps) {
return (
<TableContainer className='w-full' component={Paper} id={props.id}>
<Table className=''>
<Table>
<TableHead>
<TableRow className='bg-methodologyGreen text-navlinkColor'>
{props.columns.map((col) => (
Expand Down
Loading

0 comments on commit b103cbf

Please sign in to comment.