-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: navigation styling updates (#614)
#596 Implements navigation style updates for the the dataset and run pages ## Demos https://dev-nav-changes.cryoet.dev.si.czi.technology/ <img width="536" alt="image" src="https://github.com/chanzuckerberg/cryoet-data-portal/assets/2176050/f2d6f921-0687-48aa-89a6-33949ab760cc"> <img width="320" alt="image" src="https://github.com/chanzuckerberg/cryoet-data-portal/assets/2176050/fbab2fc3-2c04-448a-9b3c-bde34bc98b1e"> <img width="932" alt="image" src="https://github.com/chanzuckerberg/cryoet-data-portal/assets/2176050/74c4fed4-8b53-41f3-9d57-e8449e466ba5"> <img width="481" alt="image" src="https://github.com/chanzuckerberg/cryoet-data-portal/assets/2176050/2c1a2a01-1536-4f85-90a6-0ccb911b2ba9">
- Loading branch information
1 parent
42cc41e
commit fb63462
Showing
20 changed files
with
153 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 44 additions & 34 deletions
78
frontend/packages/data-portal/app/components/DatasetFilter/NameOrIdFilterSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,57 @@ | ||
import { useMemo } from 'react' | ||
|
||
import { | ||
FilterSection, | ||
InputFilterData, | ||
MultiInputFilter, | ||
} from 'app/components/Filters' | ||
import { QueryParams } from 'app/constants/query' | ||
import { i18n } from 'app/i18n' | ||
import { useI18n } from 'app/hooks/useI18n' | ||
|
||
export function NameOrIdFilterSection() { | ||
const { t } = useI18n() | ||
|
||
const DATASET_ID_FILTERS: InputFilterData[] = [ | ||
{ | ||
id: 'portal-id-input', | ||
label: `${i18n.portalIdBlank}:`, | ||
queryParam: QueryParams.PortalId, | ||
}, | ||
{ | ||
id: 'empiar-id-input', | ||
label: `${i18n.empiarID}:`, | ||
queryParam: QueryParams.EmpiarId, | ||
}, | ||
{ | ||
id: 'emdb-id-input', | ||
label: `${i18n.emdb}:`, | ||
queryParam: QueryParams.EmdbId, | ||
}, | ||
] | ||
const datasetIdFilters = useMemo<InputFilterData[]>( | ||
() => [ | ||
{ | ||
id: 'portal-id-input', | ||
label: `${t('datasetId')}:`, | ||
queryParam: QueryParams.DatasetId, | ||
}, | ||
{ | ||
id: 'empiar-id-input', | ||
label: `${t('empiarID')}:`, | ||
queryParam: QueryParams.EmpiarId, | ||
}, | ||
{ | ||
id: 'emdb-id-input', | ||
label: `${t('emdb')}:`, | ||
queryParam: QueryParams.EmdbId, | ||
}, | ||
], | ||
[t], | ||
) | ||
|
||
const AUTHOR_FILTERS: InputFilterData[] = [ | ||
{ | ||
id: 'author-name-input', | ||
label: `${i18n.authorName}:`, | ||
queryParam: QueryParams.AuthorName, | ||
}, | ||
{ | ||
id: 'author-orcid-input', | ||
label: `${i18n.authorOrcid}:`, | ||
queryParam: QueryParams.AuthorOrcid, | ||
}, | ||
] | ||
const authorFilters = useMemo<InputFilterData[]>( | ||
() => [ | ||
{ | ||
id: 'author-name-input', | ||
label: `${t('authorName')}:`, | ||
queryParam: QueryParams.AuthorName, | ||
}, | ||
{ | ||
id: 'author-orcid-input', | ||
label: `${t('authorOrcid')}:`, | ||
queryParam: QueryParams.AuthorOrcid, | ||
}, | ||
], | ||
[t], | ||
) | ||
|
||
export function NameOrIdFilterSection() { | ||
return ( | ||
<FilterSection title={i18n.nameOrId}> | ||
<MultiInputFilter label={i18n.datasetIds} filters={DATASET_ID_FILTERS} /> | ||
<MultiInputFilter label={i18n.author} filters={AUTHOR_FILTERS} /> | ||
<FilterSection title={t('nameOrId')}> | ||
<MultiInputFilter label={t('datasetIds')} filters={datasetIdFilters} /> | ||
<MultiInputFilter label={t('author')} filters={authorFilters} /> | ||
</FilterSection> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.