Skip to content

Commit

Permalink
Merge pull request #1279 from nextstrain/fix/web-export-nav
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov authored Oct 20, 2023
2 parents 658d99b + 5ecd0dc commit 078eda2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BsCaretRightFill as ArrowRight } from 'react-icons/bs'
import { Link } from 'src/components/Link/Link'
import { FaDocker, FaGithub, FaXTwitter, FaDiscourse } from 'react-icons/fa6'
import { LinkSmart } from 'src/components/Link/LinkSmart'
import { hasRanAtom, hasTreeAtom } from 'src/state/results.state'
import { canDownloadAtom, hasRanAtom, hasTreeAtom } from 'src/state/results.state'
import styled, { useTheme } from 'styled-components'
import { useTranslationSafe } from 'src/helpers/useTranslationSafe'
import BrandLogoBase from 'src/assets/img/nextclade_logo.svg'
Expand Down Expand Up @@ -132,6 +132,7 @@ export function NavigationBar() {

const hasTree = useRecoilValue(hasTreeAtom)
const hasRan = useRecoilValue(hasRanAtom)
const canDownload = useRecoilValue(canDownloadAtom)

const linksLeft = useMemo(() => {
return [
Expand All @@ -147,9 +148,9 @@ export function NavigationBar() {
title: hasTree ? t('Show phylogenetic tree') : t('Please run the analysis on a dataset with reference tree'),
},
{
url: hasRan ? '/export' : undefined,
url: canDownload ? '/export' : undefined,
content: t('Export'),
title: hasRan ? t('Export results') : t('Please run the analysis first.'),
title: canDownload ? t('Export results') : t('Please run the analysis first.'),
},
].map((desc, i) => {
const link = <NavLinkBreadcrumb key={desc.url ?? desc.title} desc={desc} active={pathname === desc.url} />
Expand All @@ -159,7 +160,7 @@ export function NavigationBar() {
const arrow = <BreadcrumbArrow key={`arrow-${desc.url ?? desc.title}`} disabled={!desc.url} />
return [arrow, link]
})
}, [hasRan, hasTree, pathname, t])
}, [canDownload, hasRan, hasTree, pathname, t])

const linksRight = useMemo(() => {
return [
Expand Down

1 comment on commit 078eda2

@vercel
Copy link

@vercel vercel bot commented on 078eda2 Oct 20, 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-git-master-nextstrain.vercel.app
nextclade-nextstrain.vercel.app

Please sign in to comment.