mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
moving activity indicator to button
This commit is contained in:
parent
ef75799ed5
commit
04e4da7aa3
@ -339,7 +339,6 @@ export function Settings() {
|
|||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<Text style={styles.modalHeader}>{ state.strings.sealedTopics }</Text>
|
<Text style={styles.modalHeader}>{ state.strings.sealedTopics }</Text>
|
||||||
<ActivityIndicator style={styles.modalBusy} animating={busy} color={Colors.primary} />
|
|
||||||
{ !state.sealEnabled && (
|
{ !state.sealEnabled && (
|
||||||
<>
|
<>
|
||||||
<Text style={styles.modalDescription}>{ state.strings.sealUnset }</Text>
|
<Text style={styles.modalDescription}>{ state.strings.sealUnset }</Text>
|
||||||
@ -355,7 +354,12 @@ export function Settings() {
|
|||||||
|
|
||||||
{ state.sealPassword && (
|
{ state.sealPassword && (
|
||||||
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.generateKey)}>
|
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.generateKey)}>
|
||||||
|
{ busy && (
|
||||||
|
<ActivityIndicator style={styles.modalBusy} animating={true} color={Colors.primaryButtonText} />
|
||||||
|
)}
|
||||||
|
{ !busy && (
|
||||||
<Text style={styles.enabledButtonText}>{ state.strings.generate }</Text>
|
<Text style={styles.enabledButtonText}>{ state.strings.generate }</Text>
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
{ !state.sealPassword && (
|
{ !state.sealPassword && (
|
||||||
@ -382,7 +386,12 @@ export function Settings() {
|
|||||||
<View style={styles.buttons}>
|
<View style={styles.buttons}>
|
||||||
{ state.sealPassword && (
|
{ state.sealPassword && (
|
||||||
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.unlockKey)}>
|
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.unlockKey)}>
|
||||||
|
{ busy && (
|
||||||
|
<ActivityIndicator style={styles.modalBusy} animating={true} color={Colors.primaryButtonText} />
|
||||||
|
)}
|
||||||
|
{ !busy && (
|
||||||
<Text style={styles.enabledButtonText}>{ state.strings.unlock }</Text>
|
<Text style={styles.enabledButtonText}>{ state.strings.unlock }</Text>
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
{ !state.sealPassword && (
|
{ !state.sealPassword && (
|
||||||
@ -400,7 +409,12 @@ export function Settings() {
|
|||||||
<>
|
<>
|
||||||
<Text style={styles.modalDescription}>{ state.strings.sealUnlocked }</Text>
|
<Text style={styles.modalDescription}>{ state.strings.sealUnlocked }</Text>
|
||||||
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.disableKey)}>
|
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.disableKey)}>
|
||||||
|
{ busy && (
|
||||||
|
<ActivityIndicator style={styles.modalBusy} animating={true} color={Colors.primaryButtonText} />
|
||||||
|
)}
|
||||||
|
{ !busy && (
|
||||||
<Text style={styles.enabledButtonText}>{ state.strings.disable }</Text>
|
<Text style={styles.enabledButtonText}>{ state.strings.disable }</Text>
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity activeOpacity={1} onPress={actions.showSealUpdate}>
|
<TouchableOpacity activeOpacity={1} onPress={actions.showSealUpdate}>
|
||||||
<Text style={styles.modeText}>{ state.strings.changeKey }</Text>
|
<Text style={styles.modeText}>{ state.strings.changeKey }</Text>
|
||||||
@ -422,7 +436,12 @@ export function Settings() {
|
|||||||
/>
|
/>
|
||||||
{ state.sealDelete === state.strings.deleteKey && (
|
{ state.sealDelete === state.strings.deleteKey && (
|
||||||
<TouchableOpacity style={styles.dangerButton} activeOpacity={1} onPress={() => sealAction(actions.removeKey)}>
|
<TouchableOpacity style={styles.dangerButton} activeOpacity={1} onPress={() => sealAction(actions.removeKey)}>
|
||||||
|
{ busy && (
|
||||||
|
<ActivityIndicator style={styles.modalBusy} animating={true} color={Colors.primaryButtonText} />
|
||||||
|
)}
|
||||||
|
{ !busy && (
|
||||||
<Text style={styles.dangerButtonText}>{ state.strings.delete }</Text>
|
<Text style={styles.dangerButtonText}>{ state.strings.delete }</Text>
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
{ state.sealDelete !== state.strings.deleteKey && (
|
{ state.sealDelete !== state.strings.deleteKey && (
|
||||||
@ -455,7 +474,12 @@ export function Settings() {
|
|||||||
|
|
||||||
{ state.sealPassword && (
|
{ state.sealPassword && (
|
||||||
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.updateKey)}>
|
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={() => sealAction(actions.updateKey)}>
|
||||||
|
{ busy && (
|
||||||
|
<ActivityIndicator style={styles.modalBusy} animating={true} color={Colors.primaryButtonText} />
|
||||||
|
)}
|
||||||
|
{ !busy && (
|
||||||
<Text style={styles.enabledButtonText}>{ state.strings.update }</Text>
|
<Text style={styles.enabledButtonText}>{ state.strings.update }</Text>
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
{ !state.sealPassword && (
|
{ !state.sealPassword && (
|
||||||
|
@ -114,7 +114,6 @@ export const styles = StyleSheet.create({
|
|||||||
notifications: {
|
notifications: {
|
||||||
transform: [{ scaleX: .6 }, { scaleY: .6 }],
|
transform: [{ scaleX: .6 }, { scaleY: .6 }],
|
||||||
},
|
},
|
||||||
|
|
||||||
modalOverlay: {
|
modalOverlay: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@ -124,7 +123,7 @@ export const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
modalContainer: {
|
modalContainer: {
|
||||||
backgroundColor: Colors.modalBase,
|
backgroundColor: Colors.modalBase,
|
||||||
width: '80%',
|
width: '90%',
|
||||||
maxWidth: 400,
|
maxWidth: 400,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@ -133,6 +132,7 @@ export const styles = StyleSheet.create({
|
|||||||
modalHeader: {
|
modalHeader: {
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
paddingTop: 16,
|
paddingTop: 16,
|
||||||
|
paddingBottom: 16,
|
||||||
color: Colors.labelText,
|
color: Colors.labelText,
|
||||||
fontFamily: 'Roboto',
|
fontFamily: 'Roboto',
|
||||||
},
|
},
|
||||||
@ -194,12 +194,13 @@ export const styles = StyleSheet.create({
|
|||||||
enabledButton: {
|
enabledButton: {
|
||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
marginBottom: 16,
|
marginBottom: 16,
|
||||||
paddingTop: 8,
|
|
||||||
paddingBottom: 8,
|
|
||||||
paddingLeft: 32,
|
|
||||||
paddingRight: 32,
|
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: Colors.primaryButton,
|
backgroundColor: Colors.primaryButton,
|
||||||
|
width: '33%',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
height: 32,
|
||||||
},
|
},
|
||||||
enabledButtonText: {
|
enabledButtonText: {
|
||||||
color: Colors.primaryButtonText,
|
color: Colors.primaryButtonText,
|
||||||
@ -208,12 +209,13 @@ export const styles = StyleSheet.create({
|
|||||||
disabledButton: {
|
disabledButton: {
|
||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
marginBottom: 16,
|
marginBottom: 16,
|
||||||
paddingTop: 8,
|
|
||||||
paddingBottom: 8,
|
|
||||||
paddingLeft: 32,
|
|
||||||
paddingRight: 32,
|
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: Colors.disabledButton,
|
backgroundColor: Colors.disabledButton,
|
||||||
|
width: '33%',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
height: 32,
|
||||||
},
|
},
|
||||||
disabledButtonText: {
|
disabledButtonText: {
|
||||||
color: Colors.disabledButtonText,
|
color: Colors.disabledButtonText,
|
||||||
@ -222,12 +224,13 @@ export const styles = StyleSheet.create({
|
|||||||
dangerButton: {
|
dangerButton: {
|
||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
marginBottom: 16,
|
marginBottom: 16,
|
||||||
paddingTop: 8,
|
|
||||||
paddingBottom: 8,
|
|
||||||
paddingLeft: 32,
|
|
||||||
paddingRight: 32,
|
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: Colors.dangerButton,
|
backgroundColor: Colors.dangerButton,
|
||||||
|
width: '33%',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
height: 32,
|
||||||
},
|
},
|
||||||
dangerButtonText: {
|
dangerButtonText: {
|
||||||
color: Colors.dangerButtonText,
|
color: Colors.dangerButtonText,
|
||||||
@ -253,12 +256,13 @@ export const styles = StyleSheet.create({
|
|||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
marginBottom: 16,
|
marginBottom: 16,
|
||||||
marginRight: 16,
|
marginRight: 16,
|
||||||
paddingTop: 8,
|
|
||||||
paddingBottom: 8,
|
|
||||||
paddingLeft: 32,
|
|
||||||
paddingRight: 32,
|
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: Colors.cancelButton,
|
backgroundColor: Colors.cancelButton,
|
||||||
|
width: '33%',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
height: 32,
|
||||||
},
|
},
|
||||||
cancelButtonText: {
|
cancelButtonText: {
|
||||||
color: Colors.cancelButtonText,
|
color: Colors.cancelButtonText,
|
||||||
@ -267,12 +271,13 @@ export const styles = StyleSheet.create({
|
|||||||
promptButton: {
|
promptButton: {
|
||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
marginBottom: 16,
|
marginBottom: 16,
|
||||||
paddingTop: 8,
|
|
||||||
paddingBottom: 8,
|
|
||||||
paddingLeft: 32,
|
|
||||||
paddingRight: 32,
|
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: Colors.primaryButton,
|
backgroundColor: Colors.primaryButton,
|
||||||
|
width: '33%',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
height: 32,
|
||||||
},
|
},
|
||||||
hintButtons: {
|
hintButtons: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
Loading…
Reference in New Issue
Block a user