From 7c4d8bc5458d7463c250fc0f36353bbe8228510a Mon Sep 17 00:00:00 2001 From: John SJ Anderson Date: Tue, 11 Jun 2024 17:46:47 -0700 Subject: [PATCH] Whitespace cleanup [#870] --- .../components/ListResources/IndividualResource.tsx | 4 ++-- .../src/components/ListResources/ResourceGroup.tsx | 10 +++++----- static-site/src/components/ListResources/index.tsx | 6 +++--- .../src/components/ListResources/useDataFetch.ts | 4 ++-- static-site/src/sections/staging-page.jsx | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/static-site/src/components/ListResources/IndividualResource.tsx b/static-site/src/components/ListResources/IndividualResource.tsx index eefd4a795..91db2798a 100644 --- a/static-site/src/components/ListResources/IndividualResource.tsx +++ b/static-site/src/components/ListResources/IndividualResource.tsx @@ -86,7 +86,7 @@ export function TooltipWrapper({description, children}) { {children} ) -} +} interface IconContainerProps { Icon: IconType @@ -194,5 +194,5 @@ export const ResourceLinkWrapper = ({children, onShiftClick}) => {
{children}
- ) + ) } diff --git a/static-site/src/components/ListResources/ResourceGroup.tsx b/static-site/src/components/ListResources/ResourceGroup.tsx index 4c89d1010..b0a801af4 100644 --- a/static-site/src/components/ListResources/ResourceGroup.tsx +++ b/static-site/src/components/ListResources/ResourceGroup.tsx @@ -31,7 +31,7 @@ const ResourceGroupHeader = ({group, isMobile, setCollapsed, collapsible, isColl - + {group.groupUrl ? ( @@ -164,7 +164,7 @@ const ResourceGroupContainer = styled.div` `; const IndividualResourceContainer = styled.div<{$maxResourceWidth: number}>` - /* Columns are a simple CSS solution which works really well _if_ we can calculate the expected maximum + /* Columns are a simple CSS solution which works really well _if_ we can calculate the expected maximum resource width */ column-width: ${(props) => props.$maxResourceWidth}px; column-gap: 20px; @@ -239,7 +239,7 @@ function NextstrainLogo() { /** * Adds the `displayName` property to each resource. * Given successive nameParts: - * [ seasonal-flu, h1n1pdm] + * [ seasonal-flu, h1n1pdm] * [ seasonal-flu, h3n2] * We want to produce two names: a default name, which contains all parts, * and a displayName which hides the fields that match the preceding name. @@ -255,7 +255,7 @@ function _setDisplayName(resources: Resource[]) { name = r.nameParts.join(sep); } else { let matchIdx = r.nameParts.map((word, j) => word === resources[i-1]?.nameParts[j]).findIndex((v) => !v); - if (matchIdx===-1) { // -1 means every word is in the preceding name, but we should display the last word anyway + if (matchIdx===-1) { // -1 means every word is in the preceding name, but we should display the last word anyway matchIdx = r.nameParts.length-2; } name = r.nameParts.map((word, j) => j < matchIdx ? ' '.repeat(word.length) : word).join(sep); @@ -277,4 +277,4 @@ function collapseThresolds(numGroups: number) { resourcesToShowWhenCollapsed = 40; } return {collapseThreshold, resourcesToShowWhenCollapsed} -} \ No newline at end of file +} diff --git a/static-site/src/components/ListResources/index.tsx b/static-site/src/components/ListResources/index.tsx index 02e7e2b81..8482dc7e6 100644 --- a/static-site/src/components/ListResources/index.tsx +++ b/static-site/src/components/ListResources/index.tsx @@ -55,7 +55,7 @@ function ListResources({ if (dataFetchError) { return ( - + {"Whoops - listing resources isn't working!"}
{'Please '}get in touch{" if this keeps happening"} @@ -165,7 +165,7 @@ function SortOptions({sortMethod, changeSortMethod}) { } return ( - Sort pathogens by: + Sort pathogens by: { @@ -181,4 +181,4 @@ function updateCadence(dateObjects) { return {summary: "monthly", description}; } return {summary: "rarely", description}; -} \ No newline at end of file +} diff --git a/static-site/src/sections/staging-page.jsx b/static-site/src/sections/staging-page.jsx index 3e6ccc774..faf37da86 100644 --- a/static-site/src/sections/staging-page.jsx +++ b/static-site/src/sections/staging-page.jsx @@ -47,7 +47,7 @@ class Index extends React.Component { We update state which results in an error banner being shown. */ if (!this.state.resourcePath && this.props.router.query?.staging) { this.setState({resourcePath: "staging/"+this.props.router.query.staging.join("/")}) - } + } } componentDidMount() {this.checkRouterParams()}