mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +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.modalClose}>
|
||||
<TouchableOpacity activeOpacity={1} onPress={actions.hideEditSeal}>
|
||||
<MatIcons name="close" size={20} color={Colors.text} />
|
||||
<MatIcons name="close" size={20} color={Colors.descriptionText} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<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}
|
||||
autoCapitalize={'none'} secureTextEntry={state.hidePassword} placeholder={state.strings.password}
|
||||
placeholderTextColor={Colors.inputPlaceholder} />
|
||||
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showPassword}>
|
||||
<MatIcons name="eye-outline" size={16} color={Colors.inputPlaceholder} />
|
||||
</TouchableOpacity>
|
||||
{ state.hidePassword && (
|
||||
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showPassword}>
|
||||
<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 style={styles.modalInput}>
|
||||
<TextInput style={styles.inputText} value={state.sealConfirm} onChangeText={actions.setSealConfirm}
|
||||
autoCapitalize={'none'} secureTextEntry={state.hideConfirm} placeholder={state.strings.confirmPassword}
|
||||
placeholderTextColor={Colors.inputPlaceholder} />
|
||||
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showConfirm}>
|
||||
<MatIcons name="eye-outline" size={16} color={Colors.inputPlaceholder} />
|
||||
</TouchableOpacity>
|
||||
{ state.hideConfirm && (
|
||||
<TouchableOpacity style={styles.inputVisibility} activeOpacity={1} onPress={actions.showConfirm}>
|
||||
<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>
|
||||
{ state.sealPassword === state.sealConfirm && state.sealPassword && (
|
||||
<TouchableOpacity style={styles.enabledButton} activeOpacity={1} onPress={actions.generateKey}>
|
||||
@ -240,7 +254,9 @@ export function Settings() {
|
||||
<Text style={styles.modalDescription}>{ state.strings.sealLocked }</Text>
|
||||
)}
|
||||
{ state.sealEnabled && state.sealUnlocked && (
|
||||
<Text style={styles.modalDescritpion}>{ state.strings.sealUnlocked }</Text>
|
||||
<>
|
||||
<Text style={styles.modalDescription}>{ state.strings.sealUnlocked }</Text>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
</KeyboardAvoidingView>
|
||||
|
@ -37,7 +37,7 @@ export function useSettings() {
|
||||
const sealKey = account.state.sealKey;
|
||||
const sealEnabled = seal?.publicKey != null;
|
||||
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]);
|
||||
|
||||
const unlock = async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user