Skip to content

Commit

Permalink
chore: add cellguide to navbar in explorer (#645)
Browse files Browse the repository at this point in the history
* chore: add cellguide to navbar in explorer

* update snapshot

* try snapshot again

---------

Co-authored-by: Timmy Huang <[email protected]>
  • Loading branch information
atarashansky and tihuan authored Jul 28, 2023
1 parent ff2146e commit 2a8496f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/__tests__/e2e/__snapshots__/e2e.test.ts.snap

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/src/analytics/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ export enum EVENTS {
CENSUS_CLICK_NAV = "CENSUS_CLICK_NAV",
DATASETS_CLICK_NAV = "DATASETS_CLICK_NAV",
DOCUMENTATION_CLICK_NAV = "DOCUMENTATION_CLICK_NAV",
CELL_GUIDE_CLICK_NAV = "CELL_GUIDE_CLICK_NAV",
}
15 changes: 14 additions & 1 deletion client/src/components/NavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { track } from "../../analytics";
import { EVENTS } from "../../analytics/events";
import { ROUTES } from "./routes";
import Icon from "../icon/icon";
import { Left, LinkWrapper, MainWrapper, Nav, Right, Wrapper } from "./style";
import { BetaChip, Left, LinkWrapper, MainWrapper, Nav, Right, Wrapper } from "./style";
import NavDivider from "./components/NavDivider";

function handleMenuClick() {
Expand Down Expand Up @@ -75,6 +75,16 @@ const Header = (props: HeaderProps) => {
onClick={handleWMGClick}
/>
</LinkWrapper>
<LinkWrapper>
<AnchorButton
active={false}
href={ROUTES.CELL_GUIDE}
minimal
text="Cell Guide"
onClick={handleCellGuideClick}
/>
<BetaChip label="Beta" size="small" />
</LinkWrapper>
<NavDivider />
<LinkWrapper>
<AnchorButton
Expand Down Expand Up @@ -157,6 +167,9 @@ const Header = (props: HeaderProps) => {
function handleWMGClick(): void {
track(EVENTS.WMG_CLICK_NAV);
}
function handleCellGuideClick(): void {
track(EVENTS.CELL_GUIDE_CLICK_NAV);
}
function handleDatasetsClick(): void {
track(EVENTS.DATASETS_CLICK_NAV);
}
Expand Down
1 change: 1 addition & 0 deletions client/src/components/NavBar/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export enum ROUTES {
PREVIEW_POLICIES = "/previewpolicies/",
WHERE_IS_MY_GENE = "/gene-expression",
DOCS = "/docs",
CELL_GUIDE = "/cellguide",
}
8 changes: 8 additions & 0 deletions client/src/components/NavBar/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from "@emotion/styled";
import { css } from "@emotion/react";
import { GRAY, PT_TEXT_COLOR } from "./theme";
import { HEADER_HEIGHT_PX } from "../../globals";
import { Chip } from "czifui";

export const Wrapper = styled.div`
background-color: ${PT_TEXT_COLOR};
Expand Down Expand Up @@ -80,3 +81,10 @@ export const LinkWrapper = styled.span`
display: flex;
align-items: center;
`;

export const BetaChip = styled(Chip)`
background: #7a41ce;
color: white;
margin-left: 4px;
height: 16px !important;
`;

0 comments on commit 2a8496f

Please sign in to comment.