Skip to content

Commit b7b2f82

Browse files
authored
Merge pull request #38 from funnyzak/refactor/screen
2 parents 1fa6416 + 19de51a commit b7b2f82

File tree

16 files changed

+67
-28
lines changed

16 files changed

+67
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
- [x] 规划重新设计 UI 交互
4040
- [x] 界面语言文案修正
4141
- [x] 整理项目所使用开源库
42-
- [ ] 全新开发
42+
- [x] 全新开发
4343
- [ ] 评论列表
4444
- [ ] 升级提醒
4545
- [ ] 通知模块

ios/app.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,15 +484,15 @@
484484
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
485485
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
486486
CLANG_ENABLE_MODULES = YES;
487-
CURRENT_PROJECT_VERSION = 7;
487+
CURRENT_PROJECT_VERSION = 8;
488488
DEVELOPMENT_TEAM = ED4U2734MB;
489489
ENABLE_BITCODE = NO;
490490
INFOPLIST_FILE = app/Info.plist;
491491
LD_RUNPATH_SEARCH_PATHS = (
492492
"$(inherited)",
493493
"@executable_path/Frameworks",
494494
);
495-
MARKETING_VERSION = 0.5.3;
495+
MARKETING_VERSION = 0.5.5;
496496
OTHER_LDFLAGS = (
497497
"$(inherited)",
498498
"-ObjC",
@@ -515,24 +515,24 @@
515515
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
516516
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
517517
CLANG_ENABLE_MODULES = YES;
518-
CODE_SIGN_IDENTITY = "Apple Development";
519-
CODE_SIGN_STYLE = Automatic;
520-
CURRENT_PROJECT_VERSION = 7;
521-
DEVELOPMENT_TEAM = "";
518+
CODE_SIGN_IDENTITY = "iPhone Distribution";
519+
CODE_SIGN_STYLE = Manual;
520+
CURRENT_PROJECT_VERSION = 8;
521+
DEVELOPMENT_TEAM = ED4U2734MB;
522522
INFOPLIST_FILE = app/Info.plist;
523523
LD_RUNPATH_SEARCH_PATHS = (
524524
"$(inherited)",
525525
"@executable_path/Frameworks",
526526
);
527-
MARKETING_VERSION = 0.5.3;
527+
MARKETING_VERSION = 0.5.5;
528528
OTHER_LDFLAGS = (
529529
"$(inherited)",
530530
"-ObjC",
531531
"-lc++",
532532
);
533533
PRODUCT_BUNDLE_IDENTIFIER = github.funnyzak.v2ex;
534534
PRODUCT_NAME = app;
535-
PROVISIONING_PROFILE_SPECIFIER = "";
535+
PROVISIONING_PROFILE_SPECIFIER = "v2ex app dis m1";
536536
SWIFT_VER6.0 = SWIFT_VER6.0;
537537
SWIFT_VERSION = 6.0;
538538
TARGETED_DEVICE_FAMILY = "1,2";
592 Bytes
Loading
1 KB
Loading
1.42 KB
Loading

src/i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"activeLatest": "Last actived at $ ",
8888
"favorited": "Favorited",
8989
"joinSinceTime": "Joined from",
90-
"joinV2exSinceTime": "Become a V2EX member from $",
90+
"joinV2exSinceTime": "V2EXer #$, joined on $.",
9191
"noLogin": "Not logged in",
9292
"posdedTopics": "Topics posted by $",
9393
"openApp": "Open APP",

src/i18n/locales/zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"activeLatest": "最近活跃于 $。",
8888
"favorited": "收藏了",
8989
"joinSinceTime": "加入于",
90-
"joinV2exSinceTime": " $ 成为V2EX一员",
90+
"joinV2exSinceTime": " $ 号会员,加入于 $",
9191
"noLogin": "未登陆",
9292
"posdedTopics": "$ 发布的主题",
9393
"openApp": "打开APP",

src/navigation/Navigator.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ const defaultScreenOptions = (theme: ITheme): NativeStackNavigationOptions => ({
7474
headerBackground: () => defaultHeaderBackground(theme),
7575
headerBackTitle: undefined,
7676
headerTintColor: theme.colors.appbarTint,
77-
headerBackTitleVisible: false
77+
headerBackTitleVisible: false,
78+
79+
// screen main content style
80+
contentStyle: {
81+
backgroundColor: theme.colors.background
82+
}
7883
})
7984

8085
const resetLocales = (locale: LanguageTagType) => {
@@ -121,6 +126,7 @@ const renderBottomIcon = (focused: boolean, activeIcon: any, inactiveIcon: any):
121126

122127
const defaultTabBarSetting = (theme: ITheme, insets: EdgeInsets) => {
123128
return {
129+
...defaultScreenOptions,
124130
headerShown: false,
125131
tabBarActiveTintColor: theme.colors.tabBarIconActive,
126132
tabBarInactiveTintColor: theme.colors.tabBarIconInactive,
@@ -155,6 +161,7 @@ const MainAppNavigator = ({ navigation, route }: MainScreenProps) => {
155161
options={{
156162
title: translate(`router.${ROUTES.HotTopics}`),
157163
...defaultTabBarSetting(theme, insets),
164+
158165
tabBarIcon: ({ focused }) =>
159166
renderBottomIcon(
160167
focused,

src/screens/common/WebLink.tsx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { useEffect, useLayoutEffect, useMemo } from 'react'
1+
import React, { useEffect, useLayoutEffect, useMemo, useRef } from 'react'
22
import { View } from 'react-native'
3-
import { WebView } from 'react-native-webview'
3+
import { WebView, WebViewProps } from 'react-native-webview'
44

55
import { useTheme, SylCommon } from '@src/theme'
66
import { WebViewerScreenProps as ScreenProps } from '@src/navigation/routes'
@@ -11,6 +11,7 @@ import { translate } from '@src/i18n'
1111

1212
const WebLink = ({ route, navigation }: ScreenProps) => {
1313
const { theme } = useTheme()
14+
const webViewRef = useRef(new WebView<{ current?: any }>({}))
1415
const [loading, setLoading] = React.useState(true)
1516
const url = useMemo(
1617
() => (!route.params.url.startsWith('http') ? `http://${route.params.url}` : route.params.url),
@@ -26,12 +27,22 @@ const WebLink = ({ route, navigation }: ScreenProps) => {
2627
useLayoutEffect(() => {
2728
navigation.setOptions({
2829
headerRight: () => (
29-
<HeaderButton
30-
source={theme.assets.images.icons.header.link}
31-
onPress={() => {
32-
linking(url)
33-
}}
34-
/>
30+
<>
31+
<HeaderButton
32+
containerStyle={[{ marginRight: theme.spacing.tiny }]}
33+
source={theme.assets.images.icons.header.refresh}
34+
onPress={() => {
35+
setLoading(true)
36+
webViewRef.current.reload()
37+
}}
38+
/>
39+
<HeaderButton
40+
source={theme.assets.images.icons.header.link}
41+
onPress={() => {
42+
linking(url)
43+
}}
44+
/>
45+
</>
3546
)
3647
})
3748
}, [navigation])
@@ -40,6 +51,7 @@ const WebLink = ({ route, navigation }: ScreenProps) => {
4051
<View style={[SylCommon.Layout.fill, SylCommon.View.background(theme)]}>
4152
{loading && <Spinner text={translate('placeholder.loading')} />}
4253
<WebView
54+
ref={webViewRef}
4355
originWhitelist={['*']}
4456
source={{ uri: url }}
4557
onLoad={(syntheticEvent) => {

src/screens/components/common/General.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
TextStyle,
1414
TouchableOpacity,
1515
ViewStyle,
16-
Pressable
16+
Pressable,
17+
StyleProp
1718
} from 'react-native'
1819
import { IState } from '@src/types'
1920
import { translate } from '@src/i18n'
@@ -82,11 +83,13 @@ const BorderLine = () => {
8283
}
8384

8485
const HeaderButton = ({
86+
containerStyle: style,
8587
source,
8688
onPress,
8789
text,
8890
textColor
8991
}: {
92+
containerStyle?: StyleProp<ViewStyle>
9093
source?: ImageSourcePropType
9194
text?: string
9295
textColor?: string
@@ -95,7 +98,7 @@ const HeaderButton = ({
9598
const { theme } = useTheme()
9699

97100
return (
98-
<Pressable onPress={onPress}>
101+
<Pressable onPress={onPress} style={style}>
99102
{source && <Image source={source} width={24} />}
100103
{text && <Text style={styles.headerText(theme, textColor)}>{text}</Text>}
101104
</Pressable>
@@ -120,7 +123,7 @@ const Footer = () => {
120123

121124
const styles = {
122125
headerText: (theme: ITheme, textColor?: string): TextStyle => ({
123-
...theme.typography.bodyText,
126+
...theme.typography.subheadingText,
124127
color: textColor ?? theme.colors.secondary
125128
}),
126129
footer: (theme: ITheme): ViewStyle => ({

0 commit comments

Comments
 (0)