Move support into React Router

This commit is contained in:
rosetta
2026-07-30 16:47:54 -07:00
parent c81c3a1189
commit 650d73830f
11 changed files with 378 additions and 838 deletions

View File

@@ -10,6 +10,7 @@ import './style.css'
import { MessageSteps } from './components/MessageSteps/MessageSteps';
import { Footer } from './components/Footer/Footer';
import { PrivacyPage } from './pages/PrivacyPage';
import { SupportPage } from './pages/SupportPage';
import { TermsPage } from './pages/TermsPage';
import { ScrollToTop } from './components/ScrollToTop/ScrollToTop';
@@ -32,6 +33,7 @@ export default function App() {
<ScrollToTop />
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/support" element={<SupportPage />} />
<Route path="/privacy" element={<PrivacyPage />} />
<Route path="/terms" element={<TermsPage />} />
</Routes>

View File

@@ -13,7 +13,7 @@ export function Footer() {
&copy; {currentYear} {LEGAL_NAME}. All rights reserved.
</Text>
<nav className={classes.links} aria-label="Legal information">
<Anchor href="/support/" size="sm" c="dimmed">
<Anchor component={Link} to="/support" size="sm" c="dimmed">
Support
</Anchor>
<Anchor component={Link} to="/privacy" size="sm" c="dimmed">

View File

@@ -13,12 +13,13 @@ import { Link } from 'react-router-dom';
import { RosettaLogo } from '../RosettaLogo/RosettaLogo';
import classes from './LegalPage.module.css';
type LegalRoute = 'privacy' | 'terms';
type ContentRoute = 'support' | 'privacy' | 'terms';
interface LegalPageProps {
active: LegalRoute;
active: ContentRoute;
title: string;
updated: string;
updated?: string;
eyebrow?: string;
children: ReactNode;
}
@@ -27,7 +28,19 @@ interface LegalSectionProps {
children: ReactNode;
}
export function LegalPage({ active, title, updated, children }: LegalPageProps) {
const NAV_LINKS = [
{ route: 'support', label: 'Support' },
{ route: 'privacy', label: 'Privacy' },
{ route: 'terms', label: 'Terms' },
] as const;
export function LegalPage({
active,
title,
updated,
eyebrow = 'Rosetta Legal',
children,
}: LegalPageProps) {
const currentYear = new Date().getFullYear();
return (
@@ -38,7 +51,7 @@ export function LegalPage({ active, title, updated, children }: LegalPageProps)
component={Link}
to="/"
className={classes.brand}
aria-label="Rosetta home"
aria-label="Rosetta"
>
<RosettaLogo size={34} />
<Text component="span" fw={700} fz="lg">
@@ -46,44 +59,36 @@ export function LegalPage({ active, title, updated, children }: LegalPageProps)
</Text>
</Anchor>
<Group component="nav" gap="lg" aria-label="Legal pages">
<Anchor href="/support/" c="dimmed" size="sm">
Support
</Anchor>
<Anchor
component={Link}
to="/privacy"
c={active === 'privacy' ? 'blue' : 'dimmed'}
fw={active === 'privacy' ? 600 : 400}
size="sm"
aria-current={active === 'privacy' ? 'page' : undefined}
>
Privacy
</Anchor>
<Anchor
component={Link}
to="/terms"
c={active === 'terms' ? 'blue' : 'dimmed'}
fw={active === 'terms' ? 600 : 400}
size="sm"
aria-current={active === 'terms' ? 'page' : undefined}
>
Terms
</Anchor>
<Group component="nav" gap="lg" aria-label="Rosetta pages">
{NAV_LINKS.map(({ route, label }) => (
<Anchor
key={route}
component={Link}
to={`/${route}`}
c={active === route ? 'blue' : 'dimmed'}
fw={active === route ? 600 : 400}
size="sm"
aria-current={active === route ? 'page' : undefined}
>
{label}
</Anchor>
))}
</Group>
</Group>
<Box component="main" className={classes.main}>
<Box className={classes.intro}>
<Text tt="uppercase" fw={700} fz="xs" c="blue" lts="0.08em">
Rosetta legal
{eyebrow}
</Text>
<Title order={1} className={classes.title}>
{title}
</Title>
<Text c="dimmed" mt="md">
Last updated: {updated}
</Text>
{updated && (
<Text c="dimmed" mt="md">
Last updated: {updated}
</Text>
)}
</Box>
<Paper
@@ -103,18 +108,16 @@ export function LegalPage({ active, title, updated, children }: LegalPageProps)
</Text>
<Group component="nav" gap="md" aria-label="Footer links">
<Anchor component={Link} to="/" c="dimmed" size="xs">
Rosetta home
Rosetta
</Anchor>
<Anchor href="/support/" c="dimmed" size="xs">
<Anchor component={Link} to="/support" c="dimmed" size="xs">
Support
</Anchor>
<Anchor
component={Link}
to={active === 'privacy' ? '/terms' : '/privacy'}
c="dimmed"
size="xs"
>
{active === 'privacy' ? 'Terms of Use' : 'Privacy Policy'}
<Anchor component={Link} to="/privacy" c="dimmed" size="xs">
Privacy Policy
</Anchor>
<Anchor component={Link} to="/terms" c="dimmed" size="xs">
Terms of Use
</Anchor>
</Group>
</Group>

View File

@@ -3,7 +3,6 @@ import { useEffect } from 'react';
interface SEOProps {
title?: string;
description?: string;
ogImage?: string;
keywords?: string;
canonical?: string;
}
@@ -11,7 +10,6 @@ interface SEOProps {
export function SEO({
title = 'Rosetta - Secure Messaging for Everyone',
description = 'End-to-end encrypted messaging app with military-grade security. Download for Windows, Linux, and Android.',
ogImage = '/og.png',
keywords = 'secure messaging, encrypted chat, private messenger',
canonical = 'https://rosetta.im/'
}: SEOProps) {
@@ -22,14 +20,14 @@ export function SEO({
updateMetaTag('name', 'keywords', keywords);
updateMetaTag('property', 'og:title', title);
updateMetaTag('property', 'og:description', description);
updateMetaTag('property', 'og:image', ogImage);
updateMetaTag('property', 'og:url', canonical);
updateMetaTag('name', 'twitter:title', title);
updateMetaTag('name', 'twitter:description', description);
updateMetaTag('name', 'twitter:image', ogImage);
updateMetaTag('name', 'twitter:url', canonical);
removeMetaTag('property', 'og:image');
removeMetaTag('name', 'twitter:image');
updateCanonical(canonical);
}, [title, description, ogImage, keywords, canonical]);
}, [title, description, keywords, canonical]);
return null;
}
@@ -46,6 +44,10 @@ function updateMetaTag(attr: string, name: string, content: string) {
element.setAttribute('content', content);
}
function removeMetaTag(attr: string, name: string) {
document.querySelector(`meta[${attr}="${name}"]`)?.remove();
}
function updateCanonical(href: string) {
let element = document.querySelector<HTMLLinkElement>('link[rel="canonical"]');

View File

@@ -1,4 +1,5 @@
import { Anchor, List } from '@mantine/core';
import { Link } from 'react-router-dom';
import {
LegalAddress,
LegalList,
@@ -118,7 +119,7 @@ export function PrivacyPage() {
Depending on where you live, you may have rights to access, correct, delete,
or object to certain processing of your personal information. To make a
request, contact us at{' '}
<Anchor href="mailto:admin@rosetta.im">admin@rosetta.im</Anchor>.
<Anchor href="mailto:admin@rosetta.im">Admin@rosetta.im</Anchor>.
</LegalText>
<LegalText>
Because Rosetta minimizes account data and uses cryptographic identifiers,
@@ -165,9 +166,12 @@ export function PrivacyPage() {
{'ROSETTA CLOUD SERVICES LIMITED\nRegistered address:\nUNIT 704C 7/F BLK 3 NAN FUNG IND CITY\n18 TIN HAU RD\nTUEN MUN\nHONG KONG'}
</LegalAddress>
<LegalText>
Email: <Anchor href="mailto:admin@rosetta.im">admin@rosetta.im</Anchor>
Email: <Anchor href="mailto:admin@rosetta.im">Admin@rosetta.im</Anchor>
<br />
Support: <Anchor href="/support/">https://rosetta.im/support/</Anchor>
Support:{' '}
<Anchor component={Link} to="/support">
Rosetta Support
</Anchor>
</LegalText>
<LegalText>
Phone: <Anchor href="tel:+85228910030">+852 2891 0030</Anchor>

View File

@@ -0,0 +1,58 @@
.lead {
max-width: 680px;
color: light-dark(var(--mantine-color-gray-8), var(--mantine-color-dark-0));
font-size: var(--mantine-font-size-lg);
line-height: 1.65;
}
.topic {
color: inherit;
text-decoration: none;
transition:
transform 160ms ease,
border-color 160ms ease,
box-shadow 160ms ease;
}
.topic:hover {
transform: translateY(-2px);
border-color: light-dark(var(--mantine-color-blue-3), var(--mantine-color-blue-7));
box-shadow: var(--mantine-shadow-md);
}
.section {
scroll-margin-top: var(--mantine-spacing-xl);
padding-top: var(--mantine-spacing-xl);
border-top: 1px solid light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-5));
}
.sectionTitle,
.contactTitle {
color: light-dark(var(--mantine-color-dark-9), var(--mantine-color-white));
font-family: Outfit, var(--mantine-font-family);
font-weight: 500;
}
.sectionTitle {
font-size: clamp(24px, 3vw, 30px);
}
.contact {
border: 1px solid light-dark(var(--mantine-color-blue-2), var(--mantine-color-blue-9));
background: light-dark(var(--mantine-color-blue-0), var(--mantine-color-dark-6));
}
.contactTitle {
font-size: 26px;
}
.contactCopy {
max-width: 540px;
}
@media (max-width: 48em) {
.contact :global(.mantine-Group-root) {
align-items: flex-start;
flex-direction: column;
}
}

251
src/pages/SupportPage.tsx Normal file
View File

@@ -0,0 +1,251 @@
import {
Accordion,
Anchor,
Button,
Card,
Group,
Paper,
SimpleGrid,
Stack,
Text,
ThemeIcon,
Title,
} from '@mantine/core';
import {
IconKey,
IconMail,
IconMessageCircle,
IconShieldLock,
type TablerIcon,
} from '@tabler/icons-react';
import type { ReactNode } from 'react';
import { LegalPage } from '../components/LegalPage/LegalPage';
import { SEO } from '../components/SEO/SEO';
import classes from './SupportPage.module.css';
const TOPICS: Array<{
href: string;
icon: TablerIcon;
title: string;
description: string;
}> = [
{
href: '#account',
icon: IconKey,
title: 'Account and access',
description: 'Recovery phrases, device access, and account security.',
},
{
href: '#messaging',
icon: IconMessageCircle,
title: 'Messaging and media',
description: 'Messages, photos, videos, files, voice messages, and groups.',
},
{
href: '#privacy',
icon: IconShieldLock,
title: 'Privacy and safety',
description: 'Security questions, privacy information, and abuse reports.',
},
];
const ACCOUNT_FAQS = [
{
question: 'How do I access my account on a new device?',
answer:
'Install Rosetta and enter your recovery phrase in the exact order it was created. Rosetta may ask you to confirm a new device to protect your account.',
},
{
question: 'I lost my recovery phrase. Can it be restored?',
answer:
'No. Your recovery phrase is the key to your account. Rosetta cannot recover it for you, so keep it private and backed up before you need it.',
},
{
question: 'Why am I asked to confirm a new device?',
answer:
'New-device confirmation helps prevent someone who has obtained a recovery phrase from silently accessing your account on another device.',
},
{
question: 'How do I report an account-access problem?',
answer:
'Email us with the device model, Rosetta version, and a short description of what happened. Do not include your recovery phrase or private keys.',
},
];
const MESSAGING_FAQS = [
{
question: 'How do I send a photo, video, or file?',
answer:
'Open a chat, tap the attachment button next to the message field, choose the item you want to share, then send it. Allow Photos or Files access when iOS asks for it.',
},
{
question: 'Why is an attachment still sending?',
answer:
'Media uploads depend on the file size and your connection. Keep Rosetta open and connected until the send indicator completes. You can retry a message that failed.',
},
{
question: 'How do I send a voice message?',
answer:
'In a chat, press and hold the microphone control to record, then release it to send. Microphone permission is required the first time you record.',
},
{
question: 'How do I get help with a group?',
answer:
'Contact us with the group name and a description of the issue. Do not send private recovery phrases, message contents, or encryption keys.',
},
];
const PRIVACY_FAQS = [
{
question: 'How is message content protected?',
answer:
'Rosetta is designed to encrypt message content before it is sent. For details about how we handle data, read the Rosetta Privacy Policy.',
},
{
question: 'How do I report abuse or a security issue?',
answer: (
<>
Email{' '}
<Anchor href="mailto:admin@rosetta.im?subject=Rosetta%20Security%20Report">
Admin@rosetta.im
</Anchor>{' '}
with a description of the concern. Do not include recovery phrases or private
keys.
</>
),
},
];
interface SupportSectionProps {
id: string;
title: string;
description: string;
items: Array<{ question: string; answer: ReactNode }>;
}
function SupportSection({ id, title, description, items }: SupportSectionProps) {
return (
<Stack component="section" id={id} gap="lg" className={classes.section}>
<div>
<Title order={2} className={classes.sectionTitle}>
{title}
</Title>
<Text c="dimmed" mt="xs" lh={1.65}>
{description}
</Text>
</div>
<Accordion multiple variant="separated" radius="md">
{items.map(({ question, answer }) => (
<Accordion.Item key={question} value={question}>
<Accordion.Control>{question}</Accordion.Control>
<Accordion.Panel>
<Text c="dimmed" size="sm" lh={1.65}>
{answer}
</Text>
</Accordion.Panel>
</Accordion.Item>
))}
</Accordion>
</Stack>
);
}
export function SupportPage() {
return (
<>
<SEO
title="Rosetta Support"
description="Contact Rosetta Support for help with account access, recovery phrases, messaging, media, privacy, and security."
canonical="https://rosetta.im/support/"
keywords="Rosetta support, account recovery, messaging help, privacy help"
/>
<LegalPage
active="support"
eyebrow="Rosetta Support"
title="Help with your Rosetta account and messages."
>
<Stack gap="xl">
<div>
<Text className={classes.lead}>
Find answers about account access, recovery phrases, private messaging,
shared media, and privacy. For anything else, contact our support team.
</Text>
<Button
component="a"
href="mailto:admin@rosetta.im?subject=Rosetta%20Support%20Request"
leftSection={<IconMail size={18} />}
mt="xl"
size="md"
>
Email Rosetta Support
</Button>
</div>
<SimpleGrid cols={{ base: 1, sm: 3 }} spacing="md">
{TOPICS.map(({ href, icon: Icon, title, description }) => (
<Card
key={href}
component="a"
href={href}
withBorder
radius="md"
padding="lg"
className={classes.topic}
>
<ThemeIcon variant="light" radius="xl" size="lg">
<Icon size={18} />
</ThemeIcon>
<Text fw={600} mt="md">
{title}
</Text>
<Text c="dimmed" size="sm" mt={6} lh={1.5}>
{description}
</Text>
</Card>
))}
</SimpleGrid>
<SupportSection
id="account"
title="Account and access"
description="Rosetta accounts are accessed with a recovery phrase instead of a phone number. Keep your phrase private and stored somewhere safe."
items={ACCOUNT_FAQS}
/>
<SupportSection
id="messaging"
title="Messaging and media"
description="Rosetta supports private chats, groups, photos, videos, files, and voice messages. Attachment choices can vary depending on your device permissions and the selected item."
items={MESSAGING_FAQS}
/>
<SupportSection
id="privacy"
title="Privacy and safety"
description="Rosetta is designed for private communication. If you have a security concern or a question about data handling, contact us directly."
items={PRIVACY_FAQS}
/>
<Paper radius="lg" p="xl" className={classes.contact}>
<Group justify="space-between" align="center">
<div>
<Title order={2} className={classes.contactTitle}>
Need more help?
</Title>
<Text c="dimmed" mt="xs" className={classes.contactCopy}>
Send us your device model, app version, and a short explanation.
Never send a recovery phrase, private key, or private message
content.
</Text>
</div>
<Anchor
href="mailto:admin@rosetta.im?subject=Rosetta%20Support%20Request"
fw={700}
>
Admin@rosetta.im
</Anchor>
</Group>
</Paper>
</Stack>
</LegalPage>
</>
);
}

View File

@@ -55,7 +55,7 @@ export function TermsPage() {
<LegalText>
Your use of Rosetta is also governed by our Privacy Policy, available at{' '}
<Anchor component={Link} to="/privacy">
https://rosetta.im/privacy/
Privacy Policy
</Anchor>
.
</LegalText>
@@ -130,10 +130,12 @@ export function TermsPage() {
</LegalText>
<LegalText>
Support contact:{' '}
<Anchor href="mailto:admin@rosetta.im">admin@rosetta.im</Anchor>
<Anchor href="mailto:admin@rosetta.im">Admin@rosetta.im</Anchor>
<br />
Support centre:{' '}
<Anchor href="/support/">https://rosetta.im/support/</Anchor>
<Anchor component={Link} to="/support">
Rosetta Support
</Anchor>
</LegalText>
</LegalSection>
@@ -210,7 +212,7 @@ export function TermsPage() {
{'ROSETTA CLOUD SERVICES LIMITED\nRegistered address:\nUNIT 704C 7/F BLK 3 NAN FUNG IND CITY\n18 TIN HAU RD\nTUEN MUN\nHONG KONG'}
</LegalAddress>
<LegalText>
Email: <Anchor href="mailto:admin@rosetta.im">admin@rosetta.im</Anchor>
Email: <Anchor href="mailto:admin@rosetta.im">Admin@rosetta.im</Anchor>
</LegalText>
<LegalText>
Phone: <Anchor href="tel:+85228910030">+852 2891 0030</Anchor>