Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Mar 1, 2024
1 parent 56e2f7d commit 69e9e29
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
30 changes: 24 additions & 6 deletions apps/nar-v3/src/routes/dataset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ import React from "react";
import { Await, defer, useLoaderData } from "react-router-dom";

import { datastore } from "../datastore";
//import Navigation from "../components/Navigation";
import { uuidFromUri } from "../utility.js";
import Navigation from "../components/Navigation";
import DatasetCard from "../components/DatasetCard";
import ProgressIndicator from "../components/ProgressIndicator";

const query = null;

const query = buildKGQuery("core/DatasetVersion", [
S("@id"),
S("fullName"),
S("description"),
S("shortName"),
S("versionIdentifier"),
R("isVersionOf", "hasVersion", [
S("fullName"),
S("description"),
S("shortName"),
]),
]);
export async function loader({ params }) {
const datasetPromise = datastore.getKGItem(
"datasets detail",
Expand All @@ -23,14 +34,21 @@ function Dataset(props) {

return (
<div id="dataset">
{/* <Navigation location={["Datasets"]} /> */}

<React.Suspense fallback={<ProgressIndicator />}>
<Await
resolve={data.dataset}
errorElement={<p>Error loading dataset.</p>}
>
{(dataset) => <DatasetCard dataset={dataset} />}
{(dataset) => {
return (
<>
<Navigation
location={["Datasets", uuidFromUri(dataset.id)]}
/>
<DatasetCard dataset={dataset} />
</>
);
}}
</Await>
</React.Suspense>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/nar-v3/src/routes/datasets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Await, defer, useLoaderData } from "react-router-dom";

import { buildKGQuery, simpleProperty as S, linkProperty as L, reverseLinkProperty as R } from "../queries";
import { datastore } from "../datastore";
//import Navigation from "../components/Navigation";
import Navigation from "../components/Navigation";
import DatasetList from "../components/DatasetList";
import ProgressIndicator from "../components/ProgressIndicator";

Expand Down Expand Up @@ -34,7 +34,7 @@ function Datasets(props) {

return (
<div id="datasets">
{/* <Navigation location={["Datasets"]} /> */}
<Navigation location={["Datasets"]} />

<React.Suspense fallback={<ProgressIndicator />}>
<Await
Expand Down

0 comments on commit 69e9e29

Please sign in to comment.