Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/warn when replacing #2176

Merged
merged 42 commits into from
Feb 11, 2021
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
88b5040
mock login changes
rickycodes Jan 26, 2021
145c996
mock warning modal
rickycodes Jan 27, 2021
3e0c74f
mock delete modal
rickycodes Jan 27, 2021
872e07f
mock delete warning and submitDelete
rickycodes Jan 27, 2021
dc0d64c
Add isTextDelete
rickycodes Jan 27, 2021
6ca3cb8
Add autoFocus
rickycodes Jan 27, 2021
fe79bd8
clean up
rickycodes Jan 27, 2021
fc7206e
"delete"
rickycodes Jan 27, 2021
02a5a42
undo design changes
rickycodes Jan 27, 2021
c63a242
Add en translations
rickycodes Jan 28, 2021
9d589d3
Update unit tests
rickycodes Jan 28, 2021
282a69e
fix
rickycodes Jan 28, 2021
9bb4fd5
Make this async await and catch and log failure
rickycodes Jan 28, 2021
a4ac42e
Remove 12-word
rickycodes Jan 28, 2021
639d476
Adjust lineHeight
rickycodes Jan 28, 2021
c201aed
fix typo
rickycodes Feb 1, 2021
3d4d047
Add logic to show delete notification
rickycodes Feb 1, 2021
b29e786
Hide back button
rickycodes Feb 2, 2021
cdd14f9
Disable hardware back button press
rickycodes Feb 2, 2021
4245333
Add notification
rickycodes Feb 2, 2021
2cb85bc
Add closeButtonDisabled functionality
rickycodes Feb 2, 2021
647a65e
Update styles
rickycodes Feb 2, 2021
524bba0
Hide back button better on Congratulations screen
rickycodes Feb 2, 2021
4923e92
Update translation
rickycodes Feb 4, 2021
2de534e
Add breakpoint for small devices
rickycodes Feb 4, 2021
f7ecce9
add missing "a"
rickycodes Feb 4, 2021
3e450ef
fix warning modal
rickycodes Feb 4, 2021
096fc2a
Clean up BaseNotification component
rickycodes Feb 8, 2021
aa9fd1e
Remove added styles
rickycodes Feb 8, 2021
f341a50
Remove eslint-disable-next-line
rickycodes Feb 8, 2021
bd56293
Use InteractionManager
Feb 10, 2021
bd5206a
Remove empty onHide
rickycodes Feb 10, 2021
26ab86e
update empty callback
rickycodes Feb 10, 2021
80b3477
Cleanup
rickycodes Feb 10, 2021
89a3f45
Add flexDirection: 'row'
Feb 10, 2021
e0ca1af
Move styles to WarningExistingUserModal
Feb 10, 2021
6663d78
Dismiss keyboard
Feb 10, 2021
629baa8
Add strings to locales
rickycodes Feb 10, 2021
e70c70e
Simplify
rickycodes Feb 10, 2021
02e0a17
Add loading screen for delete
rickycodes Feb 11, 2021
61f671f
Actually delete wallet
rickycodes Feb 10, 2021
193c0fe
Fix modal tap area
Feb 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add notification
  • Loading branch information
rickycodes committed Feb 11, 2021
commit 4245333d817f2fe36c192124e2aaca8e3edc3aa9
57 changes: 56 additions & 1 deletion app/components/Views/Onboarding/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import PubNubWrapper from '../../../util/syncWithExtension';
import ActionModal from '../../UI/ActionModal';
import Logger from '../../../util/Logger';
import Device from '../../../util/Device';
import BaseNotification from '../../UI/Notification/BaseNotification';
import Animated, { Easing } from 'react-native-reanimated';
import ElevatedView from 'react-native-elevated-view';
import { passwordSet, seedphraseBackedUp } from '../../../actions/user';
import { setLockTime } from '../../../actions/settings';
import AppConstants from '../../../core/AppConstants';
Expand Down Expand Up @@ -138,6 +141,19 @@ const styles = StyleSheet.create({
column: {
marginVertical: 24,
alignItems: 'flex-start'
},
modalTypeView: {
position: 'absolute',
bottom: 0,
paddingBottom: Device.isIphoneX() ? 20 : 10,
left: 0,
right: 0,
backgroundColor: colors.transparent
},
notificationContainer: {
flex: 0.1,
flexDirection: 'row',
alignItems: 'flex-end'
}
});

Expand Down Expand Up @@ -192,6 +208,20 @@ class Onboarding extends PureComponent {
seedphraseBackedUp: PropTypes.func
};

notificationAnimated = new Animated.Value(100);
detailsYAnimated = new Animated.Value(0);
actionXAnimated = new Animated.Value(0);
detailsAnimated = new Animated.Value(0);

animatedTimingStart = (animatedRef, toValue) => {
Animated.timing(animatedRef, {
toValue,
duration: 500,
easing: Easing.linear,
useNativeDriver: true
}).start();
};

state = {
warningModalVisible: false,
loading: false,
Expand All @@ -217,7 +247,11 @@ class Onboarding extends PureComponent {
const del = this.props.navigation.getParam('delete', null);
if (del) {
// show notification
console.log('show notification');
this.animatedTimingStart(this.notificationAnimated, 0);
// hide notification
setTimeout(() => {
this.animatedTimingStart(this.notificationAnimated, 400);
}, 2000);

// Disable back press
const hardwareBackPress = () => true;
Expand Down Expand Up @@ -563,6 +597,25 @@ class Onboarding extends PureComponent {
);
}

handleSimpleNotification = () => {
const notificationTitle = 'title';
const notificationDescription = 'description';
const notificationStatus = 'success';
rickycodes marked this conversation as resolved.
Show resolved Hide resolved
return (
<ElevatedView style={styles.modalTypeView} elevation={100}>
<Animated.View
style={[styles.notificationContainer, { transform: [{ translateY: this.notificationAnimated }] }]}
>
<BaseNotification
status={notificationStatus}
data={{ title: notificationTitle, description: notificationDescription }}
onHide={() => ({})}
/>
</Animated.View>
</ElevatedView>
);
};

render() {
const { qrCodeModalVisible, loading, existingUser } = this.state;

Expand Down Expand Up @@ -604,6 +657,8 @@ class Onboarding extends PureComponent {
</OnboardingScreenWithBg>
<FadeOutOverlay />

<View>{this.handleSimpleNotification()}</View>

<WarningExistingUserModal
warningModalVisible={this.state.warningModalVisible}
onCancelPress={this.warningCallback}
Expand Down