diff --git a/web/src/features/home/components/HomePage/HomePage.types.ts b/web/src/features/home/components/HomePage/HomePage.types.ts
index 7be7b21..45da3fa 100644
--- a/web/src/features/home/components/HomePage/HomePage.types.ts
+++ b/web/src/features/home/components/HomePage/HomePage.types.ts
@@ -1,3 +1,7 @@
export type HomePageProps = {
+ /** The badge's front, or its back with the sign-in form (#175). */
+ face?: 'front' | 'back';
+ /** Where signing in returns to, from the back. */
+ returnTo?: string;
className?: string;
};
diff --git a/web/src/features/home/components/SignInFace/SignInFace.constants.ts b/web/src/features/home/components/SignInFace/SignInFace.constants.ts
new file mode 100644
index 0000000..f1aae94
--- /dev/null
+++ b/web/src/features/home/components/SignInFace/SignInFace.constants.ts
@@ -0,0 +1,4 @@
+import type { CoverPattern } from '@/design/covers';
+
+/** The front's cover, so the back is the same badge. */
+export const COVER: CoverPattern = 'arrows';
diff --git a/web/src/features/home/components/SignInFace/SignInFace.styles.ts b/web/src/features/home/components/SignInFace/SignInFace.styles.ts
new file mode 100644
index 0000000..533e34a
--- /dev/null
+++ b/web/src/features/home/components/SignInFace/SignInFace.styles.ts
@@ -0,0 +1,42 @@
+// The homepage badge's back (#175): the sign-in form, built as the front
+// is, at the front's size. The badge's tokens are the same in light and
+// dark; the form keeps the app's own palette, in a panel on the badge.
+// Nothing here clips, so the handle's suggestions hang out of the badge
+// (#176): only the cover rounds its own corners.
+
+export const badge =
+ '@container flex w-full flex-1 flex-col rounded-sm bg-accent text-on-accent';
+
+export const cover =
+ 'relative h-30 overflow-hidden rounded-t-sm @min-[40rem]:h-52';
+
+// Beside each other where there's room: the welcome back, then the form.
+export const field =
+ 'grid flex-1 content-start gap-x-12 gap-y-4 px-5 pb-8 @min-[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,24rem)] @min-[40rem]:px-12 @min-[40rem]:pb-12';
+
+export const intro = 'flex flex-col gap-4';
+
+/** Half the logo's height: the other half overlaps the cover. */
+export const logoBox = 'h-12 @min-[40rem]:h-17';
+
+// The ring is the field's colour, so the logo seems cut into the cover.
+export const logo =
+ 'size-24 -translate-y-1/2 shadow-[0_0_0_6px_var(--accent)] @min-[40rem]:size-34';
+
+export const heading =
+ 'text-[clamp(2.5rem,8cqi,4.5rem)] font-extrabold leading-[0.9] tracking-[-0.04em]';
+
+export const lede =
+ 'max-w-[34ch] text-lg font-medium leading-7 @min-[40rem]:text-xl @min-[40rem]:leading-8';
+
+/** The form's column: clear of the cover where they sit side by side. */
+export const aside = 'flex flex-col @min-[40rem]:pt-10';
+
+// The form keeps the app's own palette: a card on the badge, over the
+// sleeve's glare so its text keeps its full contrast.
+export const form =
+ 'relative z-20 max-w-none shadow-[0_1px_2px_rgb(6_1_30/0.15)]';
+
+/** While the session loads: the same card, saying so. */
+export const loading =
+ 'relative z-20 rounded-sm border border-ui-border bg-ui-surface p-6 text-[15px] leading-[22px] text-ui-text-muted';
diff --git a/web/src/features/home/components/SignInPage/SignInPage.test.tsx b/web/src/features/home/components/SignInFace/SignInFace.test.tsx
similarity index 50%
rename from web/src/features/home/components/SignInPage/SignInPage.test.tsx
rename to web/src/features/home/components/SignInFace/SignInFace.test.tsx
index b727951..62deae8 100644
--- a/web/src/features/home/components/SignInPage/SignInPage.test.tsx
+++ b/web/src/features/home/components/SignInFace/SignInFace.test.tsx
@@ -1,15 +1,13 @@
-import { screen, waitFor, within } from '@testing-library/react';
+import { screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { useSession } from '@/features/auth/session/useSession';
import { startSignIn, startSignUp } from '@/lib/atproto/session';
import { expectNoAxeViolations } from '@/test/axe';
-import { ADA } from '@/test/people';
-import { signedInSession } from '@/test/person';
import { renderInRouter } from '@/test/router';
-import { SignInPage } from './SignInPage';
+import { SignInFace } from './SignInFace';
vi.mock('@/features/auth/session/useSession', () => ({ useSession: vi.fn() }));
vi.mock('@/lib/atproto/session', async (importOriginal) => ({
@@ -25,19 +23,21 @@ const signedOut = () =>
refresh: vi.fn(),
});
-const page = (returnTo = '/settings') =>
+const face = (returnTo = '/settings') =>
renderInRouter(
-
,
- `/sign-in?returnTo=${encodeURIComponent(returnTo)}`
+
+
+
,
+ '/sign-in'
);
beforeEach(() => {
signedOut();
});
-describe('SignInPage (#157)', () => {
- it('puts the sign-in form on a badge, with the typeahead', async () => {
- const { container } = page();
+describe('SignInFace, the homepage badge’s back (#157, #175)', () => {
+ it('puts the sign-in form on the badge, with the typeahead', async () => {
+ const { container } = face();
expect(
await screen.findByRole('heading', { level: 1, name: 'Sign in' })
).toBeInTheDocument();
@@ -48,41 +48,11 @@ describe('SignInPage (#157)', () => {
expect(
screen.getByRole('button', { name: 'Create an account' })
).toBeInTheDocument();
- expect(document.title).toBe('Sign in · Lanyards');
await expectNoAxeViolations(container);
});
- it('hangs in a clear sleeve from a lanyard printed lanyards.app (#170)', async () => {
- const { container } = page();
- const heading = await screen.findByRole('heading', {
- level: 1,
- name: 'Sign in',
- });
- const sleeve = heading.closest('[data-sleeve]');
- expect(sleeve).not.toBeNull();
- expect(sleeve).toContainElement(
- screen.getByRole('combobox', { name: 'Your handle' })
- );
- const straps = container.querySelectorAll('textPath');
- expect(straps).toHaveLength(2);
- for (const strap of straps) {
- expect(strap.textContent).toContain('lanyards.app');
- }
- expect(container.querySelectorAll('polygon')).toHaveLength(0);
- });
-
- it('has the homepage’s header, without a Sign in link to itself', async () => {
- page();
- const banner = await screen.findByRole('banner');
- expect(
- within(banner).getByRole('link', { name: 'Lanyards' })
- ).toHaveAttribute('href', '/');
- expect(within(banner).queryByRole('link', { name: 'Sign in' })).toBeNull();
- expect(screen.getByRole('main')).not.toContainElement(banner);
- });
-
it('signs in, coming back to where the person was', async () => {
- page();
+ face();
await userEvent.type(
await screen.findByRole('combobox', { name: 'Your handle' }),
'alice.bsky.social'
@@ -92,7 +62,7 @@ describe('SignInPage (#157)', () => {
});
it('creates an account, coming back to where the person was', async () => {
- page();
+ face();
await userEvent.click(
await screen.findByRole('button', { name: 'Create an account' })
);
@@ -105,24 +75,23 @@ describe('SignInPage (#157)', () => {
signOut: vi.fn(),
refresh: vi.fn(),
});
- page();
+ face();
expect(await screen.findByRole('status')).toHaveTextContent('Loading…');
expect(screen.queryByRole('combobox')).toBeNull();
});
- it('sends someone already signed in on to where they were going', async () => {
- vi.mocked(useSession).mockReturnValue(signedInSession(ADA.did));
- const { router } = page();
- await waitFor(() =>
- expect(router.state.location.pathname).toBe('/settings')
- );
- });
-
- it('sends someone already signed in to their lanyard by default', async () => {
- vi.mocked(useSession).mockReturnValue(signedInSession(ADA.did));
- const { router } = page('/');
- await waitFor(() =>
- expect(router.state.location.pathname).toBe('/lanyard')
- );
+ // The badge clips nothing on its back: the suggestions hang below it.
+ it('lets the handle’s suggestions hang out of the badge (#176)', async () => {
+ face();
+ const combobox = await screen.findByRole('combobox', {
+ name: 'Your handle',
+ });
+ for (
+ let element: HTMLElement | null = combobox.parentElement;
+ element && !element.hasAttribute('data-accent');
+ element = element.parentElement
+ ) {
+ expect(element.className).not.toMatch(/\boverflow-(hidden|clip)\b/);
+ }
});
});
diff --git a/web/src/features/home/components/SignInFace/SignInFace.tsx b/web/src/features/home/components/SignInFace/SignInFace.tsx
new file mode 100644
index 0000000..5c2d8b0
--- /dev/null
+++ b/web/src/features/home/components/SignInFace/SignInFace.tsx
@@ -0,0 +1,50 @@
+import { useLingui } from '@lingui/react/macro';
+import { useId } from 'react';
+
+import { CoverPattern } from '@/components/CoverPattern/CoverPattern';
+import { Logo } from '@/components/Logo/Logo';
+import { SignInForm } from '@/features/auth/components/SignInForm/SignInForm';
+import { useSession } from '@/features/auth/session/useSession';
+
+import { COVER } from './SignInFace.constants';
+import * as styles from './SignInFace.styles';
+import type { SignInFaceProps } from './SignInFace.types';
+
+/**
+ * The back of the homepage badge (#175): the sign-in form, with its handle
+ * typeahead (#157), on the same badge as the welcome on its front.
+ */
+export function SignInFace({ returnTo }: SignInFaceProps) {
+ const { t } = useLingui();
+ const session = useSession();
+ const headingId = useId();
+ return (
+
+
+
+
+
+
+
+
+
+
+ {t`Sign in`}
+
+
+ {t`Use your handle from Bluesky or any other AT Protocol app. New here? Create an account, and it’s yours to take anywhere.`}
+
+
+
+ {session.status === 'signedOut' ? (
+
+ ) : (
+
+ {t`Loading…`}
+
+ )}
+
+
+
+ );
+}
diff --git a/web/src/features/home/components/SignInFace/SignInFace.types.ts b/web/src/features/home/components/SignInFace/SignInFace.types.ts
new file mode 100644
index 0000000..8531a7f
--- /dev/null
+++ b/web/src/features/home/components/SignInFace/SignInFace.types.ts
@@ -0,0 +1,4 @@
+export type SignInFaceProps = {
+ /** Where to go once signed in: a validated same-origin path. */
+ returnTo: string;
+};
diff --git a/web/src/features/home/components/SignInPage/SignInPage.constants.ts b/web/src/features/home/components/SignInPage/SignInPage.constants.ts
deleted file mode 100644
index 346ccd2..0000000
--- a/web/src/features/home/components/SignInPage/SignInPage.constants.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { Accent } from '@/design/accents';
-import type { CoverPattern } from '@/design/covers';
-
-/** Lanyards' own badge, as on the homepage: lime on brand blue. */
-export const BADGE_ACCENT: Accent = 'lime';
-
-export const COVER: CoverPattern = 'arrows';
diff --git a/web/src/features/home/components/SignInPage/SignInPage.styles.ts b/web/src/features/home/components/SignInPage/SignInPage.styles.ts
deleted file mode 100644
index bc68537..0000000
--- a/web/src/features/home/components/SignInPage/SignInPage.styles.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-// The sign-in page (#157): the form on a badge in a clear sleeve, hanging
-// from a lanyard on the brand blue as the homepage's does (#170), but
-// straight and still so the form is easy to use. The badge's tokens are
-// the same in light and dark; the form keeps the app's own palette in a
-// panel on the badge.
-
-/** The page's ground: brand blue (the blue palette's accent). */
-export const page = 'relative flex min-h-dvh flex-col bg-accent';
-
-/** Crops the straps' tops, so they never run up behind the header. */
-export const main =
- 'flex flex-1 flex-col items-center overflow-hidden px-4 pb-14 md:px-8 md:pb-20';
-
-export const hang = 'flex w-full max-w-[34rem] flex-col items-center';
-
-// The clasp's hook ends in the sleeve's slot, a little below its top edge.
-export const ribbon =
- 'relative z-10 h-28 w-auto shrink-0 translate-y-[1.125rem] md:h-36';
-
-export const badge =
- '@container flex w-full flex-col overflow-hidden rounded-sm bg-accent text-on-accent';
-
-export const cover = 'relative h-24 @min-[30rem]:h-28';
-
-export const field =
- 'flex flex-col gap-4 px-5 pb-6 @min-[30rem]:px-8 @min-[30rem]:pb-8';
-
-/** Half the logo's height: the other half overlaps the cover. */
-export const logoBox = 'h-10 @min-[30rem]:h-12';
-
-export const logo =
- 'size-20 -translate-y-1/2 shadow-[0_0_0_6px_var(--accent)] @min-[30rem]:size-24';
-
-export const heading =
- 'text-[clamp(2.5rem,12cqi,3.75rem)] font-extrabold leading-[0.9] tracking-[-0.04em]';
-
-export const lede = 'max-w-[34ch] text-lg font-medium leading-7';
-
-// The form keeps the app's own palette: a card on the badge, full width,
-// over the sleeve's glare so its text keeps its full contrast.
-export const form =
- 'relative z-20 max-w-none shadow-[0_1px_2px_rgb(6_1_30/0.15)]';
-
-/** While the session loads: the same card, saying so. */
-export const loading =
- 'relative z-20 rounded-sm border border-ui-border bg-ui-surface p-6 text-[15px] leading-[22px] text-ui-text-muted';
diff --git a/web/src/features/home/components/SignInPage/SignInPage.tsx b/web/src/features/home/components/SignInPage/SignInPage.tsx
deleted file mode 100644
index b811046..0000000
--- a/web/src/features/home/components/SignInPage/SignInPage.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import { useLingui } from '@lingui/react/macro';
-import { useRouter } from '@tanstack/react-router';
-import { useEffect, useId } from 'react';
-
-import { CoverPattern } from '@/components/CoverPattern/CoverPattern';
-import { Logo } from '@/components/Logo/Logo';
-import { SIGNED_IN_HOME } from '@/features/auth/components/LandingPage/LandingPage.constants';
-import { SignInForm } from '@/features/auth/components/SignInForm/SignInForm';
-import { useSession } from '@/features/auth/session/useSession';
-import { BadgeSleeve } from '@/features/qr/components/BadgeSleeve/BadgeSleeve';
-import { LanyardRibbon } from '@/features/qr/components/LanyardRibbon/LanyardRibbon';
-import { BRAND_PRINT } from '@/features/qr/components/LanyardRibbon/LanyardRibbon.constants';
-import { useDocumentTitle } from '@/hooks/useDocumentTitle';
-import { safeReturnTo } from '@/lib/atproto/oauthConfig';
-
-import { HomeHeader } from '../HomeHeader/HomeHeader';
-import { BADGE_ACCENT, COVER } from './SignInPage.constants';
-import * as styles from './SignInPage.styles';
-import type { SignInPageProps } from './SignInPage.types';
-
-/**
- * `/sign-in` (#157): the sign-in form, with its handle typeahead, on a
- * badge in a clear sleeve, hanging from a lanyard on the brand blue as the
- * homepage's does (#170). Signed in already, it sends people on to where
- * they were going.
- */
-export function SignInPage({ returnTo }: SignInPageProps) {
- const { t } = useLingui();
- const session = useSession();
- const router = useRouter();
- const headingId = useId();
- useDocumentTitle(t`Sign in`);
- const safe = safeReturnTo(returnTo);
- const destination = safe === '/' ? SIGNED_IN_HOME : safe;
- const signedIn = session.status === 'signedIn';
-
- useEffect(() => {
- // destination is a validated same-origin path, which may not be a typed
- // route, so use the history directly.
- if (signedIn) router.history.replace(destination);
- }, [signedIn, destination, router]);
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {t`Sign in`}
-
-
- {t`Use your handle from Bluesky or any other AT Protocol app. New here? Create an account, and it’s yours to take anywhere.`}
-
- {session.status === 'signedOut' ? (
-
- ) : (
-
- {t`Loading…`}
-
- )}
-
-
-
-
-
-
- );
-}
diff --git a/web/src/features/home/components/SignInPage/SignInPage.types.ts b/web/src/features/home/components/SignInPage/SignInPage.types.ts
deleted file mode 100644
index 57f15e4..0000000
--- a/web/src/features/home/components/SignInPage/SignInPage.types.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export type SignInPageProps = {
- /** Where to land after signing in; already a safe, same-origin path. */
- returnTo: string;
-};
diff --git a/web/src/features/qr/components/BadgeSleeve/BadgeSleeve.tsx b/web/src/features/qr/components/BadgeSleeve/BadgeSleeve.tsx
index af6aeb0..d76a6f9 100644
--- a/web/src/features/qr/components/BadgeSleeve/BadgeSleeve.tsx
+++ b/web/src/features/qr/components/BadgeSleeve/BadgeSleeve.tsx
@@ -12,6 +12,7 @@ export function BadgeSleeve({
children,
ref,
ground = 'brand',
+ inert,
className,
slotClassName,
glareClassName,
@@ -20,6 +21,10 @@ export function BadgeSleeve({
;
/** What it hangs on: the brand ground (the default), or a page (#173). */
ground?: 'brand' | 'page';
+ /** Out of reach: the face of a badge that's turned away (#175). */
+ inert?: boolean;
className?: string;
/** The lip's slot, where the clasp goes through. */
slotClassName?: string;
diff --git a/web/src/hooks/useFocusOnNavigation.test.tsx b/web/src/hooks/useFocusOnNavigation.test.tsx
new file mode 100644
index 0000000..5733ea0
--- /dev/null
+++ b/web/src/hooks/useFocusOnNavigation.test.tsx
@@ -0,0 +1,82 @@
+import {
+ createMemoryHistory,
+ createRootRoute,
+ createRoute,
+ createRouter,
+ Outlet,
+ RouterProvider,
+} from '@tanstack/react-router';
+import { render, screen, waitFor } from '@testing-library/react';
+import { describe, expect, it } from 'vitest';
+
+import { useFocusOnNavigation } from './useFocusOnNavigation';
+
+function Root() {
+ useFocusOnNavigation();
+ return ;
+}
+
+/** Two pages; on the second, a face turned away holds the first h1. */
+function app() {
+ const root = createRootRoute({ component: Root });
+ const home = createRoute({
+ getParentRoute: () => root,
+ path: '/',
+ component: () => (
+
+ Home
+
+ ),
+ });
+ const turned = createRoute({
+ getParentRoute: () => root,
+ path: '/turned',
+ component: () => (
+
+
+
Turned away
+
+
+
Turned up
+
+
+ ),
+ });
+ const router = createRouter({
+ routeTree: root.addChildren([home, turned]),
+ history: createMemoryHistory({ initialEntries: ['/'] }),
+ });
+ render();
+ return router;
+}
+
+describe('useFocusOnNavigation', () => {
+ it('leaves the first load alone', async () => {
+ app();
+ expect(
+ await screen.findByRole('heading', { name: 'Home' })
+ ).not.toHaveFocus();
+ });
+
+ it('lands on the new page’s heading after navigating', async () => {
+ const router = app();
+ await screen.findByRole('heading', { name: 'Home' });
+ router.history.push('/turned');
+ await waitFor(() =>
+ expect(screen.getByRole('heading', { name: 'Turned up' })).toHaveFocus()
+ );
+ });
+
+ // A badge turned over keeps its front in the page, out of reach (#175).
+ it('skips a heading that’s out of reach', async () => {
+ const router = app();
+ await screen.findByRole('heading', { name: 'Home' });
+ router.history.push('/turned');
+ await waitFor(() =>
+ expect(screen.getByRole('heading', { name: 'Turned up' })).toHaveFocus()
+ );
+ expect(
+ screen.getByRole('heading', { name: 'Turned away' })
+ ).not.toHaveFocus();
+ });
+});
diff --git a/web/src/hooks/useFocusOnNavigation.ts b/web/src/hooks/useFocusOnNavigation.ts
index 46cb177..67f40e4 100644
--- a/web/src/hooks/useFocusOnNavigation.ts
+++ b/web/src/hooks/useFocusOnNavigation.ts
@@ -3,8 +3,8 @@ import { useEffect } from 'react';
/**
* After client-side navigation, moves focus to the new page's main heading
- * so keyboard and screen-reader users land on, and hear, the new content.
- * The first load is left alone.
+ * so keyboard and screen-reader users land on, and hear, the new content:
+ * the first one within reach. The first load is left alone.
*/
export function useFocusOnNavigation(): void {
const router = useRouter();
@@ -14,7 +14,11 @@ export function useFocusOnNavigation(): void {
router.subscribe('onResolved', (event) => {
if (!event.fromLocation || !event.pathChanged) return;
requestAnimationFrame(() => {
- const heading = document.querySelector('main h1');
+ // The first within reach: a badge turned over keeps its other
+ // face in the page, inert (#175).
+ const heading = [
+ ...document.querySelectorAll('main h1'),
+ ].find((candidate) => !candidate.closest('[inert]'));
if (!heading) return;
heading.tabIndex = -1;
heading.focus();
diff --git a/web/src/i18n/locales/en-GB/messages.po b/web/src/i18n/locales/en-GB/messages.po
index 3f9adf0..5118414 100644
--- a/web/src/i18n/locales/en-GB/messages.po
+++ b/web/src/i18n/locales/en-GB/messages.po
@@ -199,7 +199,7 @@ msgstr "Bluesky isn't answering right now. Check your connection and try again."
msgid "Board positions"
msgstr "Board positions"
-#: src/features/home/components/HomePage/HomePage.tsx:102
+#: src/features/home/components/HomePage/HomePage.tsx:112
msgid "Built for researchers"
msgstr "Built for researchers"
@@ -211,7 +211,7 @@ msgstr "Built on"
msgid "Built on AT Protocol—transparent, inspectable, and aligned with academic values of openness and reusability."
msgstr "Built on AT Protocol—transparent, inspectable, and aligned with academic values of openness and reusability."
-#: src/features/home/components/HomePage/HomePage.tsx:144
+#: src/features/home/components/HomePage/HomePage.tsx:154
msgid "Built on the AT Protocol"
msgstr "Built on the AT Protocol"
@@ -227,7 +227,7 @@ msgstr "Capture this screen"
msgid "Career continuity"
msgstr "Career continuity"
-#: src/features/home/components/HomePage/HomePage.tsx:70
+#: src/features/home/components/HomePage/HomePage.tsx:80
msgid "Career progression demands comprehensive online presence, but maintaining it is administratively overwhelming."
msgstr "Career progression demands comprehensive online presence, but maintaining it is administratively overwhelming."
@@ -306,7 +306,7 @@ msgstr "Connect ORCID, and your publications appear automatically."
msgid "Constant maintenance"
msgstr "Constant maintenance"
-#: src/features/home/components/HomePage/HomePage.tsx:165
+#: src/features/home/components/HomePage/HomePage.tsx:175
msgid "Contact"
msgstr "Contact"
@@ -396,7 +396,7 @@ msgstr "Cover"
msgid "Create an account"
msgstr "Create an account"
-#: src/features/home/components/HomePage/HomePage.tsx:129
+#: src/features/home/components/HomePage/HomePage.tsx:139
msgid "Create your lanyard"
msgstr "Create your lanyard"
@@ -435,7 +435,7 @@ msgid "Discard your unsaved changes?"
msgstr "Discard your unsaved changes?"
#: src/features/feedback/components/SupportLinks/SupportLinks.tsx:54
-#: src/features/home/components/HomePage/HomePage.tsx:151
+#: src/features/home/components/HomePage/HomePage.tsx:161
msgid "Documentation"
msgstr "Documentation"
@@ -483,7 +483,7 @@ msgstr "Enter your handle"
msgid "Enter your handle, not your email — for example alice.bsky.social"
msgstr "Enter your handle, not your email — for example alice.bsky.social"
-#: src/features/home/components/HomePage/HomePage.tsx:43
+#: src/features/home/components/HomePage/HomePage.tsx:53
msgid "Everything you work on, in one link"
msgstr "Everything you work on, in one link"
@@ -516,7 +516,7 @@ msgstr "Follow"
msgid "Follow @{BLUESKY_HANDLE} on Bluesky"
msgstr "Follow @{BLUESKY_HANDLE} on Bluesky"
-#: src/features/home/components/HomePage/HomePage.tsx:136
+#: src/features/home/components/HomePage/HomePage.tsx:146
#: src/features/lanyard/components/HeroActions/HeroActions.tsx:60
msgid "Follow on Bluesky"
msgstr "Follow on Bluesky"
@@ -565,11 +565,11 @@ msgstr "For example alice.bsky.social"
msgid "Full-time roles"
msgstr "Full-time roles"
-#: src/features/home/components/HomePage/HomePage.tsx:42
+#: src/features/home/components/HomePage/HomePage.tsx:52
msgid "Get started"
msgstr "Get started"
-#: src/features/home/components/HomePage/HomePage.tsx:158
+#: src/features/home/components/HomePage/HomePage.tsx:168
msgid "GitHub"
msgstr "GitHub"
@@ -627,7 +627,7 @@ msgstr "Interview"
msgid "Items to show for {name}"
msgstr "Items to show for {name}"
-#: src/features/home/components/HomePage/HomePage.tsx:122
+#: src/features/home/components/HomePage/HomePage.tsx:132
msgid "Join researchers building their professional identity on open infrastructure."
msgstr "Join researchers building their professional identity on open infrastructure."
@@ -691,11 +691,11 @@ msgstr "Lanyards needs your permission"
msgid "Lanyards needs your permission to post feedback"
msgstr "Lanyards needs your permission to post feedback"
-#: src/features/home/components/HomePage/HomePage.tsx:83
+#: src/features/home/components/HomePage/HomePage.tsx:93
msgid "Lanyards pulls together your complete scholarly presence with zero maintenance overhead."
msgstr "Lanyards pulls together your complete scholarly presence with zero maintenance overhead."
-#: src/features/home/components/HomePage/HomePage.tsx:62
+#: src/features/home/components/HomePage/HomePage.tsx:72
msgid "Learn more"
msgstr "Learn more"
@@ -730,7 +730,7 @@ msgstr "Loading your profile…"
#: src/features/account/components/SettingsPage/SettingsPage.tsx:28
#: src/features/feedback/components/FeedbackDialog/FeedbackDialog.tsx:246
-#: src/features/home/components/SignInPage/SignInPage.tsx:68
+#: src/features/home/components/SignInFace/SignInFace.tsx:43
#: src/features/lanyard/customise/CustomisePage/CustomisePage.tsx:68
#: src/features/qr/components/SharePage/SharePage.tsx:41
msgid "Loading…"
@@ -804,7 +804,7 @@ msgstr "Nothing to show yet"
msgid "Now"
msgstr "Now"
-#: src/features/home/components/HomePage/HomePage.tsx:82
+#: src/features/home/components/HomePage/HomePage.tsx:92
msgid "One link, everything visible"
msgstr "One link, everything visible"
@@ -903,7 +903,7 @@ msgstr "Point a camera at the code to open my lanyard, or send the link."
msgid "Post on Bluesky, {date}"
msgstr "Post on Bluesky, {date}"
-#: src/features/home/components/HomePage/HomePage.tsx:103
+#: src/features/home/components/HomePage/HomePage.tsx:113
msgid "Powerful tools designed for academic needs, not corporate networking."
msgstr "Powerful tools designed for academic needs, not corporate networking."
@@ -935,7 +935,7 @@ msgstr "Put your work in the order you want, and hide what’s not relevant."
msgid "QR code for {value}"
msgstr "QR code for {value}"
-#: src/features/home/components/HomePage/HomePage.tsx:119
+#: src/features/home/components/HomePage/HomePage.tsx:129
msgid "Ready to simplify your research presence?"
msgstr "Ready to simplify your research presence?"
@@ -964,7 +964,7 @@ msgstr "Reordering cancelled. {name} stayed where it was."
msgid "Research outputs"
msgstr "Research outputs"
-#: src/features/auth/components/LandingPage/LandingPage.tsx:20
+#: src/features/auth/components/LandingPage/LandingPage.tsx:27
msgid "Researcher profiles on the AT Protocol"
msgstr "Researcher profiles on the AT Protocol"
@@ -1084,15 +1084,15 @@ msgstr "Sifa"
#: src/components/AppHeader/AppHeader.tsx:48
#: src/features/auth/components/CallbackStatus/CallbackStatus.tsx:22
#: src/features/auth/components/CallbackStatus/CallbackStatus.tsx:32
+#: src/features/auth/components/LandingPage/LandingPage.tsx:27
#: src/features/auth/components/SignInForm/SignInForm.tsx:109
#: src/features/home/components/HomeHeader/HomeHeader.tsx:35
-#: src/features/home/components/SignInPage/SignInPage.tsx:32
-#: src/features/home/components/SignInPage/SignInPage.tsx:59
+#: src/features/home/components/SignInFace/SignInFace.tsx:32
#: src/features/lanyard/components/LanyardPage/LanyardPage.tsx:98
msgid "Sign in"
msgstr "Sign in"
-#: src/features/home/components/HomePage/HomePage.tsx:55
+#: src/features/home/components/HomePage/HomePage.tsx:65
msgid "Sign in to get started"
msgstr "Sign in to get started"
@@ -1101,7 +1101,7 @@ msgstr "Sign in to get started"
msgid "Sign in to see this lanyard"
msgstr "Sign in to see this lanyard"
-#: src/features/home/components/HomePage/HomePage.tsx:44
+#: src/features/home/components/HomePage/HomePage.tsx:54
msgid "Sign in with your Bluesky handle, or any AT Protocol account, and Lanyards gathers your publications, talks, affiliations and profiles into one lanyard to share anywhere: on a conference badge, in an email signature, on a slide."
msgstr "Sign in with your Bluesky handle, or any AT Protocol account, and Lanyards gathers your publications, talks, affiliations and profiles into one lanyard to share anywhere: on a conference badge, in an email signature, on a slide."
@@ -1208,15 +1208,15 @@ msgstr "Thank you"
msgid "That doesn't look like a handle — for example alice.bsky.social"
msgstr "That doesn't look like a handle — for example alice.bsky.social"
-#: src/features/home/components/HomeBadge/HomeBadge.tsx:55
+#: src/features/home/components/HomeBadge/HomeBadge.tsx:73
msgid "The curated link for academic researchers that collects your complete scholarly presence—publications, talks, affiliations, and social profiles."
msgstr "The curated link for academic researchers that collects your complete scholarly presence—publications, talks, affiliations, and social profiles."
-#: src/features/home/components/HomePage/HomePage.tsx:68
+#: src/features/home/components/HomePage/HomePage.tsx:78
msgid "The problem"
msgstr "The problem"
-#: src/features/home/components/HomePage/HomePage.tsx:69
+#: src/features/home/components/HomePage/HomePage.tsx:79
msgid "The visibility paradox"
msgstr "The visibility paradox"
@@ -1314,7 +1314,7 @@ msgstr "Update once, share everywhere. No more Sunday afternoons updating ten di
msgid "Updating your podcasts and videos…"
msgstr "Updating your podcasts and videos…"
-#: src/features/home/components/SignInPage/SignInPage.tsx:62
+#: src/features/home/components/SignInFace/SignInFace.tsx:35
msgid "Use your handle from Bluesky or any other AT Protocol app. New here? Create an account, and it’s yours to take anywhere."
msgstr "Use your handle from Bluesky or any other AT Protocol app. New here? Create an account, and it’s yours to take anywhere."
@@ -1393,7 +1393,7 @@ msgstr "We couldn't read your lanyard settings"
msgid "Web address"
msgstr "Web address"
-#: src/features/home/components/HomeBadge/HomeBadge.tsx:52
+#: src/features/home/components/HomeBadge/HomeBadge.tsx:70
msgid "Welcome to Lanyards"
msgstr "Welcome to Lanyards"
@@ -1406,7 +1406,7 @@ msgstr "What happened, and what did you expect? Steps to repeat it help."
msgid "What is this about?"
msgstr "What is this about?"
-#: src/features/home/components/HomePage/HomePage.tsx:81
+#: src/features/home/components/HomePage/HomePage.tsx:91
msgid "What you get"
msgstr "What you get"
@@ -1414,7 +1414,7 @@ msgstr "What you get"
msgid "What you share"
msgstr "What you share"
-#: src/features/home/components/HomePage/HomePage.tsx:101
+#: src/features/home/components/HomePage/HomePage.tsx:111
msgid "Why Lanyards"
msgstr "Why Lanyards"
diff --git a/web/src/routes/_home.tsx b/web/src/routes/_home.tsx
new file mode 100644
index 0000000..af576b5
--- /dev/null
+++ b/web/src/routes/_home.tsx
@@ -0,0 +1,23 @@
+import { createFileRoute, Outlet } from '@tanstack/react-router';
+
+import { LandingPage } from '@/features/auth/components/LandingPage/LandingPage';
+
+/**
+ * The homepage and the sign-in page are one page, its badge turned over to
+ * sign in (#175): they share this layout, so the badge stays mounted and
+ * turns between them.
+ */
+export const Route = createFileRoute('/_home')({
+ // It draws its own header, on the brand blue (#151, #157).
+ staticData: { ownHeader: true },
+ component: Home,
+});
+
+function Home() {
+ return (
+ <>
+
+
+ >
+ );
+}
diff --git a/web/src/routes/index.tsx b/web/src/routes/_home/index.tsx
similarity index 72%
rename from web/src/routes/index.tsx
rename to web/src/routes/_home/index.tsx
index 610011c..745e400 100644
--- a/web/src/routes/index.tsx
+++ b/web/src/routes/_home/index.tsx
@@ -1,11 +1,11 @@
import { createFileRoute, redirect } from '@tanstack/react-router';
-import { LandingPage } from '@/features/auth/components/LandingPage/LandingPage';
import { safeReturnTo } from '@/lib/atproto/oauthConfig';
type LandingSearch = { returnTo?: string };
-export const Route = createFileRoute('/')({
+/** `/`: the homepage, drawn by the _home layout (#175). */
+export const Route = createFileRoute('/_home/')({
// Always return the key: search params merge with the parent route's raw
// params, so omitting it would let an unvalidated value through.
validateSearch: (search: Record): LandingSearch => {
@@ -22,11 +22,4 @@ export const Route = createFileRoute('/')({
});
}
},
- // The homepage draws its own header, on the brand blue (#151).
- staticData: { ownHeader: true },
- component: Landing,
});
-
-function Landing() {
- return ;
-}
diff --git a/web/src/routes/sign-in.tsx b/web/src/routes/_home/sign-in.tsx
similarity index 57%
rename from web/src/routes/sign-in.tsx
rename to web/src/routes/_home/sign-in.tsx
index 578a813..8094c6a 100644
--- a/web/src/routes/sign-in.tsx
+++ b/web/src/routes/_home/sign-in.tsx
@@ -1,23 +1,18 @@
import { createFileRoute } from '@tanstack/react-router';
-import { SignInPage } from '@/features/home/components/SignInPage/SignInPage';
import { safeReturnTo } from '@/lib/atproto/oauthConfig';
type SignInSearch = { returnTo?: string };
-export const Route = createFileRoute('/sign-in')({
+/**
+ * `/sign-in` (#157): the homepage with its badge turned over to the form,
+ * drawn by the _home layout (#175).
+ */
+export const Route = createFileRoute('/_home/sign-in')({
// Always return the key: search params merge with the parent route's raw
// params, so omitting it would let an unvalidated value through.
validateSearch: (search: Record): SignInSearch => {
const returnTo = safeReturnTo(search.returnTo);
return { returnTo: returnTo === '/' ? undefined : returnTo };
},
- // The page draws its own header, on the brand blue (#157).
- staticData: { ownHeader: true },
- component: SignIn,
});
-
-function SignIn() {
- const { returnTo } = Route.useSearch();
- return ;
-}