diff --git a/.fallowrc.json b/.fallowrc.json index 0568a68..63959e1 100644 --- a/.fallowrc.json +++ b/.fallowrc.json @@ -1,6 +1,8 @@ { "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", "entry": ["test/features/*.test.js", "test/unit/*.test.js"], + "ignorePatterns": ["static/**"], + "ignoreUnresolvedImports": ["/**/static/**"], "ignoreDependencies": ["pino"], "ignoreExports": [{ "file": "static/auth-client.js", "exports": ["*"] }] } diff --git a/eslint.config.js b/eslint.config.js index 7cb2650..42c485b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -3,6 +3,9 @@ import globals from "globals"; import { defineConfig } from "eslint/config"; export default defineConfig([ + { + ignores: ["static/**"], + }, { files: ["**/*.{js,mjs,cjs}"], plugins: { js }, diff --git a/src/app/components/admin.js b/src/app/components/admin.js index 84c7207..88b3164 100644 --- a/src/app/components/admin.js +++ b/src/app/components/admin.js @@ -1,59 +1,72 @@ import { html } from "hono/html"; import { formatISO } from "date-fns"; -// Admin users list component export const UsersList = ({ users, total }) => html` -
-

Users (${total} total)

+
+
+

Users (${total} total)

+
${users && users.length > 0 ? html` - - - - - - - - - - - - ${users.map( - (user) => html` - - - - - + + + `, + )} + +
NameEmailVerifiedRoleCreated
${user.name}${user.email}${user.emailVerified ? "✅" : "❌"} -
- - + + + + + + + + + + + ${users.map( + (user) => html` + + + + + - - - `, - )} - -
NameEmailVerifiedRoleDate
${user.name}${user.email}${user.emailVerified ? "✅" : "❌"} + + + - - - ${formatISO(new Date(user.createdAt), { - representation: "date", - })} -
+ + + + +
+ ${formatISO(new Date(user.createdAt), { + representation: "date", + })} +
+
` - : html`

No users found.

`} + : html`
+

No users found.

+
`}
`; diff --git a/src/app/components/common.js b/src/app/components/common.js index 9e36798..40fa369 100644 --- a/src/app/components/common.js +++ b/src/app/components/common.js @@ -1,18 +1,20 @@ import { html } from "hono/html"; -// Form section wrapper -export const FormSection = ({ children }) => html`
${children}
`; - // Message display component -export const Message = ({ error, success }) => html` +export const Message = ({ error, success, info } = {}) => html` ${error - ? html`
+ ? html`
${decodeURIComponent(error)}
` : ""} ${success - ? html`
+ ? html`
${decodeURIComponent(success)}
` : ""} + ${info + ? html`
+ ${decodeURIComponent(info)} +
` + : ""} `; diff --git a/src/app/components/home.js b/src/app/components/home.js index 66bb5d6..cdb4416 100644 --- a/src/app/components/home.js +++ b/src/app/components/home.js @@ -2,18 +2,38 @@ import { html } from "hono/html"; // Login status display export const LoginStatus = ({ user }) => html` - ${user - ? html` -
- ✅ Logged in as: ${user.name} (${user.email}) -
- View Profile | -
- -
- ` - : html` -
❌ Not logged in
- Sign In - `} +
+ ${user + ? html` +
+ Logged in as ${user.name} (${user.email}) +
+
+ View Profile +
+ +
+
+ ` + : html` +
+ codebar mark +

Welcome to codebar

+

+ Sign in to manage your profile and access workshops. +

+ Sign In +
+ `} +
`; diff --git a/src/app/components/layout.js b/src/app/components/layout.js index 8c9f4b3..a29b8c3 100644 --- a/src/app/components/layout.js +++ b/src/app/components/layout.js @@ -1,32 +1,63 @@ import { html } from "hono/html"; // Base layout component -export const Layout = ({ title, children }) => html` +export const Layout = ({ title, children, hideNav }) => html` - + - ${title} + codebar Auth — ${title} - + + - + + -
-
${children}
-
+ ${!hideNav + ? html` + + ` + : ""} +
${children}
+ `; + // Navigation component export const Navigation = ({ back, extra }) => html` - ← ${back.text} - ${extra ? html` | ${extra.text}` : ""} + ← ${back.text} + ${extra + ? html`${extra.text}` + : ""} `; diff --git a/src/app/components/login.js b/src/app/components/login.js index c840514..e66b09a 100644 --- a/src/app/components/login.js +++ b/src/app/components/login.js @@ -1,17 +1,19 @@ import { html } from "hono/html"; export const GitHubButton = ({ callbackURL } = {}) => html` -

Using GitHub

- +
`; export const MagicLinkButton = ({ callbackURL } = {}) => html` -

Using magic link

- +
`; diff --git a/src/app/components/profile.js b/src/app/components/profile.js index 0497a26..3f504b2 100644 --- a/src/app/components/profile.js +++ b/src/app/components/profile.js @@ -1,17 +1,24 @@ import { html } from "hono/html"; import { format } from "date-fns"; -// User info display export const UserInfo = ({ user }) => html` -

User Information

-

Name: ${user.name}

-

Email: ${user.email}

-

ID: ${user.id}

-

Email Verified: ${user.emailVerified ? "Yes" : "No"}

-

- Created: ${format( - new Date(user.createdAt), - "yyyy-MM-dd HH:mm:ss", - )} -

+
+
+

User Information

+
+
+
+
Name
+
${user.name}
+
Email
+
${user.email}
+
Email verified
+
${user.emailVerified ? "Yes" : "No"}
+
Member since
+
+ ${format(new Date(user.createdAt), "dd MMM yyyy")} +
+
+
+
`; diff --git a/src/app/demo/templates/home.html b/src/app/demo/templates/home.html index c8c994d..dbb7de4 100644 --- a/src/app/demo/templates/home.html +++ b/src/app/demo/templates/home.html @@ -15,7 +15,7 @@

Demo Time

-
+