-
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.
Add new wallpaper info modal with go back and download icons
- Loading branch information
1 parent
2b9fa5d
commit 45e659a
Showing
11 changed files
with
172 additions
and
20 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
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,39 @@ | ||
import { Icon } from "@/interfaces"; | ||
import React from "react"; | ||
import { Path, Svg } from "react-native-svg"; | ||
import { useThemeColor } from "../Themed"; | ||
|
||
export const ArrowLeft = ({ | ||
width, | ||
height, | ||
darkColor, | ||
lightColor, | ||
lightStroke, | ||
darkStroke, | ||
...props | ||
}: Icon) => { | ||
const colorName = useThemeColor( | ||
{ light: lightColor, dark: darkColor }, | ||
"text" | ||
); | ||
const strokeName = useThemeColor( | ||
{ light: lightStroke, dark: darkStroke }, | ||
"text" | ||
); | ||
|
||
return ( | ||
<Svg | ||
width={width} | ||
height={height} | ||
viewBox="0 0 20 21" | ||
fill="none" | ||
stroke={strokeName} | ||
{...props} | ||
> | ||
<Path | ||
d="M20 9.0268H4.7875L11.775 2.0393L10 0.276802L0 10.2768L10 20.2768L11.7625 18.5143L4.7875 11.5268H20V9.0268Z" | ||
fill={colorName === "#fff" ? "#fffffe" : colorName} | ||
/> | ||
</Svg> | ||
); | ||
}; |
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
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
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,23 @@ | ||
import { ArrowLeft } from "@/components/icons/ArrowLeft"; | ||
import Colors from "@/constants/Colors"; | ||
import { StyleProp, TouchableOpacity, ViewStyle } from "react-native"; | ||
|
||
const BACK_BUTTON_SIZE = 30; | ||
|
||
interface BackButtonProps { | ||
onClick: () => void; | ||
style?: StyleProp<ViewStyle>; | ||
} | ||
|
||
export const BackButton = ({ onClick, style }: BackButtonProps) => ( | ||
<TouchableOpacity onPress={onClick} style={style}> | ||
<ArrowLeft | ||
lightColor={Colors.palette.black} | ||
lightStroke={Colors.palette.black} | ||
darkColor={Colors.palette.black} | ||
darkStroke={Colors.palette.black} | ||
width={BACK_BUTTON_SIZE} | ||
height={BACK_BUTTON_SIZE} | ||
/> | ||
</TouchableOpacity> | ||
); |
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,23 @@ | ||
import { DownloadArrow } from "@/components/icons/DownloadArrow"; | ||
import Colors from "@/constants/Colors"; | ||
import { StyleProp, TouchableOpacity, ViewStyle } from "react-native"; | ||
|
||
const DONWLOAD_BUTTON_SIZE = 30; | ||
|
||
interface DownloadButtonProps { | ||
onClick: () => void; | ||
style?: StyleProp<ViewStyle>; | ||
} | ||
|
||
export const DownloadButton = ({ onClick, style }: DownloadButtonProps) => ( | ||
<TouchableOpacity onPress={onClick} style={style}> | ||
<DownloadArrow | ||
lightColor={Colors.palette.black} | ||
lightStroke={Colors.palette.black} | ||
darkColor={Colors.palette.black} | ||
darkStroke={Colors.palette.black} | ||
width={DONWLOAD_BUTTON_SIZE} | ||
height={DONWLOAD_BUTTON_SIZE} | ||
/> | ||
</TouchableOpacity> | ||
); |
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,45 @@ | ||
import { RootStackScreenProps } from "@/navigation/types.d"; | ||
import { useNavigation } from "@react-navigation/native"; | ||
import { ImageBackground, StatusBar, StyleSheet } from "react-native"; | ||
import { BackButton } from "./BackButton"; | ||
import { DownloadButton } from "./DownloadButton"; | ||
|
||
const statusBarHeight = StatusBar.currentHeight ?? 0; | ||
|
||
export default function WallpaperInfoScreen({ | ||
route: { params }, | ||
}: RootStackScreenProps<"WallpaperInfo">) { | ||
const { wallpaper } = params; | ||
const navigator = useNavigation(); | ||
|
||
const goBack = () => { | ||
navigator.goBack(); | ||
}; | ||
|
||
const downloadWallpaper = () => { | ||
console.log("Downloading wallpaper..."); | ||
}; | ||
|
||
return ( | ||
<ImageBackground source={wallpaper} style={styles.backgroundImage}> | ||
<BackButton style={styles.goBackIcon} onClick={goBack} /> | ||
<DownloadButton style={styles.downloadIcon} onClick={downloadWallpaper} /> | ||
</ImageBackground> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
backgroundImage: { | ||
height: "100%", | ||
}, | ||
downloadIcon: { | ||
position: "absolute", | ||
top: statusBarHeight + 10, | ||
right: 24, | ||
}, | ||
goBackIcon: { | ||
position: "absolute", | ||
top: statusBarHeight + 10, | ||
left: 24, | ||
}, | ||
}); |