32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { View, Text } from '@tarojs/components'
|
||
import { useRouter } from '@tarojs/taro'
|
||
import { Navbar } from '@/components/navbar'
|
||
import { AGREEMENT_TEXTS, type AgreementType } from './content'
|
||
import styles from './index.module.scss'
|
||
|
||
export default function AgreementPage() {
|
||
const router = useRouter()
|
||
const raw = router.params.type ?? 'user'
|
||
const type: AgreementType = raw === 'privacy' ? 'privacy' : 'user'
|
||
const doc = AGREEMENT_TEXTS[type]
|
||
|
||
return (
|
||
<View className={styles.page}>
|
||
<Navbar title={doc.title} />
|
||
<View className={styles.body}>
|
||
<Text className={styles.title}>{doc.title}</Text>
|
||
<Text className={styles.updated}>更新日期:{doc.updatedAt}</Text>
|
||
|
||
{doc.sections.map((s) => (
|
||
<View key={s.heading} className={styles.section}>
|
||
<Text className={styles.heading}>{s.heading}</Text>
|
||
{s.paragraphs.map((p, i) => (
|
||
<Text key={i} className={styles.paragraph}>{p}</Text>
|
||
))}
|
||
</View>
|
||
))}
|
||
</View>
|
||
</View>
|
||
)
|
||
}
|