Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

minor fixes

ammarahm-ed1f8f5409f3c1
diff --git a/apps/mobile/index.js b/apps/mobile/index.js
index 384a5d793..c4f5fdc74 100644
--- a/apps/mobile/index.js
+++ b/apps/mobile/index.js
@@ -7,6 +7,7 @@ import App from './App';
import {name as appName} from './app.json';
import React from 'react';
import {Provider} from './src/provider';
+import {scale} from './src/common/common';
const AppProvider = () => {
return (
diff --git a/apps/mobile/src/common/common.js b/apps/mobile/src/common/common.js
index f9507ba3c..f54cbe1af 100755
--- a/apps/mobile/src/common/common.js
+++ b/apps/mobile/src/common/common.js
@@ -79,49 +79,56 @@ const getDeviceSize = () => {
const getDpi = pd => {
if (pd === 1 || pd < 1) {
return 160 * pd;
- } else if (pd > 1 && pd < 1.51) {
+ } else if (pd > 1 && pd <= 1.5) {
let multiplier = pd / 1.5;
return 240 * multiplier;
- } else if (pd > 1.5 && pd < 2.01) {
+ } else if (pd > 1.5 && pd <= 2) {
let multiplier = pd / 1.5;
return 320 * multiplier;
- } else if (pd > 2 && pd < 3) {
+ } else if (pd > 2 && pd <= 3) {
let multiplier = pd / 3;
- return 430 * multiplier;
+ return 480 * multiplier;
} else if (pd > 3) {
return 510;
}
};
+const correction = (size, multiplier) => {
+ let dSize = getDeviceSize();
+
+ if (dSize > 4 && dSize <= 5.3 && pixelDensity <= 3) {
+ return size * 0.87;
+ } else if (dSize > 5.5 && dSize < 6.5 && pixelDensity <= 3) {
+ return size * 0.93;
+ } else if (dSize >= 6.5 && dSize <= 7.2) {
+ return size * multiplier;
+ } else if (dSize > 7.2 && dSize <= 8.5) {
+ return size * (multiplier + 0.05);
+ } else if (dSize > 8.5 && dSize <= 9.8) {
+ return size * (multiplier + 0.05);
+ } else if (dSize > 9.8) {
+ return size;
+ } else {
+ return size;
+ }
+};
+
export const normalize = size => {
let pd = pixelDensity;
if (pd === 1 || pd < 1) {
return correction(size, 0.75);
- } else if (pd > 1 && pd < 1.51) {
+ } else if (pd > 1 && pd <= 1.5) {
return correction(size, 0.8);
- } else if (pd > 1.5 && pd < 2.01) {
+ } else if (pd > 1.5 && pd <= 2) {
return correction(size, 0.84);
- } else if (pd > 2 && pd < 3) {
+ } else if (pd > 2 && pd <= 3) {
return correction(size, 0.87);
} else if (pd > 3) {
return size;
}
};
-const correction = (size, multiplier) => {
- let dSize = getDeviceSize();
- if (dSize <= 7.2) {
- return size * multiplier;
- } else if (dSize > 7.2 && dSize < 8.5) {
- return size * (multiplier + 0.05);
- } else if (dSize > 8.5 && dSize < 9.8) {
- return size * (multiplier + 0.05);
- } else if (dSize > 9.8) {
- return size;
- }
-};
-
export const SIZE = {
xxs: normalize(10),
xs: normalize(12),
diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js
index dd356e416..8f20490ed 100644
--- a/apps/mobile/src/components/DialogManager/index.js
+++ b/apps/mobile/src/components/DialogManager/index.js
@@ -356,7 +356,7 @@ export class DialogManager extends Component {
extraScroll={DDS.isTab ? 50 : 0}
indicatorColor={colors.shade}
footerAlwaysVisible={DDS.isTab}
- footerHeight={DDS.isTab ? 20 : 80}
+ footerHeight={DDS.isTab ? 20 : 10}
footerStyle={
DDS.isTab
? {
diff --git a/apps/mobile/src/components/SideMenu/index.js b/apps/mobile/src/components/SideMenu/index.js
index b86770fb1..b6f0b7dc9 100644
--- a/apps/mobile/src/components/SideMenu/index.js
+++ b/apps/mobile/src/components/SideMenu/index.js
@@ -318,7 +318,6 @@ export default class SideMenu extends React.Component {
_getOverlayViewRef = data => {
this.overlayViewRef = data.ref;
- console.log(this.overlayViewRef);
};
render() {
diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.js
index 9a78dc8a3..566479a13 100644
--- a/apps/mobile/src/views/Login/index.js
+++ b/apps/mobile/src/views/Login/index.js
@@ -111,14 +111,15 @@ const renderLogin = (colors, navigation) => {
textAlign: 'right',
marginHorizontal: 12,
fontFamily: WEIGHT.regular,
- height: 25,
textAlignVertical: 'bottom',
+
+ position: 'absolute',
+ right: 5,
+ top: 2.5,
}}>
{invalidEmail ? (
- <Icon name="alert-circle" size={SIZE.sm} color={colors.errorText} />
+ <Icon name="alert-circle" size={SIZE.xs} color={colors.errorText} />
) : null}
-
- {invalidEmail ? ' Email is invalid' : ''}
</Text>
<TextInput
@@ -186,87 +187,96 @@ const renderLogin = (colors, navigation) => {
placeholderTextColor={colors.icon}
/>
- <Text
+ <View
style={{
- textAlign: 'right',
- marginHorizontal: 12,
- fontFamily: WEIGHT.regular,
- height: 25,
- textAlignVertical: 'bottom',
+ marginBottom: 15,
+ marginTop: 15,
}}>
- {invalidPassword ? (
- <Icon name="alert-circle" size={SIZE.sm} color={colors.errorText} />
- ) : null}
-
- {invalidPassword ? ' Password is invalid' : ''}
- </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,
+ textAlignVertical: 'bottom',
+ position: 'absolute',
+ right: 5,
+ top: 2.5,
+ }}>
+ {invalidPassword ? (
+ <Icon
+ name="alert-circle"
+ size={SIZE.xs}
+ color={colors.errorText}
+ />
+ ) : null}
+ </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);
- 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}
- />
+ 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,
+ }}
+ secureTextEntry={true}
+ placeholder="Password"
+ placeholderTextColor={colors.icon}
+ />
+ </View>
<TouchableOpacity
activeOpacity={opacity}
style={{