Conversation
…TermsConsentSheet - Introduced TERMS_URLS constant for service, privacy, and marketing consent links - Updated ConsentRow to handle chevron press events for opening links in a web browser - Enhanced user experience by allowing direct access to terms and privacy policies
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR implements the ability to open terms and conditions documents in an in-app browser from the signup consent sheet. When users tap the chevron icon next to service terms, privacy policy, or marketing consent rows, the corresponding Notion page opens in a browser.
Changes:
- Added
TERMS_URLSconstant containing Notion URLs for service, privacy, and marketing consent documents - Integrated
expo-web-browserto open terms links in an in-app browser - Updated
ConsentRowcomponent to support chevron press events separate from checkbox toggle - Improved code formatting for better readability
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
apps/native/src/features/auth/login/components/TermsConsentSheet.tsx
Outdated
Show resolved
Hide resolved
| onChevronPress={() => WebBrowser.openBrowserAsync(TERMS_URLS.service)} | ||
| /> | ||
| <ConsentRow | ||
| checked={agreements.privacy} | ||
| onToggle={() => toggleAgreement('privacy')} | ||
| label='(필수) 개인정보 수집 및 이용 필수동의' | ||
| withChevron | ||
| onChevronPress={() => WebBrowser.openBrowserAsync(TERMS_URLS.privacy)} | ||
| /> | ||
| <ConsentRow | ||
| checked={agreements.marketing} | ||
| onToggle={() => toggleAgreement('marketing')} | ||
| label='(선택) 마케팅 정보 수신 동의' | ||
| withChevron | ||
| onChevronPress={() => WebBrowser.openBrowserAsync(TERMS_URLS.marketing)} |
There was a problem hiding this comment.
The WebBrowser.openBrowserAsync calls should include error handling. This API can fail for various reasons (network issues, browser not available, user cancellation, etc.) and currently there's no handling for these failures. Consider wrapping these calls in try-catch blocks or using .catch() to handle potential errors gracefully. This is important for production reliability as seen in other parts of the codebase where async operations are wrapped in try-catch blocks.
| onChevronPress={() => WebBrowser.openBrowserAsync(TERMS_URLS.service)} | |
| /> | |
| <ConsentRow | |
| checked={agreements.privacy} | |
| onToggle={() => toggleAgreement('privacy')} | |
| label='(필수) 개인정보 수집 및 이용 필수동의' | |
| withChevron | |
| onChevronPress={() => WebBrowser.openBrowserAsync(TERMS_URLS.privacy)} | |
| /> | |
| <ConsentRow | |
| checked={agreements.marketing} | |
| onToggle={() => toggleAgreement('marketing')} | |
| label='(선택) 마케팅 정보 수신 동의' | |
| withChevron | |
| onChevronPress={() => WebBrowser.openBrowserAsync(TERMS_URLS.marketing)} | |
| onChevronPress={() => { | |
| WebBrowser.openBrowserAsync(TERMS_URLS.service).catch(error => { | |
| console.error('Failed to open service terms URL:', error); | |
| }); | |
| }} | |
| /> | |
| <ConsentRow | |
| checked={agreements.privacy} | |
| onToggle={() => toggleAgreement('privacy')} | |
| label='(필수) 개인정보 수집 및 이용 필수동의' | |
| withChevron | |
| onChevronPress={() => { | |
| WebBrowser.openBrowserAsync(TERMS_URLS.privacy).catch(error => { | |
| console.error('Failed to open privacy terms URL:', error); | |
| }); | |
| }} | |
| /> | |
| <ConsentRow | |
| checked={agreements.marketing} | |
| onToggle={() => toggleAgreement('marketing')} | |
| label='(선택) 마케팅 정보 수신 동의' | |
| withChevron | |
| onChevronPress={() => { | |
| WebBrowser.openBrowserAsync(TERMS_URLS.marketing).catch(error => { | |
| console.error('Failed to open marketing terms URL:', error); | |
| }); | |
| }} |
| service: 'https://www.notion.so/2b4fa6e6a8fe80119c13d84d794a63a3?source=copy_link', | ||
| privacy: 'https://www.notion.so/2b4fa6e6a8fe8031ac2aef3009552575?source=copy_link', | ||
| marketing: 'https://www.notion.so/2b4fa6e6a8fe80359e8bf33c870967d9?source=copy_link', |
There was a problem hiding this comment.
Consider moving the terms URLs to environment variables or a centralized configuration file. The app.config.ts file shows a pattern of using environment variables for URLs and configuration values (lines 134-145). Hardcoding Notion URLs directly in the component makes them harder to update across environments or when terms pages change. This would improve maintainability by centralizing configuration values.
| service: 'https://www.notion.so/2b4fa6e6a8fe80119c13d84d794a63a3?source=copy_link', | |
| privacy: 'https://www.notion.so/2b4fa6e6a8fe8031ac2aef3009552575?source=copy_link', | |
| marketing: 'https://www.notion.so/2b4fa6e6a8fe80359e8bf33c870967d9?source=copy_link', | |
| service: | |
| process.env.EXPO_PUBLIC_TERMS_URL_SERVICE ?? | |
| 'https://www.notion.so/2b4fa6e6a8fe80119c13d84d794a63a3?source=copy_link', | |
| privacy: | |
| process.env.EXPO_PUBLIC_TERMS_URL_PRIVACY ?? | |
| 'https://www.notion.so/2b4fa6e6a8fe8031ac2aef3009552575?source=copy_link', | |
| marketing: | |
| process.env.EXPO_PUBLIC_TERMS_URL_MARKETING ?? | |
| 'https://www.notion.so/2b4fa6e6a8fe80359e8bf33c870967d9?source=copy_link', |
| </View> | ||
| {withChevron ? <ChevronRightIcon size={18} color={colors['gray-600']} /> : null} | ||
| {withChevron ? ( | ||
| <Pressable onPress={onChevronPress} hitSlop={8}> |
There was a problem hiding this comment.
The chevron Pressable should include accessibility attributes to improve screen reader support. Consider adding accessibilityRole='button' and accessibilityLabel (e.g., '약관 보기' or '서비스 이용약관 보기') to indicate to screen reader users that this element opens the terms document. This follows accessibility best practices and improves the experience for users with disabilities.
| <Pressable onPress={onChevronPress} hitSlop={8}> | |
| <Pressable | |
| onPress={onChevronPress} | |
| hitSlop={8} | |
| accessibilityRole='button' | |
| accessibilityLabel='약관 보기'> |
…et.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
📌 Related Issue Number
✅ Key Changes
TermsConsentSheet의 chevron touch event에 인 앱 브라우저 약관 링크 추가