Skip to content

Commit

Permalink
fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
soltanireza65 committed Nov 21, 2023
1 parent dafffc0 commit 5ff97d4
Show file tree
Hide file tree
Showing 4 changed files with 203 additions and 74 deletions.
189 changes: 180 additions & 9 deletions bookmarks/soukai/demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bookmarks/soukai/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"react-dom": "^18.2.0",
"recoil": "^0.7.7",
"soukai-solid": "^0.5.2",
"soukai-solid-bookmarks": "^0.0.0",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand Down
17 changes: 3 additions & 14 deletions bookmarks/soukai/demo/src/components/Bookmarks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import {
import {
Bookmark,
BookmarkFactory,
} from "../../../dist/index";
} from "../soukai-solid-data-modules/modules/Bookmarks";

import { FC, useEffect, useState } from "react";
import { FieldType } from "soukai";
import { SolidHasManyRelation, SolidModel } from "soukai-solid";
import { useUserSession } from "../atoms/userSession.atom";
import { FieldType } from "soukai";

// import Movie from "soukai-solid/src/testing/lib/stubs/Movie"

const Bookmarks: FC = () => {
const { userSession } = useUserSession();
const [form, setForm] = useState({ label: "", link: "", topic: "" });
Expand All @@ -30,29 +30,18 @@ const Bookmarks: FC = () => {
useEffect(() => {
(async () => {
if (!userSession) return;
// console.log("🚀 ~ file: Bookmarks.tsx:19 ~ userSession:")

const factory = await BookmarkFactory.getInstance(
{
webId: userSession?.info.webId ?? "",
fetch: userSession?.fetch,
isPrivate: true,
// baseURL: pod,
// containerUrl: pod + "bookmarks/",
// typeIndexUrl: "https://reza-soltani.solidcommunity.net/settings/privateTypeIndex.ttl",
// forClass: Bookmark.rdfsClasses[0]
}
// "bookmarks/"
);

const bookmarks = await factory.getAll();
console.log("🚀 ~ file: Bookmarks.tsx:46 ~ bookmarks:", bookmarks.map(x => x.getAttributes()))
setBookmarks(bookmarks);

// const res = await Bookmark.findOrFail(
// "https://solid-dm.solidcommunity.net/bookmarks/index.ttl#9a34eeec-01cc-4191-ad13-58c16ccf11f8"
// );
// console.log("🚀 ~ file: Bookmarks.tsx:37 ~ res:", res.getAttributes());
})();
}, []);

Expand Down
Loading

0 comments on commit 5ff97d4

Please sign in to comment.