Files
notesnook/apps/mobile/loading.js

106 lines
2.7 KiB
JavaScript
Raw Normal View History

2020-03-15 10:03:13 +05:00
import React from 'react';
import * as Animatable from 'react-native-animatable';
2020-03-15 11:03:35 +05:00
import {DialogManager} from './src/components/DialogManager';
import {Toast} from './src/components/Toast';
2020-04-22 12:41:41 +05:00
import {useTracked} from './src/provider';
2020-10-13 17:02:14 +05:00
import {dWidth} from './src/utils';
import {SIZE, WEIGHT} from "./src/utils/SizeUtils";
2020-03-15 10:03:13 +05:00
export const Loading = () => {
const [state, dispatch] = useTracked();
const {colors, loading} = state;
2019-11-15 01:17:59 +05:00
2020-03-15 10:03:13 +05:00
return (
<>
<Animatable.View
transition={['translateX']}
useNativeDriver={true}
duration={1000}
delay={2500}
style={{
width: '50%',
left: 0,
height: '100%',
position: 'absolute',
backgroundColor: colors.accent,
justifyContent: 'center',
alignItems: 'flex-end',
zIndex: 999,
transform: [
{
2020-10-13 17:02:14 +05:00
translateX: loading ? 0 : -dWidth * 2,
2020-03-15 10:03:13 +05:00
},
],
}}>
<Animatable.Text
animation="fadeIn"
duration={300}
delay={150}
style={{
color: 'white',
fontFamily: WEIGHT.bold,
fontSize: SIZE.xxl,
}}>
notes
</Animatable.Text>
<Animatable.Text
animation="fadeIn"
duration={300}
delay={600}
style={{
color: 'white',
fontFamily: WEIGHT.regular,
fontSize: SIZE.md,
marginTop: 15,
}}>
A safe plac
</Animatable.Text>
</Animatable.View>
<Animatable.View
transition={['translateX']}
useNativeDriver={true}
duration={1000}
delay={2500}
style={{
width: '50%',
right: 0,
height: '100%',
position: 'absolute',
backgroundColor: colors.accent,
justifyContent: 'center',
alignItems: 'flex-start',
zIndex: 999,
transform: [
{
2020-10-13 17:02:14 +05:00
translateX: loading ? 0 : dWidth * 2,
2020-03-15 10:03:13 +05:00
},
],
}}>
<Animatable.Text
animation="fadeIn"
duration={300}
delay={150}
style={{
color: 'white',
fontFamily: WEIGHT.bold,
fontSize: SIZE.xxl,
}}>
nook
</Animatable.Text>
<Animatable.Text
animation="fadeIn"
duration={300}
delay={600}
style={{
color: 'white',
fontFamily: WEIGHT.regular,
fontSize: SIZE.md,
marginTop: 15,
}}>
e to write
</Animatable.Text>
</Animatable.View>
2020-05-18 16:44:07 +05:00
2020-03-15 10:03:13 +05:00
</>
);
};