Skip to content

Commit 69a1f8d

Browse files
committed
theme
1 parent 5342aef commit 69a1f8d

File tree

13 files changed

+130856
-101
lines changed

13 files changed

+130856
-101
lines changed

app/bible_data/kjv.json

Lines changed: 130685 additions & 0 deletions
Large diffs are not rendered by default.

app/models/bible.server.ts

Whitespace-only changes.

app/routes/_index.tsx

Lines changed: 17 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Link } from "@remix-run/react";
33

44
import { useOptionalUser } from "~/utils";
55

6-
export const meta: MetaFunction = () => [{ title: "Remix Notes" }];
6+
export const meta: MetaFunction = () => [{ title: "Homeschool Lab" }];
77

88
export default function Index() {
99
const user = useOptionalUser();
@@ -15,126 +15,51 @@ export default function Index() {
1515
<div className="absolute inset-0">
1616
<img
1717
className="h-full w-full object-cover"
18-
src="https://user-images.githubusercontent.com/1500684/157774694-99820c51-8165-4908-a031-34fc371ac0d6.jpg"
19-
alt="Sonic Youth On Stage"
18+
src="/assets/sea-turtle-swimming-in-the-ocean.jpg"
19+
alt="Sea Turtle Swimming in the Ocean"
2020
/>
21-
<div className="absolute inset-0 bg-[color:rgba(254,204,27,0.5)] mix-blend-multiply" />
21+
<div className="absolute inset-0 bg-[color:rgba(0,100,150,0.5)] mix-blend-multiply" />
2222
</div>
2323
<div className="relative px-4 pb-8 pt-16 sm:px-6 sm:pb-14 sm:pt-24 lg:px-8 lg:pb-20 lg:pt-32">
24-
<h1 className="text-center text-6xl font-extrabold tracking-tight sm:text-8xl lg:text-9xl">
25-
<span className="block uppercase text-yellow-500 drop-shadow-md">
26-
Indie Stack
24+
<h1 className="text-center text-6xl font-extrabold tracking-tight sm:text-8xl lg:text-9xl font-schoolbell">
25+
<span className="block uppercase text-white drop-shadow-md">
26+
Homeschool
2727
</span>
2828
</h1>
29-
<p className="mx-auto mt-6 max-w-lg text-center text-xl text-white sm:max-w-3xl">
30-
Check the README.md file for instructions on how to get this
31-
project deployed.
29+
<p className="mx-auto mt-6 max-w-lg text-center text-xl text-white sm:max-w-3xl font-schoolbell">
30+
2 Timothy 2:15 Study to shew thyself approved unto God, a workman that needeth not to be ashamed, rightly dividing the word of truth.
3231
</p>
3332
<div className="mx-auto mt-10 max-w-sm sm:flex sm:max-w-none sm:justify-center">
3433
{user ? (
3534
<Link
36-
to="/notes"
37-
className="flex items-center justify-center rounded-md border border-transparent bg-white px-4 py-3 text-base font-medium text-yellow-700 shadow-sm hover:bg-yellow-50 sm:px-8"
35+
to="/portal"
36+
className="flex items-center justify-center rounded-md border border-transparent bg-white px-4 py-3 text-base font-medium text-blue-700 shadow-sm hover:bg-blue-50 sm:px-8"
3837
>
39-
View Notes for {user.email}
38+
Go to Portal {user.email}
4039
</Link>
4140
) : (
4241
<div className="space-y-4 sm:mx-auto sm:inline-grid sm:grid-cols-2 sm:gap-5 sm:space-y-0">
4342
<Link
4443
to="/join"
45-
className="flex items-center justify-center rounded-md border border-transparent bg-white px-4 py-3 text-base font-medium text-yellow-700 shadow-sm hover:bg-yellow-50 sm:px-8"
44+
className="flex items-center justify-center rounded-md border border-transparent bg-white px-4 py-3 text-base font-medium text-blue-700 shadow-sm hover:bg-blue-50 sm:px-8"
4645
>
4746
Sign up
4847
</Link>
4948
<Link
5049
to="/login"
51-
className="flex items-center justify-center rounded-md bg-yellow-500 px-4 py-3 font-medium text-white hover:bg-yellow-600"
50+
className="flex items-center justify-center rounded-md bg-blue-500 px-4 py-3 font-medium text-white hover:bg-blue-600"
5251
>
5352
Log In
5453
</Link>
5554
</div>
5655
)}
5756
</div>
58-
<a href="https://remix.run">
59-
<img
60-
src="https://user-images.githubusercontent.com/1500684/158298926-e45dafff-3544-4b69-96d6-d3bcc33fc76a.svg"
61-
alt="Remix"
62-
className="mx-auto mt-16 w-full max-w-[12rem] md:max-w-[16rem]"
63-
/>
64-
</a>
57+
<div className="flex items-center justify-center">
58+
<p className="mx-auto mt-16 text-center text-6xl text-white w-full max-w-[12rem] md:max-w-[16rem] font-schoolbell">Portal</p>
59+
</div>
6560
</div>
6661
</div>
6762
</div>
68-
69-
<div className="mx-auto max-w-7xl px-4 py-2 sm:px-6 lg:px-8">
70-
<div className="mt-6 flex flex-wrap justify-center gap-8">
71-
{[
72-
{
73-
src: "https://user-images.githubusercontent.com/1500684/157764397-ccd8ea10-b8aa-4772-a99b-35de937319e1.svg",
74-
alt: "Fly.io",
75-
href: "https://fly.io",
76-
},
77-
{
78-
src: "https://user-images.githubusercontent.com/1500684/157764395-137ec949-382c-43bd-a3c0-0cb8cb22e22d.svg",
79-
alt: "SQLite",
80-
href: "https://sqlite.org",
81-
},
82-
{
83-
src: "https://user-images.githubusercontent.com/1500684/157764484-ad64a21a-d7fb-47e3-8669-ec046da20c1f.svg",
84-
alt: "Prisma",
85-
href: "https://prisma.io",
86-
},
87-
{
88-
src: "https://user-images.githubusercontent.com/1500684/157764276-a516a239-e377-4a20-b44a-0ac7b65c8c14.svg",
89-
alt: "Tailwind",
90-
href: "https://tailwindcss.com",
91-
},
92-
{
93-
src: "https://user-images.githubusercontent.com/1500684/157764454-48ac8c71-a2a9-4b5e-b19c-edef8b8953d6.svg",
94-
alt: "Cypress",
95-
href: "https://www.cypress.io",
96-
},
97-
{
98-
src: "https://user-images.githubusercontent.com/1500684/157772386-75444196-0604-4340-af28-53b236faa182.svg",
99-
alt: "MSW",
100-
href: "https://mswjs.io",
101-
},
102-
{
103-
src: "https://user-images.githubusercontent.com/1500684/157772447-00fccdce-9d12-46a3-8bb4-fac612cdc949.svg",
104-
alt: "Vitest",
105-
href: "https://vitest.dev",
106-
},
107-
{
108-
src: "https://user-images.githubusercontent.com/1500684/157772662-92b0dd3a-453f-4d18-b8be-9fa6efde52cf.png",
109-
alt: "Testing Library",
110-
href: "https://testing-library.com",
111-
},
112-
{
113-
src: "https://user-images.githubusercontent.com/1500684/157772934-ce0a943d-e9d0-40f8-97f3-f464c0811643.svg",
114-
alt: "Prettier",
115-
href: "https://prettier.io",
116-
},
117-
{
118-
src: "https://user-images.githubusercontent.com/1500684/157772990-3968ff7c-b551-4c55-a25c-046a32709a8e.svg",
119-
alt: "ESLint",
120-
href: "https://eslint.org",
121-
},
122-
{
123-
src: "https://user-images.githubusercontent.com/1500684/157773063-20a0ed64-b9f8-4e0b-9d1e-0b65a3d4a6db.svg",
124-
alt: "TypeScript",
125-
href: "https://typescriptlang.org",
126-
},
127-
].map((img) => (
128-
<a
129-
key={img.href}
130-
href={img.href}
131-
className="flex h-16 w-32 justify-center p-1 grayscale transition hover:grayscale-0 focus:grayscale-0"
132-
>
133-
<img alt={img.alt} src={img.src} className="object-contain" />
134-
</a>
135-
))}
136-
</div>
137-
</div>
13863
</div>
13964
</main>
14065
);

app/routes/bible.tsx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import type { LoaderFunctionArgs } from "@remix-run/node";
2+
import { json } from "@remix-run/node";
3+
import { Form, Link, NavLink, Outlet, useLoaderData } from "@remix-run/react";
4+
import { requireUserId } from "~/session.server";
5+
import { useUser } from "~/utils";
6+
7+
export const loader = async ({ request }: LoaderFunctionArgs) => {
8+
const userId = await requireUserId(request);
9+
return json({ userId });
10+
};
11+
12+
export default function BiblePage() {
13+
const data = useLoaderData<typeof loader>();
14+
const user = useUser();
15+
16+
return (
17+
<div className="flex h-full min-h-screen flex-col">
18+
<header className="flex items-center justify-between bg-slate-800 p-4 text-white">
19+
<h1 className="text-3xl font-bold">
20+
<Link to=".">Bible</Link>
21+
</h1>
22+
<p>{user.email}</p>
23+
<Form action="/logout" method="post">
24+
<button
25+
type="submit"
26+
className="rounded bg-slate-600 px-4 py-2 text-blue-100 hover:bg-blue-500 active:bg-blue-600"
27+
>
28+
Logout
29+
</button>
30+
</Form>
31+
</header>
32+
33+
<main className="flex h-full bg-white">
34+
<div className="h-full w-80 border-r bg-gray-50">
35+
<hr />
36+
37+
<ol>
38+
<li>
39+
<NavLink
40+
className={({ isActive }) =>
41+
`block border-b p-4 text-xl ${isActive ? "bg-white" : ""}`
42+
}
43+
to="old-testament"
44+
>
45+
📖 Old Testament
46+
</NavLink>
47+
</li>
48+
<li>
49+
<NavLink
50+
className={({ isActive }) =>
51+
`block border-b p-4 text-xl ${isActive ? "bg-white" : ""}`
52+
}
53+
to="new-testament"
54+
>
55+
📖 New Testament
56+
</NavLink>
57+
</li>
58+
</ol>
59+
</div>
60+
61+
<div className="flex-1 p-6">
62+
<Outlet />
63+
</div>
64+
</main>
65+
</div>
66+
);
67+
}

app/routes/login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const meta: MetaFunction = () => [{ title: "Login" }];
6666

6767
export default function LoginPage() {
6868
const [searchParams] = useSearchParams();
69-
const redirectTo = searchParams.get("redirectTo") || "/notes";
69+
const redirectTo = searchParams.get("redirectTo") || "/portal";
7070
const actionData = useActionData<typeof action>();
7171
const emailRef = useRef<HTMLInputElement>(null);
7272
const passwordRef = useRef<HTMLInputElement>(null);

app/routes/notes.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { LoaderFunctionArgs } from "@remix-run/node";
22
import { json } from "@remix-run/node";
33
import { Form, Link, NavLink, Outlet, useLoaderData } from "@remix-run/react";
4-
54
import { getNoteListItems } from "~/models/note.server";
65
import { requireUserId } from "~/session.server";
76
import { useUser } from "~/utils";
@@ -67,4 +66,4 @@ export default function NotesPage() {
6766
</main>
6867
</div>
6968
);
70-
}
69+
}

