Skip to content

Commit

Permalink
chore: update documentation links (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashin-czi authored Aug 8, 2022
1 parent da05256 commit 799f002
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
11 changes: 9 additions & 2 deletions client/src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Props {
loading: boolean;
error: string;
graphRenderCounter: number;
baseUrl: string; // Used for help button links
}

class App extends React.Component<Props> {
Expand All @@ -46,7 +47,7 @@ class App extends React.Component<Props> {
}

render(): JSX.Element {
const { loading, error, graphRenderCounter } = this.props;
const { loading, error, graphRenderCounter, baseUrl } = this.props;

return (
<Container>
Expand Down Expand Up @@ -77,7 +78,7 @@ class App extends React.Component<Props> {
<MenuBar />
</Controls>
<Embedding />
<FloatingButton />
<FloatingButton baseUrl={baseUrl} />
<Autosave />
<Legend />
<Graph
Expand All @@ -103,4 +104,10 @@ export default connect((state: RootState) => ({
loading: state.controls.loading,
error: state.controls.error,
graphRenderCounter: state.controls.graphRenderCounter,

// Used for help button links
baseUrl:
state.config?.portalUrl ||
state.config?.links?.["collections-home-page"] ||
"https://cellxgene.dev.single-cell.czi.technology",
}))(App);
18 changes: 9 additions & 9 deletions client/src/components/floatingButton/floatingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ import { EVENTS } from "../../analytics/events";
import { IconNames } from "../icon";
import Icon from "../icon/icon";

interface Props {
baseUrl: string;
}

/**
* Documentation and roadmap menu, toggled from the FAB.
*/
function FloatingButton(): JSX.Element {
function FloatingButton(props: Props): JSX.Element {
const [helpMenuOpen, setHelpMenuOpen] = useState(false);

function handleHelpMenuClick() {
track(EVENTS.EXPLORER_FLOATING_BUTTON_CLICKED);
setHelpMenuOpen(true);
}

const { baseUrl } = props;

return (
<Popover
content={
<Menu>
<MenuItem
href="https://github.com/chanzuckerberg/cellxgene-documentation/blob/main/README.md"
href={`${baseUrl}/docs`}
rel="noopener"
target="_blank"
text="Documentation"
/>
<MenuItem
href="https://github.com/chanzuckerberg/cellxgene-documentation/blob/main/explore-data/explorer-tutorials.md"
href={`${baseUrl}/docs/04__Analyze%20Public%20Data/4_1__Hosted%20Tutorials`}
rel="noopener"
target="_blank"
text="Tutorials"
/>
<MenuItem
href="https://github.com/chanzuckerberg/cellxgene-documentation/blob/main/roadmap.md"
rel="noopener"
target="_blank"
text="Our Roadmap"
/>
</Menu>
}
hasBackdrop
Expand Down

0 comments on commit 799f002

Please sign in to comment.