import { useCurrentOrganisation } from '@documenso/lib/client-only/providers/organisation'; import { Trans } from '@lingui/react/macro'; import { motion, useReducedMotion } from 'framer-motion'; import { EASE, POP, SPRING } from './motion'; import { SettingsUpsellCard } from './settings-upsell-card'; import { useTimedCycle } from './use-timed-cycle'; const DEMO_BRANDS = [ { name: 'Documenso', letter: 'D', domain: 'noreply@app.documenso.com', accent: '#A2E771', ink: '#162C07', tint: '#F2FBEA', sheen: 'rgba(162, 231, 113, 0.32)', }, { name: 'Documenso', letter: 'D', domain: 'noreply@app.documenso.com', accent: '#387BC7', ink: '#ffffff', tint: '#EDF3FA', sheen: 'rgba(56, 123, 199, 0.28)', }, { name: 'Documenso', letter: 'D', domain: 'noreply@app.documenso.com', accent: '#9747F5', ink: '#ffffff', tint: '#F4EDFE', sheen: 'rgba(151, 71, 245, 0.26)', }, ]; /** * Milliseconds each brand is shown before cycling to the next. */ const BRAND_CYCLE_INTERVAL_MS = 2400; export const BrandingUpsell = () => { const organisation = useCurrentOrganisation(); const isReducedMotion = useReducedMotion(); const brandIndex = useTimedCycle(DEMO_BRANDS.map(() => BRAND_CYCLE_INTERVAL_MS)); const isStatic = isReducedMotion ?? false; const brand = DEMO_BRANDS[brandIndex]; return ( Teams} title={Unlock Branding Preferences} description={ Put your own brand on every document you send. Branding is available on the Teams plan and above. } features={[ Your logo on signing pages and emails, Company details and website in email footers, Separate branding per team, ]} preview={
Brand accent
{DEMO_BRANDS.map((dotBrand, index) => ( ))}
{/* The sender identity never changes — only the tile colours tween per brand. */} {brand.letter} {/* * Hardcoded inks (not theme tokens): this row sits on the * hardcoded light `tint` band, so it pairs with hardcoded ink * colours the same way the email sibling pairs its hardcoded * avatar surfaces (hardcoded surface => hardcoded ink). */}

{brand.name}

{brand.domain}

Please sign: Example.pdf

{organisation.name} has invited you to sign this document.

{/* Same replay split as the logo tile: colours tween on the persistent button, the pop replays per brand on the remounting label. */} Sign
Company details
{/* * Keyed remount replays the sweep per brand. No opacity envelope — * keyframe arrays are unreliable on strict-mode remounts; both * endpoints sit outside the overflow-hidden card, so the clip * provides the fade in/out instead. */}
} /> ); };