Skip to content

Commit

Permalink
Merge pull request #3 from funnyzak/feat/setting
Browse files Browse the repository at this point in the history
  • Loading branch information
funnyzak authored Mar 17, 2022
2 parents 4067030 + 7d74f29 commit 677993c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export const REPO_GITHUB_URL = `https://github.com/${REPO_NAME}`
/**
* 帮助文档
*/
export const HELP_PAGE_LINK = 'https://github.com/funnyzak/react-native-v2ex/blob/develop/_docs/Help.md'
export const HELP_PAGE_LINK = 'https://yycc.dev/2022/03/17/react-native-v2ex/'
16 changes: 0 additions & 16 deletions src/screens/my/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ const My = ({
</TouchableOpacity>
</View>
<View style={SylCommon.Table.container(theme)}>
<TouchableOpacity
style={SylCommon.Table.item(theme)}
onPress={() => {
navigation.navigate(ROUTES.Setting)
}}>
<Text style={SylCommon.Table.itemText(theme)}>{translate('common.setting')}</Text>
<Image style={SylCommon.Table.itemArrow(theme)} source={theme.assets.images.icons.arrowRightGrey} />
</TouchableOpacity>
<TouchableOpacity
style={SylCommon.Table.item(theme)}
onPress={() => {
Expand Down Expand Up @@ -99,14 +91,6 @@ const My = ({
<Text style={SylCommon.Table.itemText(theme)}>{translate('common.email')}</Text>
<Text style={SylCommon.Table.itemRightText(theme)}>{app.aboutUs.email}</Text>
</TouchableOpacity>
<TouchableOpacity
style={SylCommon.Table.item(theme)}
onPress={() => {
utils.linking(`https://twitter.com/${app.aboutUs.twitter}`)
}}>
<Text style={SylCommon.Table.itemText(theme)}>{translate('common.twitter')}</Text>
<Text style={SylCommon.Table.itemRightText(theme)}>@{app.aboutUs.twitter}</Text>
</TouchableOpacity>
<TouchableOpacity
style={SylCommon.Table.item(theme)}
onPress={() => {
Expand Down
51 changes: 34 additions & 17 deletions src/screens/setting/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,36 @@ import { REPO_GITHUB_URL, REPO_NAME } from '@src/config/constants'
import { translate } from '@src/i18n'
import { linking } from '@src/utils'
import { useTheme, SylCommon } from '@src/theme'
import { ITheme } from '@src/types'
import { IState, ITheme } from '@src/types'
import { AboutScreenProps as ScreenProps } from '@src/navigation/routes'

const About = ({}: ScreenProps) => {
const About = ({
app
}: ScreenProps & {
app: IState.AppState
}) => {
const { theme } = useTheme()
return (
<View style={[SylCommon.Layout.fill, SylCommon.View.background(theme), styles.container(theme)]}>
<Image style={styles.logo(theme)} source={theme.assets.images.icons.icon} resizeMode="contain" />
<Text style={styles.desc(theme)}>{translate('brand.intro')}</Text>
<View style={styles.content(theme)}>
<View style={SylCommon.Layout.fill}>
<Text>{translate('common.repoURL')}</Text>
<Text style={styles.link(theme)} onPress={() => linking(REPO_GITHUB_URL)}>
{REPO_NAME}
</Text>
<View style={[SylCommon.Layout.fill, SylCommon.View.background(theme)]}>
<View style={styles.container(theme)}>
<Image style={styles.logo(theme)} source={theme.assets.images.icons.icon} resizeMode="contain" />
<Text style={styles.desc(theme)}>
V{app.version.version}(Build {app.version.buildId})
</Text>
</View>
<View style={styles.container(theme)}>
<Text style={styles.desc(theme)}>{translate('brand.intro')}</Text>
<View style={styles.content(theme)}>
<View style={SylCommon.Layout.fill}>
<Text>{translate('common.repoURL')}</Text>
<Text style={styles.link(theme)} onPress={() => linking(REPO_GITHUB_URL)}>
{REPO_NAME}
</Text>
</View>
</View>
</View>
<View style={styles.footer(theme)}>
<Text style={styles.footerText(theme)}>code by funnyzak</Text>
<Text style={styles.footerText(theme)}>@funnyzak 2022</Text>
</View>
</View>
)
Expand All @@ -35,17 +46,19 @@ const About = ({}: ScreenProps) => {
*/
const styles = {
container: (theme: ITheme): ViewStyle => ({
paddingHorizontal: theme.spacing.extraLarge
paddingHorizontal: theme.spacing.extraLarge,
paddingBottom: 32
}),
logo: (theme: ITheme): ImageStyle => ({
marginVertical: 32,
marginTop: 32,
borderRadius: 10,
width: 75,
height: 75,
alignSelf: 'center'
}),
desc: (theme: ITheme): TextStyle => ({
alignSelf: 'center'
alignSelf: 'center',
paddingTop: theme.spacing.tiny
}),
content: (theme: ITheme) => ({
marginTop: 32
Expand All @@ -62,8 +75,12 @@ const styles = {
}),
footerText: (theme: ITheme) => ({
...theme.typography.captionText,
color: theme.colors.secondary
color: theme.colors.captionText
})
}

export default connect()(About)
const mapStateToProps = ({ app }: { app: IState.AppState }) => {
return { app }
}

export default connect(mapStateToProps)(About)

0 comments on commit 677993c

Please sign in to comment.