-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create setting entry + header component
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from "react"; | ||
import { View, TouchableOpacity } from "react-native"; | ||
import { Cog6ToothIcon } from "react-native-heroicons/solid"; | ||
import { useNavigation } from "@react-navigation/native"; | ||
|
||
const SettingButton = () => { | ||
const navigation = useNavigation(); | ||
const goToSetting = () => { | ||
navigation.navigate("Setting"); | ||
}; | ||
|
||
return ( | ||
<View className="flex-row m-4 pb-10"> | ||
<TouchableOpacity | ||
className="absolute left-8" | ||
onPress={goToSetting} | ||
> | ||
<Cog6ToothIcon color="white" size="30" className="" testID="settingButton" /> | ||
</TouchableOpacity> | ||
</View> | ||
); | ||
}; | ||
|
||
export default SettingButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import { View, Text, TouchableOpacity } from "react-native"; | ||
import { ChevronLeftIcon } from "react-native-heroicons/solid"; | ||
|
||
|
||
export default function SettingHeader( {title, onPress} ) { | ||
return ( | ||
<View className="flex-row m-4 pb-10"> | ||
<TouchableOpacity className=" bg-white w-10 h-10 items-start justify-center rounded-full m-2 " onPress={onPress} testID="homeButton"> | ||
<ChevronLeftIcon | ||
color="black" | ||
size="35" | ||
className="" | ||
/> | ||
</TouchableOpacity> | ||
<View className="flex-1 justify-center items-center"> | ||
<Text className="text-white items-start text-2xl font-black">{title}</Text> | ||
</View> | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import { View, ImageBackground } from "react-native"; | ||
import { SafeAreaView } from "react-native-safe-area-context"; | ||
import { StatusBar } from "expo-status-bar"; | ||
import { useNavigation } from "@react-navigation/native"; | ||
import { useImage } from "../provider/ImageContext"; | ||
import SettingHeader from "../components/settingscreen/SettingHeader"; | ||
|
||
|
||
export default function SettingScreen() { | ||
const navigation = useNavigation(); | ||
const { backgroundImageSource } = useImage(); | ||
|
||
const goToHomescreen = () => { | ||
navigation.goBack(); | ||
}; | ||
|
||
return ( | ||
<View className="flex-1"> | ||
<ImageBackground | ||
blurRadius={70} | ||
source={backgroundImageSource} | ||
resizeMode="cover" | ||
className="absolute h-full w-full" | ||
/> | ||
<SafeAreaView className="flex-1 "> | ||
<StatusBar style="light" /> | ||
<SettingHeader title="OPTIONS" onPress={goToHomescreen} /> | ||
</SafeAreaView> | ||
</View> | ||
); | ||
} |