Skip to content

Commit 55a9e11

Browse files
Added spacing to bottom of views
1 parent 7a58bf8 commit 55a9e11

24 files changed

+83
-52
lines changed

src/components/devices/DeviceList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FC } from 'react';
22
import { Box } from 'react-native-flex-layout';
33

4-
import { ScrollView } from 'react-native';
4+
import { ScrollView, View } from 'react-native';
55

66
import DeviceListItem from '@/components/devices/DeviceListItem';
77

@@ -22,6 +22,7 @@ const DeviceList: FC = () => {
2222
/>
2323
))}
2424
</Box>
25+
<View style={{ height: spacing * 2 }} />
2526
</ScrollView>
2627
);
2728
};

src/components/inverters/InverterList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FC } from 'react';
22
import { Box } from 'react-native-flex-layout';
33

4-
import { ScrollView } from 'react-native';
4+
import { ScrollView, View } from 'react-native';
55

66
import InverterListItem from '@/components/inverters/InverterListItem';
77

@@ -43,6 +43,7 @@ const InverterList: FC = () => {
4343
/>
4444
))}
4545
</Box>
46+
<View style={{ height: spacing * 2 }} />
4647
</ScrollView>
4748
);
4849
};

src/style.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ScrollView, View } from 'react-native';
1010

1111
import styled from 'styled-components';
1212

13-
import { spacing } from '@/constants.ts';
13+
import { spacing } from '@/constants';
1414

1515
import { DarkTheme, DefaultTheme } from '@react-navigation/native';
1616

@@ -68,12 +68,12 @@ export const StyledScrollView: FC<StyledScrollViewProps> = ({
6868

6969
export type StyledSafeAreaViewProps = {
7070
theme?: MD3Theme;
71-
disableSafeBottomMargin?: boolean;
71+
enableSafeBottomMargin?: boolean;
7272
} & SafeAreaViewProps;
7373

7474
const InternalStyledSafeAreaView = styled(SafeAreaView)<{
7575
theme: MD3Theme;
76-
disableSafeBottomMargin?: boolean;
76+
enableSafeBottomMargin?: boolean;
7777
}>`
7878
height: 100%;
7979
flex: 1;
@@ -82,7 +82,7 @@ const InternalStyledSafeAreaView = styled(SafeAreaView)<{
8282
display: flex;
8383
color: ${props => props.theme.colors.onBackground};
8484
padding-bottom: ${props =>
85-
props.disableSafeBottomMargin ? 0 : spacing * 2}px;
85+
props.enableSafeBottomMargin ? spacing * 2 : 0}px;
8686
`;
8787

8888
export const StyledSafeAreaView: FC<StyledSafeAreaViewProps> = props => {

src/views/navigation/screens/AboutAppScreen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
useTheme,
1717
} from 'react-native-paper';
1818

19-
import { Linking, ScrollView, Text as RNText } from 'react-native';
19+
import { Linking, ScrollView, Text as RNText, View } from 'react-native';
2020

2121
import moment from 'moment';
2222

@@ -26,6 +26,7 @@ import GenericRefreshModal from '@/components/modals/GenericRefreshModal';
2626

2727
import useHasNewAppVersion from '@/hooks/useHasNewAppVersion';
2828

29+
import { spacing } from '@/constants';
2930
import { useFetchControl } from '@/github/FetchHandler';
3031
import { useAppDispatch, useAppSelector } from '@/store';
3132
import { StyledSafeAreaView } from '@/style';
@@ -189,6 +190,7 @@ const AboutAppScreen: FC<PropsWithNavigation> = ({ navigation }) => {
189190
/>
190191
)}
191192
/>
193+
<View style={{ height: spacing * 2 }} />
192194
</ScrollView>
193195
</Box>
194196
</StyledSafeAreaView>

src/views/navigation/screens/DebugColorsScreen.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ScrollView, View } from 'react-native';
77

88
import styled from 'styled-components';
99

10+
import { spacing } from '@/constants';
1011
import { StyledSafeAreaView } from '@/style';
1112
import type { PropsWithNavigation } from '@/views/navigation/NavigationStack';
1213