app/routes/portal.tsx

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import type { LoaderFunctionArgs } from "@remix-run/node";
2+
import { json } from "@remix-run/node";
3+
import { Form, Link, NavLink, Outlet, useLoaderData } from "@remix-run/react";
4+
import { requireUserId } from "~/session.server";
5+
import { useUser } from "~/utils";
6+
7+
export const loader = async ({ request }: LoaderFunctionArgs) => {
8+
const userId = await requireUserId(request);
9+
return json({ userId });
10+
};
11+
12+
export default function PortalPage() {
13+
const data = useLoaderData<typeof loader>();
14+
const user = useUser();
15+
16+
return (
17+
<div className="flex h-full min-h-screen flex-col">
18+
<header className="flex items-center justify-between bg-slate-800 p-4 text-white">
19+
<h1 className="text-3xl font-bold">
20+
<Link to=".">Portal</Link>
21+
</h1>
22+
<p>{user.email}</p>
23+
<Form action="/logout" method="post">
24+
<button
25+
type="submit"
26+
className="rounded bg-slate-600 px-4 py-2 text-blue-100 hover:bg-blue-500 active:bg-blue-600"
27+
>
28+
Logout
29+
</button>
30+
</Form>
31+
</header>
32+
33+
<main className="flex h-full bg-white">
34+
<div className="h-full w-80 border-r bg-gray-50">
35+
36+
<hr />
37+
38+
<ol>
39+
<li>
40+
<NavLink
41+
className={({ isActive }) =>
42+
`block border-b p-4 text-xl ${isActive ? "bg-white" : ""}`
43+
}
44+
to="/bible"
45+
>
46+
📖 Bible
47+
</NavLink>
48+
</li>
49+
<li>
50+
<NavLink
51+
className={({ isActive }) =>
52+
`block border-b p-4 text-xl ${isActive ? "bg-white" : ""}`
53+
}
54+
to="/notes"
55+
>
56+
📝 Notes
57+
</NavLink>
58+
</li>
59+
</ol>
60+
</div>
61+
62+
<div className="flex-1 p-6">
63+
<Outlet /> {/* Renders nested routes like /bible or /notes */}
64+
</div>
65+
</main>
66+
</div>
67+
);
68+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"build": "remix build",
8-
"dev": "remix dev -c \"npm run dev:serve\"",
8+
"dev": "remix dev",
99
"dev:serve": "NODE_OPTIONS=\"--import ./mocks/index.js\" remix-serve ./build/index.js",
1010
"format": "prettier --write .",
1111
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",

prisma/seed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import bcrypt from "bcryptjs";
44
const prisma = new PrismaClient();
55

66
async function seed() {
7-
const email = "rachel@remix.run";
7+
const email = "admin@homeschool.lab";
88

99
// cleanup the existing database
1010
await prisma.user.delete({ where: { email } }).catch(() => {
1111
// no worries if it doesn't exist yet
1212
});
1313

14-
const hashedPassword = await bcrypt.hash("racheliscool", 10);
14+
const hashedPassword = await bcrypt.hash("admin@homeschool", 10);
1515

1616
const user = await prisma.user.create({
1717
data: {

0 commit comments

Comments
 (0)