From bfb690b9412ae7d00a78484521c8e4150caf6589 Mon Sep 17 00:00:00 2001 From: RSLi Date: Mon, 8 Jun 2020 01:23:32 -0700 Subject: [PATCH] Add sample graph cord 19. --- argo-lite/src/components/Navbar.jsx | 26 ++++++++++++++++++-------- argo-lite/src/constants/index.js | 4 ++++ argo-lite/src/stores/index.js | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/argo-lite/src/components/Navbar.jsx b/argo-lite/src/components/Navbar.jsx index 133fe28..d5c7638 100644 --- a/argo-lite/src/components/Navbar.jsx +++ b/argo-lite/src/components/Navbar.jsx @@ -20,7 +20,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faGithub } from '@fortawesome/free-brands-svg-icons'; import argologo from '../images/argologo.png'; -import {LOGO_URL, GITHUB_URL} from '../constants'; +import {LOGO_URL, GITHUB_URL, SAMPLE_GRAPH_SNAPSHOTS} from '../constants'; @observer class RegularNavbar extends React.Component { @@ -49,13 +49,23 @@ class RegularNavbar extends React.Component { content={ - { - window.loadAndDisplaySnapshotFromURL("https://argo-graph-lite.s3.amazonaws.com/lesmiserables.json"); - }} - /> + { + SAMPLE_GRAPH_SNAPSHOTS.map((sample) => { + const sampleSnapshotTitle = sample[0]; + const sampleSnapshotStrapiUuid = sample[1]; + + return ( + { + window.loadAndDisplaySnapshotFromStrapi(sampleSnapshotStrapiUuid); + }} + /> + ); + }) + } + { }; window.loadAndDisplaySnapshotFromURL = loadAndDisplaySnapshotFromURL; +window.loadAndDisplaySnapshotFromStrapi = loadAndDisplaySnapshotFromStrapi; window.loadInitialSampleGraph = async () => { // default fallback url