@@ -50,7 +51,10 @@ const DebugColorsScreen: FC<PropsWithNavigation> = ({ navigation }) => {
5051
</Appbar.Header>
5152
<StyledSafeAreaView theme={theme}>
5253
<Box style={{ flex: 1, width: '100%' }}>
53-
<ScrollView>{flatColors}</ScrollView>
54+
<ScrollView>
55+
{flatColors}
56+
<View style={{ height: spacing * 2 }} />
57+
</ScrollView>
5458
</Box>
5559
</StyledSafeAreaView>
5660
</>

src/views/navigation/screens/DebugScreen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
44
import { Box } from 'react-native-flex-layout';
55
import { Appbar, IconButton, List, useTheme } from 'react-native-paper';
66

7-
import { ScrollView } from 'react-native';
7+
import { ScrollView, View } from 'react-native';
88

99
import moment from 'moment';
1010

@@ -17,6 +17,7 @@ import { setDebugEnabled } from '@/slices/settings';
1717

1818
import { useApi } from '@/api/ApiHandler';
1919
import type { DebugInfo } from '@/api/opendtuapi';
20+
import { spacing } from '@/constants';
2021
import { useAppDispatch, useAppSelector } from '@/store';
2122
import { StyledSafeAreaView } from '@/style';
2223
import type { PropsWithNavigation } from '@/views/navigation/NavigationStack';
@@ -148,6 +149,7 @@ const DebugScreen: FC<PropsWithNavigation> = ({ navigation }) => {
148149
onPress={() => navigation.navigate('DebugColorsScreen')}
149150
/>
150151
</List.Section>
152+
<View style={{ height: spacing * 2 }} />
151153
</ScrollView>
152154
</Box>
153155
</StyledSafeAreaView>

src/views/navigation/screens/DeviceSettingsScreen.tsx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
44
import { Box } from 'react-native-flex-layout';
55
import { Appbar, Button, List, Text, useTheme } from 'react-native-paper';
66

7-
import { ScrollView } from 'react-native';
7+
import { ScrollView, View } from 'react-native';
88

99
import { setSelectedDtuConfig } from '@/slices/settings';
1010

@@ -17,6 +17,7 @@ import ConfirmDeleteDeviceModal from '@/components/modals/ConfirmDeleteDeviceMod
1717

1818
import useLivedata from '@/hooks/useLivedata';
1919

20+
import { spacing } from '@/constants';
2021
import { useAppDispatch, useAppSelector } from '@/store';
2122
import { StyledSafeAreaView } from '@/style';
2223
import type { PropsWithNavigation } from '@/views/navigation/NavigationStack';
@@ -270,28 +271,29 @@ const DeviceSettingsScreen: FC<PropsWithNavigation> = ({
270271
</Box>
271272
</Box>
272273
</Box>
273-
<ChangeCustomNameModal
274-
visible={openCustomNameModal}
275-
onDismiss={() => setOpenCustomNameModal(false)}
276-
index={index}
277-
/>
278-
<ChangeServerUrlModal
279-
visible={openServerUrlModal}
280-
onDismiss={() => setOpenServerUrlModal(false)}
281-
index={index}
282-
/>
283-
<ChangeOpendtuCredentialsModal
284-
visible={openCredentialsModal}
285-
onDismiss={() => setOpenCredentialsModal(false)}
286-
index={index}
287-
/>
288-
<ConfirmDeleteDeviceModal
289-
visible={openDeleteModal}
290-
onDismiss={() => setOpenDeleteModal(false)}
291-
index={index}
292-
/>
274+
<View style={{ height: spacing * 2 }} />
293275
</ScrollView>
294276
</Box>
277+
<ChangeCustomNameModal
278+
visible={openCustomNameModal}
279+
onDismiss={() => setOpenCustomNameModal(false)}
280+
index={index}
281+
/>
282+
<ChangeServerUrlModal
283+
visible={openServerUrlModal}
284+
onDismiss={() => setOpenServerUrlModal(false)}
285+
index={index}
286+
/>
287+
<ChangeOpendtuCredentialsModal
288+
visible={openCredentialsModal}
289+
onDismiss={() => setOpenCredentialsModal(false)}
290+
index={index}
291+
/>
292+
<ConfirmDeleteDeviceModal
293+
visible={openDeleteModal}
294+
onDismiss={() => setOpenDeleteModal(false)}
295+
index={index}
296+
/>
295297
</StyledSafeAreaView>
296298
</>
297299
);

src/views/navigation/screens/FirmwareListScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const FirmwareListScreen: FC<PropsWithNavigation> = ({ navigation }) => {
8686
<Appbar.Content title={t('firmwares.title')} />
8787
<Appbar.Action icon="refresh" onPress={handleShowRefreshModal} />
8888
</Appbar.Header>
89-
<StyledSafeAreaView theme={theme} disableSafeBottomMargin>
89+
<StyledSafeAreaView theme={theme}>
9090
<GenericRefreshModal
9191
visible={showRefreshModal}
9292
onDismiss={handleHideRefreshModal}

src/views/navigation/screens/InverterDataScreen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
33
import { Box } from 'react-native-flex-layout';
44
import { Appbar, List, useTheme } from 'react-native-paper';
55

6-
import { ScrollView } from 'react-native';
6+
import { ScrollView, View } from 'react-native';
77

88
import type { Inverter, InverterFromStatus } from '@/types/opendtu/status';
99

@@ -14,6 +14,7 @@ import useLivedata from '@/hooks/useLivedata';
1414

1515
import { rootLogging } from '@/utils/log';
1616

17+
import { spacing } from '@/constants';
1718
import { StyledScrollView } from '@/style';
1819
import type { PropsWithNavigation } from '@/views/navigation/NavigationStack';
1920
import type { DataKeys } from '@/views/navigation/screens/InverterInfoScreen';
@@ -98,6 +99,7 @@ const InverterDataScreen: FC<PropsWithNavigation> = ({ navigation, route }) => {
9899
))}
99100
</StyledSurface>
100101
) : null}
102+
<View style={{ height: spacing * 2 }} />
101103
</ScrollView>
102104
</Box>
103105
</StyledScrollView>

src/views/navigation/screens/InverterDeviceInfoScreen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
44
import { Box } from 'react-native-flex-layout';
55
import { Appbar, List, useTheme } from 'react-native-paper';
66

7-
import { RefreshControl, ScrollView } from 'react-native';
7+
import { RefreshControl, ScrollView, View } from 'react-native';
88

99
import SettingsSurface from '@/components/styled/SettingsSurface';
1010

@@ -15,6 +15,7 @@ import formatVersion from '@/utils/formatVersion';
1515
import { rootLogging } from '@/utils/log';
1616

1717
import { useApi } from '@/api/ApiHandler';
18+
import { spacing } from '@/constants';
1819
import { StyledSafeAreaView } from '@/style';
1920
import type { PropsWithNavigation } from '@/views/navigation/NavigationStack';
2021

@@ -160,6 +161,7 @@ const InverterDeviceInfoScreen: FC<PropsWithNavigation> = ({
160161
</>
161162
)}
162163
</SettingsSurface>
164+
<View style={{ height: spacing * 2 }} />
163165
</ScrollView>
164166
</Box>
165167
</StyledSafeAreaView>

0 commit comments

Comments
 (0)