Skip to content

Commit

Permalink
add save area view
Browse files Browse the repository at this point in the history
  • Loading branch information
Assisneto committed Nov 8, 2023
1 parent 2e0c97a commit 1c90e31
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 32 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"react-native-gesture-handler": "~2.12.0",
"react-native-get-random-values": "~1.9.0",
"react-native-paper": "^5.11.1",
"react-native-safe-area-context": "4.6.3",
"react-native-safe-area-context": "^4.7.4",
"react-native-screens": "~3.22.0",
"styled-components": "^6.1.0",
"uuid": "^9.0.1"
Expand Down
9 changes: 6 additions & 3 deletions src/screen/editPlayer/component/header/styles.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import styled from "styled-components/native";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { SafeAreaView } from "react-native-safe-area-context";

export const Container = styled.View`
export const Container = styled(SafeAreaView).attrs({
edges: { top: "additive" }
})`
width: 100%;
height: 100px;
background-color: ${(props) => props.theme.colors.header};
flex-direction: row;
align-items: flex-end;
align-items: center;
justify-content: space-between;
padding: 0 10px;
padding-top: 5px;
`;
export const Title = styled.Text`
padding-left: 20px;
Expand Down
8 changes: 5 additions & 3 deletions src/screen/home/components/header/styles.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import styled from "styled-components/native";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { SafeAreaView } from "react-native-safe-area-context";

export const Container = styled.View`
export const Container = styled(SafeAreaView).attrs({
edges: { top: "additive" }
})`
width: 100%;
height: 100px;
background-color: ${(props) => props.theme.colors.header};
flex-direction: row;
align-items: flex-end;
align-items: center;
justify-content: space-around;
`;
export const Title = styled.Text`
Expand Down
34 changes: 16 additions & 18 deletions src/screen/newPlayer/component/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@ export const Header = ({ savePlayer }: { savePlayer: () => Promise<void> }) => {
const navigation = useNavigation();

return (
<>
<Container>
<AlignWrapper>
<Icons
name="chevron-left"
testID="back-button"
size={34}
onPress={navigation.goBack}
/>
<Title>Novo Munchkin</Title>
</AlignWrapper>
<Options>
<TouchableOpacity onPress={savePlayer} testID="savePlayerButton">
<Icons name="check" testID="save-button" size={30} />
</TouchableOpacity>
</Options>
</Container>
</>
<Container>
<AlignWrapper>
<Icons
name="chevron-left"
testID="back-button"
size={34}
onPress={navigation.goBack}
/>
<Title>Novo Munchkin</Title>
</AlignWrapper>
<Options>
<TouchableOpacity onPress={savePlayer} testID="savePlayerButton">
<Icons name="check" testID="save-button" size={30} />
</TouchableOpacity>
</Options>
</Container>
);
};
9 changes: 6 additions & 3 deletions src/screen/newPlayer/component/header/styles.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import styled from "styled-components/native";
import { MaterialCommunityIcons } from "@expo/vector-icons";

export const Container = styled.View`
import { SafeAreaView } from "react-native-safe-area-context";

export const Container = styled(SafeAreaView).attrs({
edges: { top: "additive" }
})`
width: 100%;
height: 100px;
background-color: ${(props) => props.theme.colors.header};
flex-direction: row;
align-items: flex-end;
align-items: center;
justify-content: space-between;
padding: 0 10px;
`;
Expand Down

0 comments on commit 1c90e31

Please sign in to comment.