Jotley / website / src / app / components / TestFlightButton.tsx
| 1 | 'use client'; |
| 2 | |
| 3 | import { IOS_TESTFLIGHT_URL } from '@/lib/links'; |
| 4 | import { sendGAEvent } from '@/app/utils/analytics'; |
| 5 | |
| 6 | const APPLE_PATH = 'M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'; |
| 7 | |
| 8 | export function AppleGlyph({ size = 17 }: { size?: number }) { |
| 9 | return ( |
| 10 | <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"> |
| 11 | <path d={APPLE_PATH} /> |
| 12 | </svg> |
| 13 | ); |
| 14 | } |
| 15 | |
| 16 | /** The iPhone and iPad beta: Jotley ships through TestFlight, not the App Store. */ |
| 17 | export default function TestFlightButton({ location }: { location: string }) { |
| 18 | return ( |
| 19 | <div className="testflight-cta"> |
| 20 | <a |
| 21 | href={IOS_TESTFLIGHT_URL} |
| 22 | target="_blank" |
| 23 | rel="noopener noreferrer" |
| 24 | className="mac-download-btn testflight-btn" |
| 25 | onClick={() => sendGAEvent('download_click_ios', { location })} |
| 26 | > |
| 27 | <AppleGlyph size={20} /> |
| 28 | Join the TestFlight beta |
| 29 | <span aria-hidden="true">↗</span> |
| 30 | </a> |
| 31 | <p className="testflight-note">iPhone and iPad companion beta. Pairs with the Mac app.</p> |
| 32 | </div> |
| 33 | ); |
| 34 | } |
| 35 | |
| 36 | /** Compact header link shown on phone-sized screens in place of Download for Mac. */ |
| 37 | export function TestFlightNavLink() { |
| 38 | return ( |
| 39 | <a |
| 40 | href={IOS_TESTFLIGHT_URL} |
| 41 | target="_blank" |
| 42 | rel="noopener noreferrer" |
| 43 | className="nav-get nav-testflight" |
| 44 | aria-label="Join the TestFlight beta for iPhone and iPad" |
| 45 | onClick={() => sendGAEvent('download_click_ios', { location: 'nav' })} |
| 46 | > |
| 47 | <AppleGlyph size={15} /> |
| 48 | TestFlight beta |
| 49 | </a> |
| 50 | ); |
| 51 | } |