-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from eurofurence/feature/theme-picker
Feature/theme picker
- Loading branch information
Showing
14 changed files
with
321 additions
and
102 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
web-build | ||
|
||
.vscode/ | ||
package-lock.json | ||
|
||
|
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,103 @@ | ||
{ | ||
"expo": { | ||
"runtimeVersion": { | ||
"policy": "appVersion" | ||
}, | ||
"entryPoint": "./src/index.tsx", | ||
"name": "Eurofurence", | ||
"slug": "ef-app-react-native", | ||
"description": "Your one stop shop to the convention!", | ||
"owner": "eurofurence", | ||
"version": "3.0.0", | ||
"orientation": "default", | ||
"icon": "./assets/images/playstore.png", | ||
"userInterfaceStyle": "automatic", | ||
"scheme": "eurofurence", | ||
"splash": { | ||
"image": "./assets/images/playstore.png", | ||
"resizeMode": "contain", | ||
"backgroundColor": "#035451" | ||
}, | ||
"updates": { | ||
"fallbackToCacheTimeout": 0 | ||
}, | ||
"assetBundlePatterns": [ | ||
"assets/**/*", | ||
"android/**/*" | ||
], | ||
"ios": { | ||
"supportsTablet": true | ||
}, | ||
"android": { | ||
"package": "org.eurofurence.connavigator", | ||
"googleServicesFile": "./assets/android/google-services.json", | ||
"splash": { | ||
"resizeMode": "native" | ||
}, | ||
"adaptiveIcon": { | ||
"foregroundImage": "./assets/images/playstore.png", | ||
"backgroundColor": "#006459" | ||
}, | ||
"intentFilters": [ | ||
{ | ||
"action": "VIEW", | ||
"autoVerify": false, | ||
"data": [ | ||
{ | ||
"scheme": "https", | ||
"host": "app.eurofurence.org", | ||
"pathPrefix": "/EF26/Web/" | ||
} | ||
], | ||
"category": [ | ||
"BROWSABLE", | ||
"DEFAULT" | ||
] | ||
} | ||
], | ||
"permissions": [ | ||
"INTERNET", | ||
"VIBRATE", | ||
"WRITE_EXTERNAL_STORAGE" | ||
] | ||
}, | ||
"web": { | ||
"favicon": "./assets/images/playstore.png", | ||
"config": { | ||
"firebase": { | ||
"apiKey": "AIzaSyCF365l8zUac096MFPLUtbPE6sqH182G2Q", | ||
"authDomain": "eurofurence-de86f.firebaseapp.com", | ||
"databaseURL": "https://eurofurence-de86f.firebaseio.com", | ||
"projectId": "eurofurence-de86f", | ||
"storageBucket": "eurofurence-de86f.appspot.com", | ||
"messagingSenderId": "1003745003618", | ||
"appId": "1:1003745003618:web:6eca6a1ec8f5d5bfe9e93b", | ||
"measurementId": "G-83EP75M02N" | ||
} | ||
} | ||
}, | ||
"plugins": [ | ||
"sentry-expo", | ||
[ | ||
"expo-notifications", | ||
{ | ||
"icon": "./assets/images/notification.png", | ||
"color": "#006459" | ||
} | ||
] | ||
], | ||
"hooks": { | ||
"postPublish": [ | ||
{ | ||
"file": "sentry-expo/upload-sourcemaps", | ||
"config": { | ||
"organization": "eurofurence", | ||
"project": "ef-app_react-native", | ||
"authToken": false, | ||
"setCommits": true | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
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,60 @@ | ||
import _ from "lodash"; | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { StyleSheet } from "react-native"; | ||
|
||
import { Label } from "../../components/Atoms/Label"; | ||
import { Button } from "../../components/Containers/Button"; | ||
import { Col } from "../../components/Containers/Col"; | ||
import { Row } from "../../components/Containers/Row"; | ||
import { useAppDispatch, useAppSelector } from "../../store"; | ||
import { setTheme } from "../../store/settings.slice"; | ||
|
||
const useableThemes = [undefined, "light", "dark"]; | ||
export const ThemePicker = () => { | ||
const { t } = useTranslation("Settings", { keyPrefix: "theme" }); | ||
const dispatch = useAppDispatch(); | ||
const theme = useAppSelector((state) => state.settingsSlice.theme); | ||
|
||
return ( | ||
<Col type={"stretch"}> | ||
<Label variant={"bold"}>{t("title")}</Label> | ||
<Label variant={"narrow"}>{t("description")}</Label> | ||
|
||
<Row type={"center"} variant={"center"} style={styles.selector}> | ||
<Button style={[styles.button, styles.left]} outline={theme === undefined} onPress={() => dispatch(setTheme(undefined))}> | ||
{t("system")} | ||
</Button> | ||
{!useableThemes.includes(theme) && ( | ||
<Button style={styles.button} outline onPress={() => setTheme(theme)}> | ||
{_.capitalize(theme)} | ||
</Button> | ||
)} | ||
<Button style={styles.button} outline={theme === "light"} onPress={() => dispatch(setTheme("light"))}> | ||
{t("light")} | ||
</Button> | ||
<Button style={[styles.button, styles.right]} outline={theme === "dark"} onPress={() => dispatch(setTheme("dark"))}> | ||
{t("dark")} | ||
</Button> | ||
</Row> | ||
</Col> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
selector: { | ||
marginTop: 16, | ||
}, | ||
button: { | ||
flexGrow: 1, | ||
borderRadius: 0, | ||
}, | ||
left: { | ||
borderBottomLeftRadius: 16, | ||
borderTopLeftRadius: 16, | ||
}, | ||
right: { | ||
borderTopRightRadius: 16, | ||
borderBottomRightRadius: 16, | ||
}, | ||
}); |
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
Oops, something went wrong.