Add tos, community guidelines, and copyright policy (#410)
* Add tos, community guidelines, and copyright policy * Fix lint
This commit is contained in:
parent
a74919ef33
commit
2f519bd66e
11 changed files with 1167 additions and 8 deletions
|
@ -3,6 +3,7 @@ import {StyleSheet, View} from 'react-native'
|
|||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {Text} from './text/Text'
|
||||
import {TextLink} from './Link'
|
||||
import {isDesktopWeb} from 'platform/detection'
|
||||
|
||||
/**
|
||||
* These utilities are used to define long documents in an html-like
|
||||
|
@ -54,12 +55,26 @@ export function P({children}: React.PropsWithChildren<{}>) {
|
|||
)
|
||||
}
|
||||
|
||||
export function UL({children}: React.PropsWithChildren<{}>) {
|
||||
return <View style={styles.ul}>{children}</View>
|
||||
export function UL({
|
||||
children,
|
||||
isChild,
|
||||
}: React.PropsWithChildren<{isChild: boolean}>) {
|
||||
return (
|
||||
<View style={[styles.ul, isChild && styles.ulChild]}>
|
||||
{markChildProps(children)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
export function OL({children}: React.PropsWithChildren<{}>) {
|
||||
return <View style={styles.ol}>{children}</View>
|
||||
export function OL({
|
||||
children,
|
||||
isChild,
|
||||
}: React.PropsWithChildren<{isChild: boolean}>) {
|
||||
return (
|
||||
<View style={[styles.ol, isChild && styles.olChild]}>
|
||||
{markChildProps(children)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
export function LI({
|
||||
|
@ -71,7 +86,7 @@ export function LI({
|
|||
<View style={styles.li}>
|
||||
<Text style={[pal.text, styles.liBullet]}>{value || <>•</>}</Text>
|
||||
<Text type="md" style={[pal.text, styles.liText]}>
|
||||
{children}
|
||||
{markChildProps(children)}
|
||||
</Text>
|
||||
</View>
|
||||
)
|
||||
|
@ -89,6 +104,33 @@ export function A({children, href}: React.PropsWithChildren<{href: string}>) {
|
|||
)
|
||||
}
|
||||
|
||||
export function STRONG({children}: React.PropsWithChildren<{}>) {
|
||||
const pal = usePalette('default')
|
||||
return (
|
||||
<Text type="md-medium" style={[pal.text]}>
|
||||
{children}
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
|
||||
export function EM({children}: React.PropsWithChildren<{}>) {
|
||||
const pal = usePalette('default')
|
||||
return (
|
||||
<Text type="md" style={[pal.text, styles.em]}>
|
||||
{children}
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
|
||||
function markChildProps(children) {
|
||||
return React.Children.map(children, child => {
|
||||
if (React.isValidElement(child)) {
|
||||
return React.cloneElement(child, {isChild: true})
|
||||
}
|
||||
return child
|
||||
})
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
h1: {
|
||||
marginTop: 20,
|
||||
|
@ -112,15 +154,23 @@ const styles = StyleSheet.create({
|
|||
},
|
||||
ul: {
|
||||
marginBottom: 10,
|
||||
paddingLeft: 18,
|
||||
paddingLeft: isDesktopWeb ? 18 : 4,
|
||||
},
|
||||
ulChild: {
|
||||
paddingTop: 10,
|
||||
marginBottom: 0,
|
||||
},
|
||||
ol: {
|
||||
marginBottom: 10,
|
||||
paddingLeft: 18,
|
||||
paddingLeft: isDesktopWeb ? 18 : 4,
|
||||
},
|
||||
olChild: {
|
||||
paddingTop: 10,
|
||||
marginBottom: 0,
|
||||
},
|
||||
li: {
|
||||
flexDirection: 'row',
|
||||
paddingRight: 10,
|
||||
paddingRight: 20,
|
||||
marginBottom: 10,
|
||||
},
|
||||
liBullet: {
|
||||
|
@ -130,4 +180,7 @@ const styles = StyleSheet.create({
|
|||
a: {
|
||||
marginBottom: 10,
|
||||
},
|
||||
em: {
|
||||
fontStyle: 'italic',
|
||||
},
|
||||
})
|
||||
|
|
41
src/view/screens/CommunityGuidelines.tsx
Normal file
41
src/view/screens/CommunityGuidelines.tsx
Normal file
|
@ -0,0 +1,41 @@
|
|||
import React from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {useFocusEffect} from '@react-navigation/native'
|
||||
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
|
||||
import {ViewHeader} from '../com/util/ViewHeader'
|
||||
import {useStores} from 'state/index'
|
||||
import {ScrollView} from 'view/com/util/Views'
|
||||
import {Text} from 'view/com/util/text/Text'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {s} from 'lib/styles'
|
||||
import Html from '../../locale/en/community-guidelines'
|
||||
|
||||
type Props = NativeStackScreenProps<
|
||||
CommonNavigatorParams,
|
||||
'CommunityGuidelines'
|
||||
>
|
||||
export const CommunityGuidelinesScreen = (_props: Props) => {
|
||||
const pal = usePalette('default')
|
||||
const store = useStores()
|
||||
|
||||
useFocusEffect(
|
||||
React.useCallback(() => {
|
||||
store.shell.setMinimalShellMode(false)
|
||||
}, [store]),
|
||||
)
|
||||
|
||||
return (
|
||||
<View>
|
||||
<ViewHeader title="Community Guidelines" />
|
||||
<ScrollView style={[s.hContentRegion, pal.view]}>
|
||||
<View style={[s.p20]}>
|
||||
<Text type="title-xl" style={[pal.text, s.bold, s.pb20]}>
|
||||
Community Guidelines
|
||||
</Text>
|
||||
<Html />
|
||||
</View>
|
||||
<View style={s.footerSpacer} />
|
||||
</ScrollView>
|
||||
</View>
|
||||
)
|
||||
}
|
38
src/view/screens/CopyrightPolicy.tsx
Normal file
38
src/view/screens/CopyrightPolicy.tsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
import React from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {useFocusEffect} from '@react-navigation/native'
|
||||
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
|
||||
import {ViewHeader} from '../com/util/ViewHeader'
|
||||
import {useStores} from 'state/index'
|
||||
import {ScrollView} from 'view/com/util/Views'
|
||||
import {Text} from 'view/com/util/text/Text'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {s} from 'lib/styles'
|
||||
import Html from '../../locale/en/copyright-policy'
|
||||
|
||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'CopyrightPolicy'>
|
||||
export const CopyrightPolicyScreen = (_props: Props) => {
|
||||
const pal = usePalette('default')
|
||||
const store = useStores()
|
||||
|
||||
useFocusEffect(
|
||||
React.useCallback(() => {
|
||||
store.shell.setMinimalShellMode(false)
|
||||
}, [store]),
|
||||
)
|
||||
|
||||
return (
|
||||
<View>
|
||||
<ViewHeader title="Copyright Policy" />
|
||||
<ScrollView style={[s.hContentRegion, pal.view]}>
|
||||
<View style={[s.p20]}>
|
||||
<Text type="title-xl" style={[pal.text, s.bold, s.pb20]}>
|
||||
Copyright Policy
|
||||
</Text>
|
||||
<Html />
|
||||
</View>
|
||||
<View style={s.footerSpacer} />
|
||||
</ScrollView>
|
||||
</View>
|
||||
)
|
||||
}
|
38
src/view/screens/TermsOfService.tsx
Normal file
38
src/view/screens/TermsOfService.tsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
import React from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {useFocusEffect} from '@react-navigation/native'
|
||||
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
|
||||
import {ViewHeader} from '../com/util/ViewHeader'
|
||||
import {useStores} from 'state/index'
|
||||
import {ScrollView} from 'view/com/util/Views'
|
||||
import {Text} from 'view/com/util/text/Text'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {s} from 'lib/styles'
|
||||
import Html from '../../locale/en/terms-of-service'
|
||||
|
||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'TermsOfService'>
|
||||
export const TermsOfServiceScreen = (_props: Props) => {
|
||||
const pal = usePalette('default')
|
||||
const store = useStores()
|
||||
|
||||
useFocusEffect(
|
||||
React.useCallback(() => {
|
||||
store.shell.setMinimalShellMode(false)
|
||||
}, [store]),
|
||||
)
|
||||
|
||||
return (
|
||||
<View>
|
||||
<ViewHeader title="Terms of Service" />
|
||||
<ScrollView style={[s.hContentRegion, pal.view]}>
|
||||
<View style={[s.p20]}>
|
||||
<Text type="title-xl" style={[pal.text, s.bold, s.pb20]}>
|
||||
Terms of Service
|
||||
</Text>
|
||||
<Html />
|
||||
</View>
|
||||
<View style={s.footerSpacer} />
|
||||
</ScrollView>
|
||||
</View>
|
||||
)
|
||||
}
|
|
@ -38,6 +38,15 @@ export const DesktopRightNav = observer(function DesktopRightNav() {
|
|||
href="/support/privacy"
|
||||
text="Privacy Policy"
|
||||
/>
|
||||
<Text type="md" style={pal.textLight}>
|
||||
·
|
||||
</Text>
|
||||
<TextLink
|
||||
type="md"
|
||||
style={pal.link}
|
||||
href="/support/tos"
|
||||
text="Terms"
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<InviteCodes />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue