Merge branch 'main' into dependabot/npm_and_yarn/production-54355eb8c8
|
|
@ -18,6 +18,9 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -17,27 +17,27 @@ export function meta(_args: Route.MetaArgs) {
|
|||
export async function loader({ request }: Route.LoaderArgs) {
|
||||
const user = await getSessionUser(request);
|
||||
const url = new URL(request.url);
|
||||
const showAddPasskey = url.searchParams.get("add-passkey") === "1" && user !== null;
|
||||
const addPasskeyParam = url.searchParams.get("add-passkey") === "1" && user !== null;
|
||||
|
||||
let passkeyCount = 0;
|
||||
if (user) {
|
||||
// Only show the add-passkey prompt if the user has no passkeys yet
|
||||
let showAddPasskey = false;
|
||||
if (addPasskeyParam && user) {
|
||||
const db = getDb();
|
||||
const [row] = await db
|
||||
.select({ count: count() })
|
||||
.from(credentials)
|
||||
.where(eq(credentials.userId, user.id));
|
||||
passkeyCount = row?.count ?? 0;
|
||||
showAddPasskey = (row?.count ?? 0) === 0;
|
||||
}
|
||||
|
||||
return data({
|
||||
user: user ? { id: user.id, username: user.username, displayName: user.displayName } : null,
|
||||
showAddPasskey,
|
||||
passkeyCount,
|
||||
});
|
||||
}
|
||||
|
||||
export default function Home({ loaderData }: Route.ComponentProps) {
|
||||
const { user, showAddPasskey, passkeyCount } = loaderData;
|
||||
const { user, showAddPasskey } = loaderData;
|
||||
const { t } = useTranslation("journal");
|
||||
const [addingPasskey, setAddingPasskey] = useState(false);
|
||||
const [passkeyDone, setPasskeyDone] = useState(false);
|
||||
|
|
@ -144,11 +144,6 @@ export default function Home({ loaderData }: Route.ComponentProps) {
|
|||
</div>
|
||||
)}
|
||||
|
||||
{user && passkeyCount > 0 && !showAddPasskey && (
|
||||
<p className="mt-4 text-sm text-gray-500">
|
||||
{t("passkeyStatus", { count: passkeyCount })}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt-8 flex gap-4">
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
BIN
apps/journal/public/apple-touch-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
apps/journal/public/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
apps/journal/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
6
apps/journal/public/favicon.svg
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<svg width="32" height="32" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M28 90 C45 90, 50 50, 64 45 S85 70, 100 35" stroke="#4A6B40" stroke-width="6" stroke-linecap="round" fill="none"/>
|
||||
<circle cx="28" cy="90" r="12" fill="#4A6B40"/>
|
||||
<circle cx="64" cy="45" r="12" fill="#4A6B40"/>
|
||||
<circle cx="100" cy="35" r="12" fill="#4A6B40"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 382 B |
|
|
@ -16,6 +16,9 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
BIN
apps/planner/public/apple-touch-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
apps/planner/public/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
apps/planner/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
6
apps/planner/public/favicon.svg
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<svg width="32" height="32" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M28 90 C45 90, 50 50, 64 45 S85 70, 100 35" stroke="#4A6B40" stroke-width="6" stroke-linecap="round" fill="none"/>
|
||||
<circle cx="28" cy="90" r="12" fill="#4A6B40"/>
|
||||
<circle cx="64" cy="45" r="12" fill="#4A6B40"/>
|
||||
<circle cx="100" cy="35" r="12" fill="#4A6B40"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 382 B |