import React, { useState } from 'react'; import { IcCheck, IcNavBack } from '../res/icons'; import { useSpotifyGestures } from '../hooks/useSpotifyGestures'; import { useSpotifyStrings } from '../hooks/useSpotifyStrings'; import { useSpotifyStore } from '../state'; const Checkbox = ({ label, checked, onChange, isLink, }: { label: string; checked: boolean; onChange: () => void; isLink?: boolean; }) => (
{isLink ? (
{label}
) : (
{label}
)}
{checked && }
); export const CreateNamePage: React.FC = () => { const { bindBack, bindTap } = useSpotifyGestures(); const s = useSpotifyStrings(); const addAccount = useSpotifyStore((state) => state.addAccount); const [name, setName] = useState(''); const [termsAccepted, setTermsAccepted] = useState(false); const [marketingOptOut, setMarketingOptOut] = useState(false); const [shareData, setShareData] = useState(false); const isValid = name.length > 0 && termsAccepted; return (

{s.create_account_title}

{s.create_name_title}

setName(e.target.value)} className="w-full h-12 bg-[#2A2A2A] text-white font-bold px-4 rounded border-0 outline-none focus:bg-[#333333] transition-colors caret-[#1ED760]" autoFocus />
{s.create_name_profile_hint}
{s.create_name_required}
{s.create_name_personalized}
setTermsAccepted(!termsAccepted)} />
{s.create_name_terms}
{s.create_name_privacy_notice}
{s.create_name_privacy_policy}
setMarketingOptOut(!marketingOptOut)} /> setShareData(!shareData)} />
); };