Skip to content

Commit

Permalink
Merge pull request #1325 from nextstrain/feat/web-ui-5-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov authored Nov 28, 2023
2 parents b258929 + 13090b9 commit b8f382e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const TabsContentStyled = styled(TabsContent)`
export interface FilePickerProps extends StrictOmit<HTMLProps<HTMLDivElement>, 'onInput' | 'onError' | 'as' | 'ref'> {
multiple?: boolean
compact?: boolean
title: string
title?: string
icon: ReactNode
exampleUrl: string
pasteInstructions: string
Expand All @@ -74,7 +74,7 @@ export interface FilePickerProps extends StrictOmit<HTMLProps<HTMLDivElement>, '
export function FilePicker({
multiple = false,
compact,
title,
title = '',
icon,
exampleUrl,
pasteInstructions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function ButtonChangeDataset({ onClick, ...restProps }: ChangeDatasetButt

const { color, text, tooltip } = useMemo(() => {
const hasDataset = !isNil(dataset)
const text = hasDataset ? t('Change dataset') : t('Select dataset')
const text = hasDataset ? t('Change reference dataset') : t('Select reference dataset')
return {
color: hasDataset ? 'secondary' : 'primary',
text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function DatasetSelectorImpl({
<Container>
<Header>
<Title>
<H4Inline>{t('Select dataset')}</H4Inline>
<H4Inline>{t('Select reference dataset')}</H4Inline>
<SelectDatasetHelp />
</Title>

Expand Down
33 changes: 15 additions & 18 deletions packages_rs/nextclade-web/src/components/Main/MainInputForm.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useCallback, useMemo } from 'react'
import { isNil } from 'lodash'
import { useRouter } from 'next/router'
import { Col, Row } from 'reactstrap'
import { useRecoilState, useRecoilValue } from 'recoil'
import { SuggestionAlertMainPage } from 'src/components/Main/SuggestionAlertMainPage'
import styled from 'styled-components'
import { SuggestionAlertMainPage } from 'src/components/Main/SuggestionAlertMainPage'
import { datasetCurrentAtom } from 'src/state/dataset.state'
import { hasRequiredInputsAtom } from 'src/state/inputs.state'
import { shouldSuggestDatasetsOnDatasetPageAtom } from 'src/state/settings.state'
Expand Down Expand Up @@ -62,10 +63,6 @@ const Footer = styled.div`
flex: 1;
`

const FooterWithoutOverflow = styled(Footer)`
overflow: hidden;
`

export function Landing() {
// This periodically fetches dataset index and updates the list of datasets.
useUpdatedDatasetIndex()
Expand All @@ -88,20 +85,20 @@ export function Landing() {
<MainSectionTitle />
</Header>

<Main className="mt-4">
<ContainerColumns>
<QuerySequenceFilePicker />
<DatasetCurrentOrSelectButton toDatasetSelection={toDatasetSelection} />
<Main className="mt-4 mb-2">
<ContainerColumns className="w-100">
<Row className="w-100">
<Col className="d-flex flex-column h-100">
<QuerySequenceFilePicker />
<QuerySequenceList />
</Col>

<Col>
<DatasetCurrentOrSelectButton toDatasetSelection={toDatasetSelection} />
</Col>
</Row>
</ContainerColumns>
</Main>

<FooterWithoutOverflow>
<Container>
<Main>
<QuerySequenceList />
</Main>
</Container>
</FooterWithoutOverflow>
</ContainerFixed>
)
}
Expand All @@ -118,7 +115,7 @@ function DatasetCurrentOrSelectButton({ toDatasetSelection }: DatasetCurrentOrSe

const text = useMemo(() => {
if (isNil(dataset)) {
return t('Select dataset')
return t('Select reference dataset')
}
return t('Selected dataset')
}, [dataset, t])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useRecoilToggle } from 'src/hooks/useToggle'
import { qrySeqErrorAtom } from 'src/state/error.state'
import { shouldRunAutomaticallyAtom, shouldSuggestDatasetsOnDatasetPageAtom } from 'src/state/settings.state'
import { useTranslationSafe } from 'src/helpers/useTranslationSafe'
import { FilePicker } from 'src/components/FilePicker/FilePicker'
import { FilePicker, FilePickerTitle } from 'src/components/FilePicker/FilePicker'
import { FileIconFasta } from 'src/components/Common/FileIcons'
import { useQuerySeqInputs } from 'src/state/inputs.state'

Expand Down Expand Up @@ -39,7 +39,7 @@ export function QuerySequenceFilePicker() {
[addQryInputs, runAnalysis, runAutodetect, shouldRunAutomatically, shouldSuggestDatasetsOnDatasetPage],
)

const headerText = useMemo(() => {
const title = useMemo(() => {
if (qryInputs.length > 0) {
return t('Add more sequence data')
}
Expand All @@ -48,8 +48,8 @@ export function QuerySequenceFilePicker() {

return (
<Container>
<FilePickerTitle title={title}>{title}</FilePickerTitle>
<FilePicker
title={headerText}
icon={icon}
exampleUrl="https://example.com/sequences.fasta"
pasteInstructions={t('Enter sequence data in FASTA format')}
Expand All @@ -65,10 +65,6 @@ export function QuerySequenceFilePicker() {

const Container = styled.div`
display: flex;
flex: 1;
flex-direction: column;
height: 100%;
overflow: hidden;
margin-left: 10px;
margin-right: 12px;
`
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function QuerySequenceList({ toMainPage }: { toMainPage?: () => void }) {
return null
}
return (
<div className="d-flex">
<div className="d-flex mt-3">
<h4>{t("Sequence data you've added")}</h4>

<div className="d-flex ml-auto">
Expand Down

1 comment on commit b8f382e

@vercel
Copy link

@vercel vercel bot commented on b8f382e Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextclade – ./

nextclade.vercel.app
nextclade-nextstrain.vercel.app
nextclade-git-master-nextstrain.vercel.app

Please sign in to comment.