Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add census link in explorer #625

Merged
merged 6 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/src/analytics/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export enum EVENTS {
EXPLORER_GENE_INFO_BUTTON_CLICKED = "EXPLORER_GENE_INFO_BUTTON_CLICKED",
WMG_CLICK_NAV = "WMG_CLICK_NAV",
COLLECTIONS_CLICK_NAV = "COLLECTIONS_CLICK_NAV",
CENSUS_CLICK_NAV = "CENSUS_CLICK_NAV",
joyceyan marked this conversation as resolved.
Show resolved Hide resolved
DATASETS_CLICK_NAV = "DATASETS_CLICK_NAV",
DOCUMENTATION_CLICK_NAV = "DOCUMENTATION_CLICK_NAV"
DOCUMENTATION_CLICK_NAV = "DOCUMENTATION_CLICK_NAV",
}
Empty file.
12 changes: 12 additions & 0 deletions client/src/components/NavBar/NavDivider/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Divider } from "@material-ui/core";
import { CommonThemeProps, getColors } from "czifui";
import styled from "@emotion/styled";

const gray500 = (props: CommonThemeProps) => getColors(props)?.gray[500];

export const NavDivider = styled(Divider)`
background-color: ${gray500};
border: none;
width: 1px;
height: inherit;
`;
17 changes: 17 additions & 0 deletions client/src/components/NavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import { EVENTS } from "../../analytics/events";
import { ROUTES } from "./routes";
import Icon from "../icon/icon";
import { Left, LinkWrapper, MainWrapper, Nav, Right, Wrapper } from "./style";
import { NavDivider } from "./NavDivider/style";
joyceyan marked this conversation as resolved.
Show resolved Hide resolved

function handleMenuClick() {
track(EVENTS.EXPLORER_MENU_BUTTON_CLICKED);
}

const CENSUS_LINK = "https://cellxgene-census.readthedocs.io/en/latest";

interface HeaderProps {
tosURL?: string;
privacyURL?: string;
Expand Down Expand Up @@ -72,6 +75,17 @@ const Header = (props: HeaderProps) => {
onClick={handleWMGClick}
/>
</LinkWrapper>
<NavDivider />
<LinkWrapper>
<AnchorButton
href={CENSUS_LINK}
minimal
onClick={handleCensusClick}
rel="noopener"
target="_self"
text="Census"
/>
</LinkWrapper>
</Nav>
</Left>
<Right>
Expand Down Expand Up @@ -149,6 +163,9 @@ const Header = (props: HeaderProps) => {
function handleCollectionsClick(): void {
track(EVENTS.COLLECTIONS_CLICK_NAV);
}
function handleCensusClick(): void {
track(EVENTS.CENSUS_CLICK_NAV);
}
function handleDocumentationClick(): void {
track(EVENTS.DOCUMENTATION_CLICK_NAV);
}
Expand Down