This repository has been archived by the owner on Jan 4, 2025. It is now read-only.
-
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.
- Loading branch information
Showing
15 changed files
with
365 additions
and
74 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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
module.exports = function(api) { | ||
// eslint-disable-next-line func-names | ||
module.exports = function (api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
presets: ["babel-preset-expo"], | ||
env: { | ||
production: { | ||
plugins: ["react-native-paper/babel"], | ||
}, | ||
}, | ||
}; | ||
}; |
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,18 @@ | ||
import React, { useContext } from "react"; | ||
import { Switch } from "react-native-paper"; | ||
import DarkModeContext from "../contexts/DarkModeContext"; | ||
|
||
const DarkModeSwitch = (): JSX.Element => { | ||
const { dark, setDark } = useContext(DarkModeContext); | ||
|
||
return ( | ||
<Switch | ||
value={dark} | ||
onValueChange={() => setDark((prev) => !prev)} | ||
accessibilityComponentType="" | ||
accessibilityTraits="" | ||
/> | ||
); | ||
}; | ||
|
||
export default DarkModeSwitch; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
import React from "react"; | ||
import { View } from "react-native"; | ||
import { Text } from "react-native-paper"; | ||
|
||
export default function About(): JSX.Element { | ||
return ( | ||
<View> | ||
<Text accessibilityComponentType="" accessibilityTraits=""> | ||
Hello there | ||
</Text> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import { View } from "react-native"; | ||
|
||
import { IconButton, Text } from "react-native-paper"; | ||
import { HomeProps as Props } from "../utils/StackTypes"; | ||
|
||
export default function Home({ navigation }: Props): JSX.Element { | ||
React.useLayoutEffect(() => { | ||
navigation.setOptions({ | ||
headerRight: () => ( | ||
<IconButton | ||
icon="cog-outline" | ||
onPress={() => navigation.navigate("Settings")} | ||
accessibilityComponentType="" | ||
accessibilityTraits="" | ||
/> | ||
), | ||
}); | ||
}, [navigation]); | ||
|
||
return ( | ||
<View | ||
style={{ | ||
flex: 1, | ||
flexDirection: "column", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
}} | ||
> | ||
<Text accessibilityComponentType="" accessibilityTraits=""> | ||
Hello | ||
</Text> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import { ScrollView } from "react-native"; | ||
import { Divider, IconButton, List } from "react-native-paper"; | ||
import DarkModeSwitch from "../components/DarkModeSwitch"; | ||
|
||
import { SettingsProps as Props } from "../utils/StackTypes"; | ||
|
||
export default function Settings({ navigation }: Props): JSX.Element { | ||
React.useLayoutEffect(() => { | ||
navigation.setOptions({ | ||
headerRight: () => ( | ||
<IconButton | ||
icon="information-outline" | ||
onPress={() => navigation.navigate("About")} | ||
accessibilityComponentType="" | ||
accessibilityTraits="" | ||
/> | ||
), | ||
}); | ||
}, [navigation]); | ||
|
||
return ( | ||
<ScrollView | ||
style={{ | ||
flex: 1, | ||
}} | ||
> | ||
<List.Item | ||
title="Dark mode" | ||
accessibilityComponentType="" | ||
accessibilityTraits="" | ||
right={() => <DarkModeSwitch />} | ||
left={() => <List.Icon icon="weather-night" />} | ||
/> | ||
<Divider accessibilityComponentType="" accessibilityTraits="" /> | ||
</ScrollView> | ||
); | ||
} |
File renamed without changes.
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,11 @@ | ||
import { StackScreenProps } from "@react-navigation/stack"; | ||
|
||
type RootStackParamList = { | ||
Home: undefined; | ||
Settings: undefined; | ||
About: undefined; | ||
Feed: { sort: "latest" | "top" } | undefined; | ||
}; | ||
|
||
export type HomeProps = StackScreenProps<RootStackParamList, "Home">; | ||
export type SettingsProps = StackScreenProps<RootStackParamList, "Settings">; |
Oops, something went wrong.