Skip to content

Commit 7a58bf8

Browse files
Adjust styling and added spacing to bottom of views
1 parent 9d8d8be commit 7a58bf8

File tree

8 files changed

+172
-170
lines changed

8 files changed

+172
-170
lines changed

src/components/styled/StyledListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const StyledListItem: FC<ListItemProps> = props => {
66
return (
77
<Surface
88
mode="flat"
9-
elevation={props.disabled ? 1 : 5}
9+
elevation={props.disabled ? 1 : 3}
1010
style={{
1111
borderRadius: 16,
1212
...(props.disabled && { opacity: 0.5 }),

src/style.tsx

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

1111
import styled from 'styled-components';
1212

13+
import { spacing } from '@/constants.ts';
14+
1315
import { DarkTheme, DefaultTheme } from '@react-navigation/native';
1416

1517
export const ReactNavigationDarkTheme = {
@@ -34,20 +36,15 @@ export const ReactNavigationLightTheme = {
3436
},*/
3537
};
3638

37-
export const StyledView = styled(View)`
38-
background-color: ${props => props.theme.colors.background};
39-
color: ${props => props.theme.colors.onBackground};
40-
flex: 1;
41-
align-items: center;
42-
justify-content: center;
43-
width: 100%;
44-
`;
45-
4639
export interface StyledScrollViewProps extends ScrollViewProps {
4740
theme: MD3Theme;
41+
disableSafeBottomMargin?: boolean;
4842
}
4943

50-
export const StyledScrollView: FC<StyledScrollViewProps> = props => {
44+
export const StyledScrollView: FC<StyledScrollViewProps> = ({
45+
children,
46+
...props
47+
}) => {
5148
const rnpTheme = useTheme();
5249
const theme = props.theme ?? rnpTheme;
5350

@@ -60,21 +57,32 @@ export const StyledScrollView: FC<StyledScrollViewProps> = props => {
6057
color: theme.colors.onBackground,
6158
width: '100%',
6259
}}
63-
/>
60+
>
61+
{children}
62+
{props.disableSafeBottomMargin ? null : (
63+
<View style={{ height: spacing * 2 }} />
64+
)}
65+
</ScrollView>
6466
);
6567
};
6668

6769
export type StyledSafeAreaViewProps = {
6870
theme?: MD3Theme;
71+
disableSafeBottomMargin?: boolean;
6972
} & SafeAreaViewProps;
7073

71-
const InternalStyledSafeAreaView = styled(SafeAreaView)<{ theme: MD3Theme }>`
74+
const InternalStyledSafeAreaView = styled(SafeAreaView)<{
75+
theme: MD3Theme;
76+
disableSafeBottomMargin?: boolean;
77+
}>`
7278
height: 100%;
7379
flex: 1;
7480
align-items: center;
7581
background-color: ${props => props.theme.colors.background};
7682
display: flex;
7783
color: ${props => props.theme.colors.onBackground};
84+
padding-bottom: ${props =>
85+
props.disableSafeBottomMargin ? 0 : spacing * 2}px;
7886
`;
7987

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

0 commit comments

Comments
 (0)