mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 20:49:16 +00:00
updating seal modal
This commit is contained in:
parent
1d3f4caf55
commit
8491171b82
@ -201,7 +201,7 @@ export function Settings() {
|
|||||||
<View style={styles.modalContainer}>
|
<View style={styles.modalContainer}>
|
||||||
<View style={styles.modalClose}>
|
<View style={styles.modalClose}>
|
||||||
<TouchableOpacity activeOpacity={1} onPress={actions.hideEditSeal}>
|
<TouchableOpacity activeOpacity={1} onPress={actions.hideEditSeal}>
|
||||||
<MatIcons name="close" size={20} color={Colors.text} />
|
<MatIcons name="close" size={20} color={Colors.descriptionText} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<Text style={styles.modalHeader}>{ state.strings.sealedTopics }</Text>
|
<Text style={styles.modalHeader}>{ state.strings.sealedTopics }</Text>
|
||||||
@ -212,17 +212,31 @@ export function Settings() {
|
|||||||
<TextInput style={styles.inputText} value={state.sealPassword} onChangeText={actions.setSealPassword}
|
<TextInput style={styles.inputText} value={state.sealPassword} onChangeText={actions.setSealPassword}
|
||||||
autoCapitalize={'none'} secureTextEntry={state.hidePassword} placeholder={state.strings.password}
|
autoCapitalize={'none'} secureTextEntry={state.hidePassword} placeholder={state.strings.password}
|
||||||
placeholderTextColor={Colors.inputPlaceholder} />
|
placeholderTextColor={Colors.inputPlaceholder} />
|
||||||
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showPassword}>
|
{ state.hidePassword && (
|
||||||
<MatIcons name="eye-outline" size={16} color={Colors.inputPlaceholder} />
|
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showPassword}>
|
||||||
</TouchableOpacity>
|
<MatIcons name="eye-outline" size={16} color={Colors.inputPlaceholder} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
{ !state.hidePassword && (
|
||||||
|
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.hidePassword}>
|
||||||
|
<MatIcons name="eye-off-outline" size={16} color={Colors.inputPlaceholder} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.modalInput}>
|
<View style={styles.modalInput}>
|
||||||
<TextInput style={styles.inputText} value={state.sealConfirm} onChangeText={actions.setSealConfirm}
|
<TextInput style={styles.inputText} value={state.sealConfirm} onChangeText={actions.setSealConfirm}
|
||||||
autoCapitalize={'none'} secureTextEntry={state.hideConfirm} placeholder={state.strings.confirmPassword}
|
autoCapitalize={'none'} secureTextEntry={state.hideConfirm} placeholder={state.strings.confirmPassword}
|
||||||
placeholderTextColor={Colors.inputPlaceholder} />
|
placeholderTextColor={Colors.inputPlaceholder} />
|
||||||
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showConfirm}>
|
{ state.hideConfirm && (
|
||||||
<MatIcons name="eye-outline" size={16} color={Colors.inputPlaceholder} />
|
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showConfirm}>
|
||||||
</TouchableOpacity>
|
<MatIcons name="eye-outline" size={16} color={Colors.inputPlaceholder} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
{ !state.hideConfirm && (
|
||||||
|
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showConfirm}>
|
||||||
|
<MatIcons name="eye-off-outline" size={16} color={Colors.inputPlaceholder} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
{ state.sealPassword === state.sealConfirm && state.sealPassword && (
|
{ state.sealPassword === state.sealConfirm && state.sealPassword && (
|
||||||
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={actions.generateKey}>
|
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={actions.generateKey}>
|
||||||
@ -240,7 +254,9 @@ export function Settings() {
|
|||||||
<Text style={styles.modalDescription}>{ state.strings.sealLocked }</Text>
|
<Text style={styles.modalDescription}>{ state.strings.sealLocked }</Text>
|
||||||
)}
|
)}
|
||||||
{ state.sealEnabled && state.sealUnlocked && (
|
{ state.sealEnabled && state.sealUnlocked && (
|
||||||
<Text style={styles.modalDescritpion}>{ state.strings.sealUnlocked }</Text>
|
<>
|
||||||
|
<Text style={styles.modalDescription}>{ state.strings.sealUnlocked }</Text>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
|
@ -37,7 +37,7 @@ export function useSettings() {
|
|||||||
const sealKey = account.state.sealKey;
|
const sealKey = account.state.sealKey;
|
||||||
const sealEnabled = seal?.publicKey != null;
|
const sealEnabled = seal?.publicKey != null;
|
||||||
const sealUnlocked = seal?.publicKey === sealKey?.public && sealKey?.private && sealKey?.public;
|
const sealUnlocked = seal?.publicKey === sealKey?.public && sealKey?.private && sealKey?.public;
|
||||||
updateState({ sealable, seal, sealKey, sealEnabled: false, sealUnlocked });
|
updateState({ sealable, seal, sealKey, sealEnabled, sealUnlocked });
|
||||||
}, [account.state]);
|
}, [account.state]);
|
||||||
|
|
||||||
const unlock = async () => {
|
const unlock = async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user