feat: standardize AppSwitcher and EcosystemFooter across all rApps

- Update AppSwitcher with all 26 r*Apps in 8 categories
- Add EcosystemFooter component with consistent ecosystem links
- Categories: Creating, Planning, Communicating, Deciding,
  Funding & Commerce, Social & Media, Work & Productivity,
  Identity & Infrastructure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-24 22:48:03 -08:00
parent 60afdba2a3
commit 09befffc35
3 changed files with 136 additions and 51 deletions

View File

@ -1,5 +1,6 @@
import Link from 'next/link' import Link from 'next/link'
import { AppSwitcher } from '@/components/AppSwitcher' import { AppSwitcher } from '@/components/AppSwitcher'
import { EcosystemFooter } from '@/components/EcosystemFooter'
export default function Home() { export default function Home() {
return ( return (
@ -184,32 +185,7 @@ export default function Home() {
</section> </section>
{/* Footer */} {/* Footer */}
<footer className="border-t border-slate-700/50 py-8"> <EcosystemFooter current="rTube" />
<div className="max-w-6xl mx-auto px-6">
<div className="flex flex-wrap items-center justify-center gap-4 text-sm text-slate-500 mb-4">
<span className="font-medium text-slate-400">r* Ecosystem</span>
<a href="https://rspace.online" className="hover:text-slate-300 transition-colors">rSpace</a>
<a href="https://rmaps.online" className="hover:text-slate-300 transition-colors">rMaps</a>
<a href="https://rnotes.online" className="hover:text-slate-300 transition-colors">rNotes</a>
<a href="https://rvote.online" className="hover:text-slate-300 transition-colors">rVote</a>
<a href="https://rfunds.online" className="hover:text-slate-300 transition-colors">rFunds</a>
<a href="https://rtrips.online" className="hover:text-slate-300 transition-colors">rTrips</a>
<a href="https://rcart.online" className="hover:text-slate-300 transition-colors">rCart</a>
<a href="https://rwallet.online" className="hover:text-slate-300 transition-colors">rWallet</a>
<a href="https://rfiles.online" className="hover:text-slate-300 transition-colors">rFiles</a>
<a href="https://rtube.online" className="hover:text-slate-300 transition-colors font-medium text-slate-300">rTube</a>
<a href="https://rcal.online" className="hover:text-slate-300 transition-colors">rCal</a>
<a href="https://rnetwork.online" className="hover:text-slate-300 transition-colors">rNetwork</a>
<a href="https://rinbox.online" className="hover:text-slate-300 transition-colors">rInbox</a>
<a href="https://rstack.online" className="hover:text-slate-300 transition-colors">rStack</a>
<a href="https://rauctions.online" className="hover:text-slate-300 transition-colors">rAuctions</a>
<a href="https://rpubs.online" className="hover:text-slate-300 transition-colors">rPubs</a>
</div>
<p className="text-center text-xs text-slate-600">
Part of the r* ecosystem collaborative tools for communities.
</p>
</div>
</footer>
</div> </div>
) )
} }

View File

@ -21,56 +21,91 @@ const MODULES: AppModule[] = [
{ id: 'cal', name: 'rCal', badge: 'rC', color: 'bg-sky-300', emoji: '📅', description: 'Collaborative scheduling & events', domain: 'rcal.online' }, { id: 'cal', name: 'rCal', badge: 'rC', color: 'bg-sky-300', emoji: '📅', description: 'Collaborative scheduling & events', domain: 'rcal.online' },
{ id: 'trips', name: 'rTrips', badge: 'rT', color: 'bg-emerald-300', emoji: '✈️', description: 'Group travel planning in real time', domain: 'rtrips.online' }, { id: 'trips', name: 'rTrips', badge: 'rT', color: 'bg-emerald-300', emoji: '✈️', description: 'Group travel planning in real time', domain: 'rtrips.online' },
{ id: 'maps', name: 'rMaps', badge: 'rM', color: 'bg-green-300', emoji: '🗺️', description: 'Collaborative real-time mapping', domain: 'rmaps.online' }, { id: 'maps', name: 'rMaps', badge: 'rM', color: 'bg-green-300', emoji: '🗺️', description: 'Collaborative real-time mapping', domain: 'rmaps.online' },
// Discussing & Deciding // Communicating
{ id: 'chats', name: 'rChats', badge: 'rCh', color: 'bg-emerald-200', emoji: '💬', description: 'Real-time encrypted messaging', domain: 'rchats.online' },
{ id: 'inbox', name: 'rInbox', badge: 'rI', color: 'bg-indigo-300', emoji: '📬', description: 'Private group messaging', domain: 'rinbox.online' }, { id: 'inbox', name: 'rInbox', badge: 'rI', color: 'bg-indigo-300', emoji: '📬', description: 'Private group messaging', domain: 'rinbox.online' },
{ id: 'choices', name: 'rChoices', badge: 'rCh', color: 'bg-fuchsia-300', emoji: '🔀', description: 'Collaborative decision making', domain: 'rchoices.online' }, { id: 'mail', name: 'rMail', badge: 'rMa', color: 'bg-blue-200', emoji: '✉️', description: 'Community email & newsletters', domain: 'rmail.online' },
{ id: 'forum', name: 'rForum', badge: 'rFo', color: 'bg-amber-200', emoji: '💭', description: 'Threaded community discussions', domain: 'rforum.online' },
// Deciding
{ id: 'choices', name: 'rChoices', badge: 'rCo', color: 'bg-fuchsia-300', emoji: '🔀', description: 'Collaborative decision making', domain: 'rchoices.online' },
{ id: 'vote', name: 'rVote', badge: 'rV', color: 'bg-violet-300', emoji: '🗳️', description: 'Real-time polls & governance', domain: 'rvote.online' }, { id: 'vote', name: 'rVote', badge: 'rV', color: 'bg-violet-300', emoji: '🗳️', description: 'Real-time polls & governance', domain: 'rvote.online' },
// Funding & Commerce // Funding & Commerce
{ id: 'funds', name: 'rFunds', badge: 'rF', color: 'bg-lime-300', emoji: '💸', description: 'Collaborative fundraising & grants', domain: 'rfunds.online' }, { id: 'funds', name: 'rFunds', badge: 'rF', color: 'bg-lime-300', emoji: '💸', description: 'Collaborative fundraising & grants', domain: 'rfunds.online' },
{ id: 'wallet', name: 'rWallet', badge: 'rW', color: 'bg-yellow-300', emoji: '💰', description: 'Multi-chain crypto wallet', domain: 'rwallet.online' }, { id: 'wallet', name: 'rWallet', badge: 'rW', color: 'bg-yellow-300', emoji: '💰', description: 'Multi-chain crypto wallet', domain: 'rwallet.online' },
{ id: 'cart', name: 'rCart', badge: 'rCt', color: 'bg-orange-300', emoji: '🛒', description: 'Group commerce & shared shopping', domain: 'rcart.online' }, { id: 'cart', name: 'rCart', badge: 'rCt', color: 'bg-orange-300', emoji: '🛒', description: 'Group commerce & shared shopping', domain: 'rcart.online' },
{ id: 'auctions', name: 'rAuctions', badge: 'rA', color: 'bg-red-300', emoji: '🔨', description: 'Live auction platform', domain: 'rauctions.online' }, { id: 'auctions', name: 'rAuctions', badge: 'rA', color: 'bg-red-300', emoji: '🔨', description: 'Live auction platform', domain: 'rauctions.online' },
// Social & Sharing { id: 'swag', name: 'rSwag', badge: 'rSw', color: 'bg-red-200', emoji: '👕', description: 'Community merch & swag store', domain: 'rswag.online' },
{ id: 'network', name: 'rNetwork', badge: 'rNe', color: 'bg-blue-300', emoji: '🌐', description: 'Community network & social graph', domain: 'rnetwork.online' }, // Social & Media
{ id: 'files', name: 'rFiles', badge: 'rFi', color: 'bg-cyan-300', emoji: '📁', description: 'Collaborative file storage', domain: 'rfiles.online' }, { id: 'photos', name: 'rPhotos', badge: 'rPh', color: 'bg-pink-200', emoji: '📸', description: 'Shared community photo albums', domain: 'rphotos.online' },
{ id: 'tube', name: 'rTube', badge: 'rTu', color: 'bg-pink-300', emoji: '🎬', description: 'Group video platform', domain: 'rtube.online' }, { id: 'tube', name: 'rTube', badge: 'rTu', color: 'bg-pink-300', emoji: '🎬', description: 'Group video platform', domain: 'rtube.online' },
{ id: 'network', name: 'rNetwork', badge: 'rNe', color: 'bg-blue-300', emoji: '🌐', description: 'Community network & social graph', domain: 'rnetwork.online' },
{ id: 'socials', name: 'rSocials', badge: 'rSo', color: 'bg-sky-200', emoji: '📢', description: 'Social media management', domain: 'rsocials.online' },
{ id: 'files', name: 'rFiles', badge: 'rFi', color: 'bg-cyan-300', emoji: '📁', description: 'Collaborative file storage', domain: 'rfiles.online' },
{ id: 'data', name: 'rData', badge: 'rD', color: 'bg-purple-300', emoji: '📊', description: 'Analytics & insights dashboard', domain: 'rdata.online' }, { id: 'data', name: 'rData', badge: 'rD', color: 'bg-purple-300', emoji: '📊', description: 'Analytics & insights dashboard', domain: 'rdata.online' },
// Work & Productivity
{ id: 'work', name: 'rWork', badge: 'rWo', color: 'bg-slate-300', emoji: '💼', description: 'Project & task management', domain: 'rwork.online' },
// Identity & Infrastructure
{ id: 'ids', name: 'rIDs', badge: 'rId', color: 'bg-emerald-300', emoji: '🔑', description: 'Passkey identity & zero-knowledge auth', domain: 'ridentity.online' },
{ id: 'stack', name: 'rStack', badge: 'r*', color: 'bg-gradient-to-br from-cyan-300 via-violet-300 to-rose-300', emoji: '📦', description: 'Open-source community infrastructure', domain: 'rstack.online' },
]; ];
const MODULE_CATEGORIES: Record<string, string> = { const MODULE_CATEGORIES: Record<string, string> = {
space: 'Creating', space: 'Creating',
notes: 'Creating', notes: 'Creating',
pubs: 'Creating', pubs: 'Creating',
cal: 'Planning', cal: 'Planning',
trips: 'Planning', trips: 'Planning',
inbox: 'Discussing & Deciding', maps: 'Planning',
choices: 'Discussing & Deciding', chats: 'Communicating',
vote: 'Discussing & Deciding', inbox: 'Communicating',
funds: 'Funding & Commerce', mail: 'Communicating',
wallet: 'Funding & Commerce', forum: 'Communicating',
cart: 'Funding & Commerce', choices: 'Deciding',
auctions:'Funding & Commerce', vote: 'Deciding',
maps: 'Planning', funds: 'Funding & Commerce',
network: 'Social & Sharing', wallet: 'Funding & Commerce',
files: 'Social & Sharing', cart: 'Funding & Commerce',
tube: 'Social & Sharing', auctions: 'Funding & Commerce',
data: 'Social & Sharing', swag: 'Funding & Commerce',
photos: 'Social & Media',
tube: 'Social & Media',
network: 'Social & Media',
socials: 'Social & Media',
files: 'Social & Media',
data: 'Social & Media',
work: 'Work & Productivity',
ids: 'Identity & Infrastructure',
stack: 'Identity & Infrastructure',
}; };
const CATEGORY_ORDER = [ const CATEGORY_ORDER = [
'Creating', 'Creating',
'Planning', 'Planning',
'Discussing & Deciding', 'Communicating',
'Deciding',
'Funding & Commerce', 'Funding & Commerce',
'Social & Sharing', 'Social & Media',
'Work & Productivity',
'Identity & Infrastructure',
]; ];
/** Build the URL for a module, using username subdomain if logged in */
function getModuleUrl(m: AppModule, username: string | null): string {
if (!m.domain) return '#';
if (username) {
// Generate <username>.<domain> URL
return `https://${username}.${m.domain}`;
}
return `https://${m.domain}`;
}
interface AppSwitcherProps { interface AppSwitcherProps {
current?: string; current?: string;
} }
export function AppSwitcher({ current = 'notes' }: AppSwitcherProps) { export function AppSwitcher({ current = 'notes' }: AppSwitcherProps) {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [username, setUsername] = useState<string | null>(null);
const ref = useRef<HTMLDivElement>(null); const ref = useRef<HTMLDivElement>(null);
useEffect(() => { useEffect(() => {
@ -83,6 +118,18 @@ export function AppSwitcher({ current = 'notes' }: AppSwitcherProps) {
return () => document.removeEventListener('click', handleClick); return () => document.removeEventListener('click', handleClick);
}, []); }, []);
// Fetch current user's username for subdomain links
useEffect(() => {
fetch('/api/me')
.then((r) => r.json())
.then((data) => {
if (data.authenticated && data.user?.username) {
setUsername(data.user.username);
}
})
.catch(() => { /* not logged in */ });
}, []);
const currentMod = MODULES.find((m) => m.id === current); const currentMod = MODULES.find((m) => m.id === current);
// Group modules by category // Group modules by category
@ -140,7 +187,7 @@ export function AppSwitcher({ current = 'notes' }: AppSwitcherProps) {
} transition-colors`} } transition-colors`}
> >
<a <a
href={m.domain ? `https://${m.domain}` : '#'} href={getModuleUrl(m, username)}
className="flex items-center gap-2.5 flex-1 px-3.5 py-2 text-slate-200 no-underline min-w-0" className="flex items-center gap-2.5 flex-1 px-3.5 py-2 text-slate-200 no-underline min-w-0"
onClick={() => setOpen(false)} onClick={() => setOpen(false)}
> >

View File

@ -0,0 +1,62 @@
'use client';
const FOOTER_LINKS = [
{ name: 'rSpace', href: 'https://rspace.online' },
{ name: 'rNotes', href: 'https://rnotes.online' },
{ name: 'rPubs', href: 'https://rpubs.online' },
{ name: 'rCal', href: 'https://rcal.online' },
{ name: 'rTrips', href: 'https://rtrips.online' },
{ name: 'rMaps', href: 'https://rmaps.online' },
{ name: 'rChats', href: 'https://rchats.online' },
{ name: 'rInbox', href: 'https://rinbox.online' },
{ name: 'rMail', href: 'https://rmail.online' },
{ name: 'rForum', href: 'https://rforum.online' },
{ name: 'rChoices', href: 'https://rchoices.online' },
{ name: 'rVote', href: 'https://rvote.online' },
{ name: 'rFunds', href: 'https://rfunds.online' },
{ name: 'rWallet', href: 'https://rwallet.online' },
{ name: 'rCart', href: 'https://rcart.online' },
{ name: 'rAuctions', href: 'https://rauctions.online' },
{ name: 'rSwag', href: 'https://rswag.online' },
{ name: 'rPhotos', href: 'https://rphotos.online' },
{ name: 'rTube', href: 'https://rtube.online' },
{ name: 'rNetwork', href: 'https://rnetwork.online' },
{ name: 'rSocials', href: 'https://rsocials.online' },
{ name: 'rFiles', href: 'https://rfiles.online' },
{ name: 'rData', href: 'https://rdata.online' },
{ name: 'rWork', href: 'https://rwork.online' },
{ name: 'rIDs', href: 'https://ridentity.online' },
{ name: 'rStack', href: 'https://rstack.online' },
];
interface EcosystemFooterProps {
current?: string;
}
export function EcosystemFooter({ current }: EcosystemFooterProps) {
return (
<footer className="border-t border-slate-800 py-8">
<div className="max-w-7xl mx-auto px-6">
<div className="flex flex-wrap items-center justify-center gap-x-4 gap-y-2 text-sm text-slate-500 mb-4">
<span className="font-medium text-slate-400">r* Ecosystem</span>
{FOOTER_LINKS.map((link) => (
<a
key={link.name}
href={link.href}
className={`hover:text-slate-300 transition-colors ${
current && link.name.toLowerCase() === current.toLowerCase()
? 'font-medium text-slate-300'
: ''
}`}
>
{link.name}
</a>
))}
</div>
<p className="text-center text-xs text-slate-600">
Part of the <a href="https://rstack.online" className="hover:text-slate-400 transition-colors">r* ecosystem</a> open source, self-hosted, community-owned
</p>
</div>
</footer>
);
}