Skip to content

Commit

Permalink
Whitespace cleanup [#870]
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed Jun 12, 2024
1 parent 0f576aa commit 7c4d8bc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function TooltipWrapper({description, children}) {
{children}
</div>
)
}
}

interface IconContainerProps {
Icon: IconType
Expand Down Expand Up @@ -194,5 +194,5 @@ export const ResourceLinkWrapper = ({children, onShiftClick}) => {
<div onClick={onClick}>
{children}
</div>
)
)
}
10 changes: 5 additions & 5 deletions static-site/src/components/ListResources/ResourceGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ResourceGroupHeader = ({group, isMobile, setCollapsed, collapsible, isColl
<NextstrainLogo/>

<FlexColumnContainer>

<HeaderRow>
{group.groupUrl ? (
<TooltipWrapper description={`Click to load the default (and most recent) analysis for ${group.groupDisplayName || group.groupName}`}>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand All @@ -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);
Expand All @@ -277,4 +277,4 @@ function collapseThresolds(numGroups: number) {
resourcesToShowWhenCollapsed = 40;
}
return {collapseThreshold, resourcesToShowWhenCollapsed}
}
}
6 changes: 3 additions & 3 deletions static-site/src/components/ListResources/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ListResources({

if (dataFetchError) {
return (
<ErrorContainer>
<ErrorContainer>
{"Whoops - listing resources isn't working!"}
<br/>
{'Please '}<a href="/contact" style={{fontWeight: 300}}>get in touch</a>{" if this keeps happening"}
Expand Down Expand Up @@ -165,7 +165,7 @@ function SortOptions({sortMethod, changeSortMethod}) {
}
return (
<SortContainer>
Sort pathogens by:
Sort pathogens by:
<input id="alphabetical" type="radio" onChange={onChangeValue} value="alphabetical"
checked={"alphabetical"===sortMethod} style={{cursor: "alphabetical"===sortMethod ? 'default' : 'pointer'}}/>
<TooltipWrapper description={'Pathogen groups ordered alphabetically. ' +
Expand Down Expand Up @@ -235,4 +235,4 @@ const SortContainer = styled.div`
margin-left: 20px;
margin-right: 5px;
}
`
`
4 changes: 2 additions & 2 deletions static-site/src/components/ListResources/useDataFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ interface Partitions {
/**
* Groups the provided array of pathVersions into an object with keys
* representing group names (pathogen names) and values which are arrays of
* resource objects.
* resource objects.
*/
function partitionByPathogen(pathVersions: PathVersions, pathPrefix: string, versioned: boolean) {
return Object.entries(pathVersions).reduce((store: Partitions, [name, dates]) => {
Expand Down Expand Up @@ -181,4 +181,4 @@ function updateCadence(dateObjects) {
return {summary: "monthly", description};
}
return {summary: "rarely", description};
}
}
2 changes: 1 addition & 1 deletion static-site/src/sections/staging-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
Expand Down

0 comments on commit 7c4d8bc

Please sign in to comment.