Skip to content

Commit 42d8d6f

Browse files
Replace local footer with universal footer (#356)
Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
1 parent f60330b commit 42d8d6f

2 files changed

Lines changed: 5 additions & 22 deletions

File tree

‎src/app/layout.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ export default function RootLayout({ children }) {
161161
{ label: 'Privacy', href: '/privacy' },
162162
{ label: 'Terms', href: '/terms' },
163163
{ label: 'GitHub', href: 'https://github.com/profullstack/qryptchat-web' },
164+
...(process.env.NEXT_PUBLIC_ONION_URL && !new URL(SITE_URL).hostname.endsWith('.onion')
165+
? [{ label: 'Also on Tor', href: process.env.NEXT_PUBLIC_ONION_URL }]
166+
: []),
164167
]}
165168
/>
166169
}

‎src/lib/components/Footer.jsx‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
'use client';
22

3-
// One footer row: links, copyright and the Profullstack ring come from
4-
// @profullstack/footer, server-rendered in app/layout.jsx and passed in as
5-
// `bottom`. The Tor mirror link sits just above it when configured.
3+
// The shared Profullstack footer is passed in by app/layout.jsx.
64
export default function Footer({ bottom }) {
7-
const onionUrl = process.env.NEXT_PUBLIC_ONION_URL;
8-
const isOnionSite = typeof window !== 'undefined' && window.location.hostname.endsWith('.onion');
9-
10-
return (
11-
<footer className="footer">
12-
{!isOnionSite && onionUrl && (
13-
<p className="footer-onion">
14-
🧅 Also on Tor: <a href={onionUrl} target="_blank" rel="noopener noreferrer">{onionUrl}</a>
15-
</p>
16-
)}
17-
{bottom}
18-
19-
<style>{`
20-
.footer { background: var(--color-bg-secondary); border-top: 1px solid var(--color-border-primary); color: var(--color-text-secondary); }
21-
.footer-onion { margin: 0; padding-top: var(--space-4); text-align: center; font-size: 0.75rem; word-break: break-all; }
22-
.footer-onion a { color: var(--color-brand-primary); }
23-
`}</style>
24-
</footer>
25-
);
5+
return bottom;
266
}

0 commit comments

Comments
 (0)