Files
markone/packages/web/src/app/index.tsx

80 lines
2.1 KiB
TypeScript
Raw Normal View History

2025-05-06 11:00:35 +01:00
import { DEMO_USER } from "@markone/core/user"
import { createFileRoute, useNavigate } from "@tanstack/react-router"
import { useLogin } from "~/auth"
import { Link } from "~/components/link"
2025-05-03 23:27:36 +01:00
function Index() {
return (
<main className="p-48 flex flex-row items-start justify-center space-x-24">
<div className="flex flex-col items-start">
<h1 className="text-2xl">
<span className="font-bold">MARKONE</span>
<br />
</h1>
<p className="pb-4 text-2xl uppercase">BOOKMARK MANAGER</p>
<div className="flex flex-col text-lg">
2025-05-07 15:47:08 +01:00
<Link href="/login">LOGIN</Link>
2025-05-07 23:40:03 +01:00
<Link href="/signup">SIGN UP</Link>
2025-05-06 11:00:35 +01:00
<DemoButton />
2025-05-03 23:27:36 +01:00
</div>
</div>
2025-05-07 15:47:08 +01:00
<div className="container max-w-2xl">
2025-05-03 23:27:36 +01:00
<p>
<strong>WHAT IS MARKONE?</strong>
<br />
MARKONE is a local-first, self-hostable bookmark manager.
</p>
<ul className="px-2 pt-2">
2025-05-06 11:00:35 +01:00
<li>* Curate interesting websites you find online, and let MARKONE archive them.</li>
2025-05-03 23:27:36 +01:00
<li>* Reference your saved bookmarks anytime, even when offline.</li>
<li>* Share your collections to others with a permalink.</li>
</ul>
<br />
<p>
<strong>WHERE IS MARKONE?</strong>
<br />
MARKONE is available as a web app and a browser extension for now.
</p>
<br />
<p>
<strong>TECHNICAL STUFF</strong>
<br />
2025-05-06 11:00:35 +01:00
Source code, as well as hosting guide for MARKONE is <Link href="https://github.com/">available here</Link>.
2025-05-03 23:27:36 +01:00
<br />
</p>
</div>
</main>
2025-05-06 11:00:35 +01:00
)
}
function DemoButton() {
const loginMutation = useLogin()
const navigate = useNavigate()
async function startDemo() {
2025-05-07 15:47:08 +01:00
try {
const res = await loginMutation.mutateAsync({
username: DEMO_USER.username,
password: DEMO_USER.unhashedPassword,
})
if (res.status === 200) {
navigate({ to: "/bookmarks" })
}
} catch {}
2025-05-06 11:00:35 +01:00
}
return (
<button
type="button"
onClick={startDemo}
className="underline active:bg-stone-700 dark:active:bg-stone-200 dark:active:text-stone-800 active:text-stone-200 text-left"
>
DEMO
</button>
)
2025-05-03 23:27:36 +01:00
}
export const Route = createFileRoute("/")({
component: Index,
2025-05-06 11:00:35 +01:00
})