Skip to content

Commit

Permalink
add global styling file, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wiktorrudzki committed Jan 13, 2024
1 parent 834e416 commit 885971a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { globalStyles } from 'style';

const App = () => {
return (
Expand All @@ -12,7 +13,8 @@ const App = () => {

const styles = StyleSheet.create({
container: {
flex: 1,
...globalStyles.horizontalFlex,
...globalStyles.centerFlex,
backgroundColor: 'white',
alignItems: 'center',
justifyContent: 'center',
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

## Styling

<!-- TODO -->
### File **_style.ts_** contains all contains all global styling that are being used in app (flex, grid, variables etc.)

`You should declare all reusable stylings there`

## Form

Expand Down
17 changes: 17 additions & 0 deletions style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { StyleSheet } from 'react-native';

const globalStyles = StyleSheet.create({
verticalFlex: {
display: 'flex',
flexDirection: 'column',
},
horizontalFlex: {
display: 'flex',
},
centerFlex: {
justifyContent: 'center',
alignItems: 'center',
},
});

export { globalStyles };

0 comments on commit 885971a

Please sign in to comment.