Skip to content

Commit 414c8d9

Browse files
authored
Merge pull request #46 from funnyzak/refactor/style
2 parents 411ea4d + 9cf3234 commit 414c8d9

File tree

9 files changed

+17
-11
lines changed

9 files changed

+17
-11
lines changed

src/navigation/Navigator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const HotDrawerNavigator = ({
227227
<HeaderButton
228228
onPress={() => navigation.navigate(ROUTES.SiteStat)}
229229
source={theme.assets.images.icons.header.stat}
230-
containerStyle={[{ marginRight: theme.spacing.medium }]}
230+
containerStyle={[{ marginRight: theme.dimens.layoutContainerHorizontalMargin }]}
231231
/>
232232
),
233233
drawerActiveTintColor: theme.colors.secondary,

src/screens/components/list/TableList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const TableList: React.FC<TableListProps> = (data: TableListProps) => {
120120
const renderContent = () => {
121121
return (
122122
<View style={[tableStyles.container(theme), data.containerStyle]}>
123-
<Text style={tableStyles.title(theme)}>{data.title}</Text>
123+
{data.title && <Text style={tableStyles.title(theme)}>{data.title}</Text>}
124124
<View style={tableStyles.list(theme)}>{data.children}</View>
125125
</View>
126126
)

src/screens/setting/Language.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Language = ({
2727

2828
return (
2929
<View style={SylCommon.Layout.fill}>
30-
<TableList containerStyle={[{ marginTop: theme.spacing.tiny }]}>
30+
<TableList containerStyle={[{ marginTop: theme.spacing.small }]}>
3131
{translationList.map((item, index) => (
3232
<TableRow
3333
key={index}

src/screens/setting/License.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { TableList, TableRow } from '../components'
1010
const OpenSourceLicense = ({ navigation }: ScreenProps) => {
1111
const { theme } = useTheme()
1212
return (
13-
<View style={[SylCommon.Layout.fill, { backgroundColor: theme.colors.background }]}>
14-
<TableList containerStyle={[{ marginTop: theme.spacing.tiny }]}>
13+
<View style={SylCommon.Layout.fill}>
14+
<TableList containerStyle={[{ marginTop: theme.spacing.small }]}>
1515
{OPENSOURCE_LIST.map((item, index) => (
1616
<TableRow
1717
key={index}

src/screens/setting/SiteStat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const SiteStat = ({
1515
const { theme } = useTheme()
1616
return (
1717
<View style={SylCommon.Layout.fill}>
18-
<TableList containerStyle={[{ marginTop: theme.spacing.tiny }]}>
18+
<TableList containerStyle={[{ marginTop: theme.spacing.small }]}>
1919
<TableRow
2020
title={translate('label.registedMember')}
2121
value={siteStat?.member_max.toString() ?? 'None'}

src/screens/setting/Theme.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const Theme = ({
2626
const { theme, resetTheme } = useTheme()
2727

2828
return (
29-
<View style={[SylCommon.Layout.fill, SylCommon.View.background(theme)]}>
30-
<TableList containerStyle={[{ marginTop: theme.spacing.tiny }]}>
29+
<View style={SylCommon.Layout.fill}>
30+
<TableList containerStyle={[{ marginTop: theme.spacing.small }]}>
3131
{themeList.map((item, index) => (
3232
<TableRow
3333
key={index}

src/screens/setting/URLSchemes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const URLSchemes = ({}: ScreenProps) => {
1313
const { showMessage } = useToast()
1414

1515
return (
16-
<View style={[SylCommon.Layout.fill, { backgroundColor: theme.colors.background }]}>
17-
<TableList containerStyle={[{ marginTop: theme.spacing.tiny }]}>
16+
<View style={SylCommon.Layout.fill}>
17+
<TableList containerStyle={[{ marginTop: theme.spacing.small }]}>
1818
<TableRow
1919
title={translate('label.openApp')}
2020
description={URLSchemeList.OpenApp}

src/theme/light/dimens.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ const screenHeight = Dimensions.get('window').height
44

55
import { IThemeDimen } from '../types'
66

7+
const layoutContainerHorizontalMargin = 15
8+
79
const dimens: IThemeDimen = {
810
/**
911
* App level constants
1012
*/
1113
WINDOW_WIDTH: screenWidth,
1214
WINDOW_HEIGHT: screenHeight,
1315

14-
layoutContainerWidth: screenWidth - 30,
16+
layoutContainerWidth: screenWidth - layoutContainerHorizontalMargin * 2,
17+
18+
layoutContainerHorizontalMargin: layoutContainerHorizontalMargin,
1519

1620
headerButtonSize: 23,
1721
headerHeight: 50,

src/theme/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ export interface IThemeDimen {
122122
WINDOW_WIDTH: number
123123
WINDOW_HEIGHT: number
124124
layoutContainerWidth: number
125+
126+
layoutContainerHorizontalMargin: number
125127
headerHeight: number
126128
headerButtonSize: number
127129
badgeSize: number

0 commit comments

Comments
 (0)