A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix flickering
ammarahm-edd01b13f707c4
diff --git a/apps/mobile/src/common/common.js b/apps/mobile/src/common/common.jsindex 7bdb592b8..8b1a5b603 100755--- a/apps/mobile/src/common/common.js+++ b/apps/mobile/src/common/common.js@@ -76,7 +76,7 @@ export const SIZE = {export const br = 5; // border radiusexport const ph = 10; // padding horizontalexport const pv = 10; // padding vertical-export const opacity = 0.85; // active opacity+export const opacity = 0.5; // active opacity// GLOBAL FONTdiff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.jsindex 0faa3ae4f..ef91e5589 100644--- a/apps/mobile/src/components/header/index.js+++ b/apps/mobile/src/components/header/index.js@@ -26,9 +26,7 @@ export const Header = ({const {colors} = state;return (- <Animatable.View- transition={['minHeight', 'marginBottom']}- duration={250}+ <Viewstyle={{flexDirection: 'row',zIndex: 10,@@ -185,6 +183,6 @@ export const Header = ({</TouchableOpacity>) : null}</View>- </Animatable.View>+ </View>);};diff --git a/apps/mobile/src/services/NavigationService.js b/apps/mobile/src/services/NavigationService.jsindex 21785b592..a62d62f28 100755--- a/apps/mobile/src/services/NavigationService.js+++ b/apps/mobile/src/services/NavigationService.js@@ -32,7 +32,7 @@ const fade = props => {const opacity = position.interpolate({inputRange: [index - 0.7, index, index + 0.7],- outputRange: [0.9, 1, 0.9],+ outputRange: [0.7, 1, 0.7],});return {diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.jsindex c7d37231e..1d428244f 100644--- a/apps/mobile/src/views/Login/index.js+++ b/apps/mobile/src/views/Login/index.js@@ -303,8 +303,8 @@ const renderLogin = (colors, navigation) => {style={{}}><Textstyle={{- fontSize: SIZE.sm,- fontFamily: WEIGHT.bold,+ fontSize: SIZE.sm - 1,+ fontFamily: WEIGHT.regular,color: colors.accent,}}>Create a New Account@@ -318,7 +318,7 @@ const renderLogin = (colors, navigation) => {style={{}}><Textstyle={{- fontSize: SIZE.sm,+ fontSize: SIZE.sm - 1,fontFamily: WEIGHT.regular,color: colors.accent,}}>diff --git a/apps/mobile/src/views/Signup/index.js b/apps/mobile/src/views/Signup/index.jsindex bec0f09ee..cf006944b 100644--- a/apps/mobile/src/views/Signup/index.js+++ b/apps/mobile/src/views/Signup/index.js@@ -17,6 +17,15 @@ import Icon from 'react-native-vector-icons/Feather';export const Signup = ({navigation}) => {const [state, dispatch] = useTracked();const {colors, isLoginNavigator} = state;+ const _email = createRef();+ const _pass = createRef();+ const _username = createRef();+ const [email, setEmail] = useState('');+ const [password, setPassword] = useState('');+ const [username, setUsername] = useState('');+ const [invalidEmail, setInvalidEmail] = useState(false);+ const [invalidPassword, setInvalidPassword] = useState(false);+ const [invalidUsername, setInvalidUsername] = useState(false);let isFocused = useIsFocused();@@ -46,309 +55,298 @@ export const Signup = ({navigation}) => {<Viewstyle={{- justifyContent: 'center',- alignItems: 'center',+ justifyContent: DDS.isTab ? 'center' : 'flex-start',width: '100%',+ height: DDS.isTab ? '80%' : '100%',+ alignSelf: 'center',}}>- {renderSignup(colors)}- </View>- </SafeAreaView>- );-};--Signup.navigationOptions = {- header: null,- headerStyle: {- backgroundColor: 'transparent',- borderBottomWidth: 0,- height: 0,- },-};--export default Signup;--const renderSignup = colors => {- const _email = createRef();- const _pass = createRef();- const _username = createRef();- const [email, setEmail] = useState('');- const [password, setPassword] = useState('');- const [username, setUsername] = useState('');- const [invalidEmail, setInvalidEmail] = useState(false);- const [invalidPassword, setInvalidPassword] = useState(false);- const [invalidUsername, setInvalidUsername] = useState(false);-- return (- <View- style={{- justifyContent: DDS.isTab ? 'center' : 'flex-start',- width: '100%',- height: DDS.isTab ? '80%' : '100%',- alignSelf: 'center',- }}>- <View>- <Text- style={{- textAlign: 'right',- marginHorizontal: 12,- fontFamily: WEIGHT.regular,- height: 25,- textAlignVertical: 'bottom',- }}>- {invalidUsername ? (- <Icon name="alert-circle" size={SIZE.sm} color={colors.errorText} />- ) : null}-- {invalidUsername ? ' Username has invalid characters' : ''}- </Text>+ <View>+ <Text+ style={{+ textAlign: 'right',+ marginHorizontal: 12,+ fontFamily: WEIGHT.regular,+ height: 25,+ textAlignVertical: 'bottom',+ }}>+ {invalidUsername ? (+ <Icon+ name="alert-circle"+ size={SIZE.sm}+ color={colors.errorText}+ />+ ) : null}- <TextInput- ref={_username}- onFocus={() => {- if (!invalidUsername) {- _username.current.setNativeProps({- style: {- borderColor: colors.accent,- },- });- }- }}- defaultValue={username}- onBlur={() => {- if (!validateUsername(username)) {- setInvalidUsername(true);- _username.current.setNativeProps({- style: {- color: colors.errorText,- borderColor: colors.errorText,- },- });- } else {- _username.current.setNativeProps({- style: {- borderColor: colors.nav,- },- });- }- }}- textContentType="username"- onChangeText={value => {- setUsername(value);+ {invalidUsername ? ' Username has invalid characters' : ''}+ </Text>- if (invalidUsername && validateUsername(username)) {- setInvalidUsername(false);- _username.current.setNativeProps({- style: {- color: colors.pri,- borderColor: colors.accent,- },- });- }- }}- onSubmitEditing={() => {- if (!validateUsername(username)) {- setInvalidUsername(true);- _username.current.setNativeProps({- style: {- color: colors.errorText,- },- });- }- }}- style={{- padding: pv,- borderWidth: 1.5,- borderColor: colors.nav,- marginHorizontal: 12,- borderRadius: 5,- fontSize: SIZE.md,- fontFamily: WEIGHT.regular,- }}- placeholder="Username (a-z _- 0-9)"- placeholderTextColor={colors.icon}- />+ <TextInput+ ref={_username}+ onFocus={() => {+ if (!invalidUsername) {+ _username.current.setNativeProps({+ style: {+ borderColor: colors.accent,+ },+ });+ }+ }}+ defaultValue={username}+ onBlur={() => {+ if (!validateUsername(username)) {+ setInvalidUsername(true);+ _username.current.setNativeProps({+ style: {+ color: colors.errorText,+ borderColor: colors.errorText,+ },+ });+ } else {+ _username.current.setNativeProps({+ style: {+ borderColor: colors.nav,+ },+ });+ }+ }}+ textContentType="username"+ onChangeText={value => {+ setUsername(value);- <Text- style={{- textAlign: 'right',- marginHorizontal: 12,- fontFamily: WEIGHT.regular,- height: 25,- textAlignVertical: 'bottom',- }}>- {invalidEmail ? (- <Icon name="alert-circle" size={SIZE.sm} color={colors.errorText} />- ) : null}+ if (invalidUsername && validateUsername(username)) {+ setInvalidUsername(false);+ _username.current.setNativeProps({+ style: {+ color: colors.pri,+ borderColor: colors.accent,+ },+ });+ }+ }}+ onSubmitEditing={() => {+ if (!validateUsername(username)) {+ setInvalidUsername(true);+ _username.current.setNativeProps({+ style: {+ color: colors.errorText,+ },+ });+ }+ }}+ style={{+ padding: pv,+ borderWidth: 1.5,+ borderColor: colors.nav,+ marginHorizontal: 12,+ borderRadius: 5,+ fontSize: SIZE.md,+ fontFamily: WEIGHT.regular,+ }}+ placeholder="Username (a-z _- 0-9)"+ placeholderTextColor={colors.icon}+ />- {invalidEmail ? ' Email is invalid' : ''}- </Text>+ <Text+ style={{+ textAlign: 'right',+ marginHorizontal: 12,+ fontFamily: WEIGHT.regular,+ height: 25,+ textAlignVertical: 'bottom',+ }}>+ {invalidEmail ? (+ <Icon+ name="alert-circle"+ size={SIZE.sm}+ color={colors.errorText}+ />+ ) : null}- <TextInput- ref={_email}- onFocus={() => {- if (!invalidEmail) {- _email.current.setNativeProps({- style: {- borderColor: colors.accent,- },- });- }- }}- defaultValue={email}- onBlur={() => {- if (!validateEmail(email)) {- setInvalidEmail(true);- _email.current.setNativeProps({- style: {- color: colors.errorText,- borderColor: colors.errorText,- },- });- } else {- _email.current.setNativeProps({- style: {- borderColor: colors.nav,- },- });- }- }}- textContentType="emailAddress"- onChangeText={value => {- setEmail(value);- if (invalidEmail && validateEmail(email)) {- setInvalidEmail(false);- _email.current.setNativeProps({- style: {- color: colors.pri,- borderColor: colors.accent,- },- });- }- }}- onSubmitEditing={() => {- if (!validateEmail(email)) {- setInvalidEmail(true);- _email.current.setNativeProps({- style: {- color: colors.errorText,- },- });- }- }}- style={{- padding: pv,- borderWidth: 1.5,- borderColor: colors.nav,- marginHorizontal: 12,- borderRadius: 5,- fontSize: SIZE.md,- fontFamily: WEIGHT.regular,- }}- placeholder="Email"- placeholderTextColor={colors.icon}- />+ {invalidEmail ? ' Email is invalid' : ''}+ </Text>- <Text- style={{- textAlign: 'right',- marginHorizontal: 12,- fontFamily: WEIGHT.regular,- height: 25,- textAlignVertical: 'bottom',- }}>- {invalidPassword ? (- <Icon name="alert-circle" size={SIZE.sm} color={colors.errorText} />- ) : null}+ <TextInput+ ref={_email}+ onFocus={() => {+ if (!invalidEmail) {+ _email.current.setNativeProps({+ style: {+ borderColor: colors.accent,+ },+ });+ }+ }}+ defaultValue={email}+ onBlur={() => {+ if (!validateEmail(email)) {+ setInvalidEmail(true);+ _email.current.setNativeProps({+ style: {+ color: colors.errorText,+ borderColor: colors.errorText,+ },+ });+ } else {+ _email.current.setNativeProps({+ style: {+ borderColor: colors.nav,+ },+ });+ }+ }}+ textContentType="emailAddress"+ onChangeText={value => {+ setEmail(value);+ if (invalidEmail && validateEmail(email)) {+ setInvalidEmail(false);+ _email.current.setNativeProps({+ style: {+ color: colors.pri,+ borderColor: colors.accent,+ },+ });+ }+ }}+ onSubmitEditing={() => {+ if (!validateEmail(email)) {+ setInvalidEmail(true);+ _email.current.setNativeProps({+ style: {+ color: colors.errorText,+ },+ });+ }+ }}+ style={{+ padding: pv,+ borderWidth: 1.5,+ borderColor: colors.nav,+ marginHorizontal: 12,+ borderRadius: 5,+ fontSize: SIZE.md,+ fontFamily: WEIGHT.regular,+ }}+ placeholder="Email"+ placeholderTextColor={colors.icon}+ />- {invalidPassword ? ' Password too short' : ''}- </Text>- <TextInput- ref={_pass}- onFocus={() => {- if (!invalidPassword) {- _pass.current.setNativeProps({- style: {- borderColor: colors.accent,- },- });- }- }}- defaultValue={password}- onBlur={() => {- if (!validatePass(password)) {- setInvalidPassword(true);- _pass.current.setNativeProps({- style: {- color: colors.errorText,- borderColor: colors.errorText,- },- });- } else {- _pass.current.setNativeProps({- style: {- borderColor: colors.nav,- },- });- }- }}- onChangeText={value => {- setPassword(value);+ <Text+ style={{+ textAlign: 'right',+ marginHorizontal: 12,+ fontFamily: WEIGHT.regular,+ height: 25,+ textAlignVertical: 'bottom',+ }}>+ {invalidPassword ? (+ <Icon+ name="alert-circle"+ size={SIZE.sm}+ color={colors.errorText}+ />+ ) : null}- if (invalidPassword && validatePass(password)) {- setInvalidPassword(false);- _pass.current.setNativeProps({- style: {- color: colors.pri,- borderColor: colors.accent,- },- });- }- }}- onSubmitEditing={() => {- if (!validatePass(password)) {- setInvalidPassword(true);- _pass.current.setNativeProps({- style: {- color: colors.errorText,- },- });- }- }}- style={{- padding: pv,- borderWidth: 1.5,- borderColor: colors.nav,- marginHorizontal: 12,- borderRadius: 5,- fontSize: SIZE.md,- fontFamily: WEIGHT.regular,- marginBottom: 25,- }}- secureTextEntry={true}- placeholder="Password"- placeholderTextColor={colors.icon}- />+ {invalidPassword ? ' Password too short' : ''}+ </Text>+ <TextInput+ ref={_pass}+ onFocus={() => {+ if (!invalidPassword) {+ _pass.current.setNativeProps({+ style: {+ borderColor: colors.accent,+ },+ });+ }+ }}+ defaultValue={password}+ onBlur={() => {+ if (!validatePass(password)) {+ setInvalidPassword(true);+ _pass.current.setNativeProps({+ style: {+ color: colors.errorText,+ borderColor: colors.errorText,+ },+ });+ } else {+ _pass.current.setNativeProps({+ style: {+ borderColor: colors.nav,+ },+ });+ }+ }}+ onChangeText={value => {+ setPassword(value);- <TouchableOpacity- activeOpacity={opacity}- style={{- padding: pv,- backgroundColor: colors.accent,- borderRadius: 5,- marginHorizontal: 12,- marginBottom: 10,- alignItems: 'center',- }}>- <Text+ if (invalidPassword && validatePass(password)) {+ setInvalidPassword(false);+ _pass.current.setNativeProps({+ style: {+ color: colors.pri,+ borderColor: colors.accent,+ },+ });+ }+ }}+ onSubmitEditing={() => {+ if (!validatePass(password)) {+ setInvalidPassword(true);+ _pass.current.setNativeProps({+ style: {+ color: colors.errorText,+ },+ });+ }+ }}style={{+ padding: pv,+ borderWidth: 1.5,+ borderColor: colors.nav,+ marginHorizontal: 12,+ borderRadius: 5,fontSize: SIZE.md,- fontFamily: WEIGHT.medium,- color: 'white',+ fontFamily: WEIGHT.regular,+ marginBottom: 25,+ }}+ secureTextEntry={true}+ placeholder="Password"+ placeholderTextColor={colors.icon}+ />++ <TouchableOpacity+ activeOpacity={opacity}+ style={{+ padding: pv,+ backgroundColor: colors.accent,+ borderRadius: 5,+ marginHorizontal: 12,+ marginBottom: 10,+ alignItems: 'center',}}>- Signup- </Text>- </TouchableOpacity>+ <Text+ style={{+ fontSize: SIZE.md,+ fontFamily: WEIGHT.medium,+ color: 'white',+ }}>+ Signup+ </Text>+ </TouchableOpacity>+ </View></View>- </View>+ </SafeAreaView>);};++Signup.navigationOptions = {+ header: null,+ headerStyle: {+ backgroundColor: 'transparent',+ borderBottomWidth: 0,+ height: 0,+ },+};++export default Signup;