Skip to content

Commit 894f63f

Browse files
Update dtg rendering (#369)
1 parent bcf57c9 commit 894f63f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/components/Header.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const aboutModalCopyTooltips: [React.ReactNode, React.ReactNode] = [
4343
'Copied!',
4444
]
4545

46+
const DICOM_TAG_BROWSER_PATHS = ['/studies/', '/study/', '/projects/'] as const
47+
4648
const aboutModalStyles: Record<string, React.CSSProperties> = {
4749
container: {
4850
textAlign: 'center',
@@ -398,7 +400,9 @@ class Header extends React.Component<HeaderProps, HeaderState> {
398400
for (let i = 0; i < errorNum; i++) {
399401
const category = this.state.errorCategory[i] as ObjectKey
400402
errorMsgs[category].push(
401-
`${this.state.errorObj[i].message as string} (Source: ${this.state.errorObj[i].source})`,
403+
`${this.state.errorObj[i].message as string} (Source: ${
404+
this.state.errorObj[i].source
405+
})`,
402406
)
403407
}
404408
}
@@ -606,8 +610,9 @@ class Header extends React.Component<HeaderProps, HeaderState> {
606610
</Badge>
607611
)
608612

609-
const showDicomTagBrowser =
610-
this.props.location.pathname.includes('/studies/')
613+
const showDicomTagBrowser = DICOM_TAG_BROWSER_PATHS.some((path) =>
614+
this.props.location.pathname.includes(path),
615+
)
611616

612617
const dicomTagBrowserButton = showDicomTagBrowser ? (
613618
<Button

0 commit comments

Comments
 (0)