{message}
+{details}
+ {stack && ( +
+ {stack}
+
+ )}
+ Admin Jobs
; +} diff --git a/ui/app/pages/admin/users.jsx b/ui/app/pages/admin/users.jsx new file mode 100644 index 00000000..c6fc7c61 --- /dev/null +++ b/ui/app/pages/admin/users.jsx @@ -0,0 +1,167 @@ +import { useEffect, useState } from "react"; +import { createUser, getUsers, updateUser } from "../../api/admin"; + +export function meta() { + return [{ title: "Admin Users - Smriti" }]; +} + +function CreateUser() { + const [name, setName] = useState(""); + const [username, setUsername] = useState(""); + const [password, setPassword] = useState(""); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(""); + const [success, setSuccess] = useState(""); + + const handleCreateUser = async (e) => { + e.preventDefault(); + setLoading(true); + setError(""); + setSuccess(""); + + try { + let res = await createUser({ name, username, password }); + setSuccess(res); + } catch (err) { + setError(err); + } finally { + setLoading(false); + } + }; + + return ( + + ); +} + +function UpdateUser(user) { + const [id, _] = useState(user.id); + const [name, setName] = useState(user.name); + const [username, setUsername] = useState(user.username); + const [password, setPassword] = useState(user.password); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(""); + const [success, setSuccess] = useState(""); + + const handleUpdateUser = async (e) => { + e.preventDefault(); + setLoading(true); + setError(""); + setSuccess(""); + + try { + let res = await updateUser(id, { name, username, password }); + setSuccess(res); + } catch (err) { + setError(err); + } finally { + setLoading(false); + } + }; + + return ( + + ); +} + +function ListUsers() { + const [users, setUsers] = useState([]); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(""); + + useEffect(() => { + try { + setLoading(true); + let res = getUsers(); + res.then((data) => { + setUsers(data); + }); + } catch (err) { + setError(err); + } finally { + setLoading(false); + } + }, []); + + return ( +Users
+ {(!loading && + users && + users.length > 0 && + users.map((user) =>Album: {id}
; +} diff --git a/ui/app/pages/albums/index.jsx b/ui/app/pages/albums/index.jsx new file mode 100644 index 00000000..ce0e0335 --- /dev/null +++ b/ui/app/pages/albums/index.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Albums - Smriti" }]; +} + +export default function Albums() { + returnAlbums
; +} diff --git a/ui/app/pages/auth/login.jsx b/ui/app/pages/auth/login.jsx new file mode 100644 index 00000000..d359a7f4 --- /dev/null +++ b/ui/app/pages/auth/login.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Login - Smriti" }]; +} + +export default function Login() { + returnUsers Login
; +} diff --git a/ui/app/pages/explore/people.jsx b/ui/app/pages/explore/people.jsx new file mode 100644 index 00000000..d8a9c133 --- /dev/null +++ b/ui/app/pages/explore/people.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "People - Smriti" }]; +} + +export default function People() { + returnPeople
; +} diff --git a/ui/app/pages/explore/person.jsx b/ui/app/pages/explore/person.jsx new file mode 100644 index 00000000..757f8818 --- /dev/null +++ b/ui/app/pages/explore/person.jsx @@ -0,0 +1,11 @@ +import { useParams } from "react-router"; + +export function meta() { + return [{ title: "(TODO) Person Name - Smriti" }]; +} + +export default function Person() { + const { id } = useParams(); + + returnPerson: {id}
; +} diff --git a/ui/app/pages/explore/place.jsx b/ui/app/pages/explore/place.jsx new file mode 100644 index 00000000..f9b4473f --- /dev/null +++ b/ui/app/pages/explore/place.jsx @@ -0,0 +1,11 @@ +import { useParams } from "react-router"; + +export function meta() { + return [{ title: "(TODO) Place Name - Smriti" }]; +} + +export default function Place() { + const { id } = useParams(); + + returnPlace: {id}
; +} diff --git a/ui/app/pages/explore/places.jsx b/ui/app/pages/explore/places.jsx new file mode 100644 index 00000000..c0afb097 --- /dev/null +++ b/ui/app/pages/explore/places.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Places - Smriti" }]; +} + +export default function Places() { + returnPlaces
; +} diff --git a/ui/app/pages/explore/thing.jsx b/ui/app/pages/explore/thing.jsx new file mode 100644 index 00000000..6ca4e504 --- /dev/null +++ b/ui/app/pages/explore/thing.jsx @@ -0,0 +1,11 @@ +import { useParams } from "react-router"; + +export function meta() { + return [{ title: "(TODO) Thing Name - Smriti" }]; +} + +export default function Thing() { + const { id } = useParams(); + + returnThing: {id}
; +} diff --git a/ui/app/pages/explore/things.jsx b/ui/app/pages/explore/things.jsx new file mode 100644 index 00000000..c84fe2c5 --- /dev/null +++ b/ui/app/pages/explore/things.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Things - Smriti" }]; +} + +export default function Things() { + returnThings
; +} diff --git a/ui/app/pages/home/index.jsx b/ui/app/pages/home/index.jsx new file mode 100644 index 00000000..2e28aa9c --- /dev/null +++ b/ui/app/pages/home/index.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Home - Smriti" }]; +} + +export default function Home() { + returnHome
; +} diff --git a/ui/app/pages/library/favourites.jsx b/ui/app/pages/library/favourites.jsx new file mode 100644 index 00000000..2f0e800f --- /dev/null +++ b/ui/app/pages/library/favourites.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Favourites - Smriti" }]; +} + +export default function Favourites() { + returnFavourites
; +} diff --git a/ui/app/pages/library/hidden.jsx b/ui/app/pages/library/hidden.jsx new file mode 100644 index 00000000..1c6768a1 --- /dev/null +++ b/ui/app/pages/library/hidden.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Hidden - Smriti" }]; +} + +export default function Hidden() { + returnHidden
; +} diff --git a/ui/app/pages/library/trash.jsx b/ui/app/pages/library/trash.jsx new file mode 100644 index 00000000..a9180848 --- /dev/null +++ b/ui/app/pages/library/trash.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Trash - Smriti" }]; +} + +export default function Trash() { + returnTrash
; +} diff --git a/ui/app/pages/sharing/index.jsx b/ui/app/pages/sharing/index.jsx new file mode 100644 index 00000000..86733668 --- /dev/null +++ b/ui/app/pages/sharing/index.jsx @@ -0,0 +1,7 @@ +export function meta() { + return [{ title: "Sharing - Smriti" }]; +} + +export default function Sharing() { + returnSharing
; +} diff --git a/ui/app/pages/sharing/sharedalbum.jsx b/ui/app/pages/sharing/sharedalbum.jsx new file mode 100644 index 00000000..b95094c1 --- /dev/null +++ b/ui/app/pages/sharing/sharedalbum.jsx @@ -0,0 +1,11 @@ +import { useParams } from "react-router"; + +export function meta() { + return [{ title: "(TODO) Shared Album Name - Smriti" }]; +} + +export default function SharedAlbum() { + const { id } = useParams(); + + returnShared Album: {id}
; +} diff --git a/ui/app/root.jsx b/ui/app/root.jsx new file mode 100644 index 00000000..9ec8f7a2 --- /dev/null +++ b/ui/app/root.jsx @@ -0,0 +1,77 @@ +import { + isRouteErrorResponse, + Links, + Meta, + Outlet, + Scripts, + ScrollRestoration, +} from "react-router"; + +import "./app.css"; + +export const links = () => [ + { rel: "preconnect", href: "https://fonts.googleapis.com" }, + { + rel: "preconnect", + href: "https://fonts.gstatic.com", + crossOrigin: "anonymous", + }, + { + rel: "stylesheet", + href: "https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap", + }, +]; + +export function Layout({ children }) { + return ( + + + + + +{details}
+ {stack && ( +
+ {stack}
+
+ )}
+