Preferences window styles

This commit is contained in:
Samuel Elliott 2022-09-10 20:14:42 +01:00
parent 809658ac7b
commit eaa0c0810e
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6

View File

@ -122,11 +122,13 @@ export default function Preferences(props: PreferencesProps) {
style={styles.checkbox} style={styles.checkbox}
/> />
<TouchableOpacity style={styles.checkboxLabel} onPress={() => setOpenAtLogin(!login_item.openAtLogin)}> <TouchableOpacity style={styles.checkboxLabel} onPress={() => setOpenAtLogin(!login_item.openAtLogin)}>
<Text style={theme.text}>Open at login</Text> <Text style={[styles.checkboxLabelText, theme.text]}>Open at login</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
{ipc.platform === 'darwin' ? <View style={styles.checkboxContainer}> {ipc.platform === 'darwin' ? <View
style={[styles.checkboxContainer, !login_item.openAtLogin ? styles.disabled : null]}
>
<CheckBox <CheckBox
value={login_item.openAsHidden} value={login_item.openAsHidden}
onValueChange={setOpenAsHidden} onValueChange={setOpenAsHidden}
@ -134,21 +136,23 @@ export default function Preferences(props: PreferencesProps) {
color={'#' + (accent_colour ?? DEFAULT_ACCENT_COLOUR)} color={'#' + (accent_colour ?? DEFAULT_ACCENT_COLOUR)}
style={styles.checkbox} style={styles.checkbox}
/> />
<TouchableOpacity style={styles.checkboxLabel} onPress={() => setOpenAsHidden(!login_item.openAsHidden)}> <TouchableOpacity disabled={!login_item.openAtLogin} style={styles.checkboxLabel}
<Text style={theme.text}>Open in background</Text> onPress={() => setOpenAsHidden(!login_item.openAsHidden)}
>
<Text style={[styles.checkboxLabelText, theme.text]}>Open in background</Text>
</TouchableOpacity> </TouchableOpacity>
</View> : null} </View> : null}
</View> </View>
</View> : null} </View> : null}
<View style={styles.section}> {/* <View style={styles.section}>
<View style={styles.sectionLeft}> <View style={styles.sectionLeft}>
<Text style={[styles.label, theme.text]}>Sleep</Text> <Text style={[styles.label, theme.text]}>Sleep</Text>
</View> </View>
<View style={styles.sectionRight}> <View style={styles.sectionRight}>
<Text style={theme.text}>Prevent sleep menu here</Text> <Text style={theme.text}>Prevent sleep menu here</Text>
</View> </View>
</View> </View> */}
<View style={styles.section}> <View style={styles.section}>
<View style={styles.sectionLeft}> <View style={styles.sectionLeft}>
@ -174,7 +178,7 @@ export default function Preferences(props: PreferencesProps) {
<Text style={[styles.header, theme.text]}>Friend code</Text> <Text style={[styles.header, theme.text]}>Friend code</Text>
<Text style={[styles.help, theme.text]}>Adding your friend code will also show your Nintendo Switch user icon in Discord.</Text> <Text style={[styles.help, theme.text]}>Adding your friend code will also show your Nintendo Switch user icon in Discord.</Text>
{is_discord_friend_code_self ? <> {is_discord_friend_code_self ? <View style={styles.friendCodeCheckbox}>
<View style={styles.checkboxContainer}> <View style={styles.checkboxContainer}>
<CheckBox <CheckBox
value={!!discord_options.friend_code} value={!!discord_options.friend_code}
@ -192,13 +196,15 @@ export default function Preferences(props: PreferencesProps) {
Set custom friend code Set custom friend code
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
</> : <TextInput value={discord_friend_code} onChangeText={setDiscordFriendCode} </View> : <View style={styles.friendCodeInput}>
placeholder="0000-0000-0000" <TextInput value={discord_friend_code} onChangeText={setDiscordFriendCode}
style={[styles.textInput, theme.textInput]} />} placeholder="0000-0000-0000"
style={[styles.textInput, theme.textInput]} />
</View>}
{/* <View style={styles.header} /> */} {/* <View style={styles.header} /> */}
<View style={styles.checkboxContainer}> <View style={[styles.checkboxContainer, styles.checkboxContainerMargin]}>
<CheckBox <CheckBox
value={discord_options?.show_console_online ?? false} value={discord_options?.show_console_online ?? false}
onValueChange={setDiscordShowConsoleOnline} onValueChange={setDiscordShowConsoleOnline}
@ -206,9 +212,10 @@ export default function Preferences(props: PreferencesProps) {
style={styles.checkbox} style={styles.checkbox}
/> />
<TouchableOpacity style={styles.checkboxLabel} onPress={() => setDiscordShowConsoleOnline(!discord_options?.show_console_online)}> <TouchableOpacity style={styles.checkboxLabel} onPress={() => setDiscordShowConsoleOnline(!discord_options?.show_console_online)}>
<Text style={theme.text}>Show "Not playing" when a console linked to your account is online, but you are not selected in a game</Text> <Text style={[styles.checkboxLabelText, theme.text]}>Show inactive presence</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<Text style={[styles.help, theme.text]}>Shows "Not playing" when a console linked to your account is online, but you are not selected in a game.</Text>
<Text style={[styles.header, theme.text]}>Play time</Text> <Text style={[styles.header, theme.text]}>Play time</Text>
@ -257,7 +264,6 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
}, },
sectionLeft: { sectionLeft: {
// flex: 0,
width: '30%', width: '30%',
marginRight: 30, marginRight: 30,
}, },
@ -301,20 +307,33 @@ const styles = StyleSheet.create({
fontSize: 13, fontSize: 13,
}, },
checkboxContainer: { checkboxContainer: {
marginBottom: 8,
flex: 1, flex: 1,
flexBasis: 'auto', flexBasis: 'auto',
// marginRight: 20,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
// maxWidth: 1, },
checkboxContainerMargin: {
marginTop: 8,
marginBottom: 0,
}, },
checkbox: { checkbox: {
marginRight: 10, marginRight: 10,
marginVertical: 8,
}, },
checkboxLabel: { checkboxLabel: {
flex: 1, flex: 1,
marginVertical: 8, },
checkboxLabelText: {
},
disabled: {
opacity: 0.8,
},
friendCodeCheckbox: {
marginTop: 8,
},
friendCodeInput: {
marginBottom: 4,
}, },
button: { button: {