mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
minor fixes
This commit is contained in:
@@ -258,6 +258,9 @@ export default class ActionSheet extends Component {
|
||||
overScrollMode="always"
|
||||
style={[styles.scrollview]}>
|
||||
<Animated.View
|
||||
onTouchStart={this._hideModal}
|
||||
onTouchEnd={this._hideModal}
|
||||
onTouchMove={this._hideModal}
|
||||
style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
@@ -267,6 +270,7 @@ export default class ActionSheet extends Component {
|
||||
zIndex: 1,
|
||||
}}
|
||||
/>
|
||||
|
||||
<View
|
||||
onTouchMove={this._onTouchMove}
|
||||
onTouchStart={this._onTouchStart}
|
||||
@@ -274,17 +278,7 @@ export default class ActionSheet extends Component {
|
||||
style={{
|
||||
height: deviceHeight * 1.1,
|
||||
width: '100%',
|
||||
zIndex: 10,
|
||||
}}>
|
||||
<TouchableOpacity
|
||||
onPress={this._hideModal}
|
||||
onLongPress={this._hideModal}
|
||||
style={{
|
||||
height: deviceHeight,
|
||||
width: '100%',
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
}}></View>
|
||||
|
||||
<Animated.View
|
||||
onLayout={this._showModal}
|
||||
@@ -294,6 +288,7 @@ export default class ActionSheet extends Component {
|
||||
{
|
||||
...getElevation(elevation),
|
||||
zIndex: 11,
|
||||
|
||||
transform: [
|
||||
{
|
||||
translateY: this.transformValue,
|
||||
|
||||
@@ -384,8 +384,8 @@ export const ActionSheetComponent = ({
|
||||
}}>
|
||||
<View
|
||||
style={{
|
||||
width: DDS.isTab ? 500 / 10 : w / 10,
|
||||
height: DDS.isTab ? 500 / 10 : w / 10,
|
||||
width: DDS.isTab ? 400 / 10 : w / 10,
|
||||
height: DDS.isTab ? 400 / 10 : w / 10,
|
||||
backgroundColor: color,
|
||||
borderRadius: 100,
|
||||
justifyContent: 'center',
|
||||
@@ -405,7 +405,9 @@ export const ActionSheetComponent = ({
|
||||
key={rowItem.name}
|
||||
style={{
|
||||
alignItems: 'center',
|
||||
width: (w - 24) / rowItems.length,
|
||||
width: DDS.isTab
|
||||
? (400 - 24) / rowItems.length
|
||||
: (w - 25) / rowItems.length,
|
||||
}}>
|
||||
<Icon
|
||||
style={{
|
||||
|
||||
@@ -78,6 +78,7 @@ export class Dialog extends Component {
|
||||
this.setState({
|
||||
visible: false,
|
||||
});
|
||||
break;
|
||||
}
|
||||
case dialogActions.ACTION_TRASH: {
|
||||
db.trash.restore(item.id);
|
||||
@@ -90,6 +91,7 @@ export class Dialog extends Component {
|
||||
);
|
||||
updateEvent({type: ACTIONS.TRASH});
|
||||
this.hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -146,7 +148,7 @@ export class Dialog extends Component {
|
||||
<View
|
||||
style={{
|
||||
...getElevation(5),
|
||||
width: DDS.isTab ? '50%' : '80%',
|
||||
width: DDS.isTab ? '40%' : '80%',
|
||||
maxHeight: 350,
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
@@ -130,7 +130,7 @@ export const Menu = ({
|
||||
minHeight: 2,
|
||||
width: '100%',
|
||||
paddingHorizontal: noTextMode ? 0 : ph,
|
||||
height: DDS.isTab ? 50 : 0,
|
||||
height: DDS.isTab && noTextMode ? 50 : 0,
|
||||
marginBottom: 0,
|
||||
alignItems: 'center',
|
||||
flexDirection: 'row',
|
||||
@@ -144,21 +144,10 @@ export const Menu = ({
|
||||
: 0
|
||||
: StatusBar.currentHeight,
|
||||
}}>
|
||||
{noTextMode || !DDS.isTab ? null : (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: SIZE.xxl,
|
||||
fontFamily: WEIGHT.bold,
|
||||
color: colors.accent,
|
||||
}}>
|
||||
notesnook
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{DDS.isTab ? (
|
||||
{DDS.isTab && noTextMode ? (
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
noTextMode ? eSendEvent(eOpenModalMenu) : close();
|
||||
eSendEvent(eOpenModalMenu);
|
||||
}}
|
||||
style={{
|
||||
alignItems: 'center',
|
||||
@@ -169,8 +158,8 @@ export const Menu = ({
|
||||
style={{
|
||||
marginTop: noTextMode ? 0 : 7.5,
|
||||
}}
|
||||
name={noTextMode ? 'menu' : 'x'}
|
||||
size={noTextMode ? SIZE.lg : SIZE.xxl}
|
||||
name="menu"
|
||||
size={SIZE.lg}
|
||||
color={colors.pri}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
@@ -629,17 +618,17 @@ export const Menu = ({
|
||||
justifyContent: noTextMode ? 'center' : 'flex-start',
|
||||
alignItems: 'center',
|
||||
flexDirection: 'row',
|
||||
backgroundColor: colors.accent,
|
||||
backgroundColor: noTextMode ? 'transparent' : colors.accent,
|
||||
borderRadius: 5,
|
||||
paddingHorizontal: 6,
|
||||
paddingHorizontal: noTextMode ? 0 : 6,
|
||||
}}>
|
||||
<Icon
|
||||
style={{
|
||||
minWidth: 35,
|
||||
minWidth: noTextMode ? 5 : 35,
|
||||
textAlign: 'left',
|
||||
}}
|
||||
name="login"
|
||||
color="white"
|
||||
color={noTextMode ? colors.accent : 'white'}
|
||||
size={SIZE.lg}
|
||||
/>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class ModalMenu extends Component {
|
||||
this.setState({
|
||||
visible: 'false',
|
||||
});
|
||||
}, 200);
|
||||
}, 100);
|
||||
},
|
||||
);
|
||||
};
|
||||
@@ -56,7 +56,7 @@ export class ModalMenu extends Component {
|
||||
<Modal
|
||||
visible={visible}
|
||||
transparent={true}
|
||||
animated
|
||||
animated={false}
|
||||
onShow={() => {
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
@@ -64,7 +64,6 @@ export class ModalMenu extends Component {
|
||||
});
|
||||
}, 0);
|
||||
}}
|
||||
animationType="fade"
|
||||
onRequestClose={() => this.setState({visible: false})}>
|
||||
<View
|
||||
style={{
|
||||
@@ -94,7 +93,7 @@ export class ModalMenu extends Component {
|
||||
zIndex: 10,
|
||||
transform: [
|
||||
{
|
||||
translateX: showMenu ? 0 : -(w * 0.3),
|
||||
translateX: showMenu ? 0 : -w,
|
||||
},
|
||||
],
|
||||
}}>
|
||||
|
||||
@@ -17,7 +17,7 @@ import {ToastEvent, hexToRGBA} from '../../utils/utils';
|
||||
import {NotesPlaceHolder} from '../ListPlaceholders';
|
||||
import NoteItem from '../NoteItem';
|
||||
import SelectionWrapper from '../SelectionWrapper';
|
||||
import {db} from '../../../App';
|
||||
import {db, DDS} from '../../../App';
|
||||
|
||||
export const NotesList = ({isGrouped = false}) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
@@ -68,7 +68,9 @@ export const NotesList = ({isGrouped = false}) => {
|
||||
marginTop:
|
||||
Platform.OS == 'ios'
|
||||
? notes[0] && !selectionMode
|
||||
? 135
|
||||
? DDS.isTab
|
||||
? 115
|
||||
: 135
|
||||
: 135 - 60
|
||||
: notes[0] && !selectionMode
|
||||
? 155
|
||||
@@ -147,7 +149,9 @@ export const NotesList = ({isGrouped = false}) => {
|
||||
marginTop:
|
||||
Platform.OS == 'ios'
|
||||
? notes[0]
|
||||
? 135
|
||||
? DDS.isTab
|
||||
? 115
|
||||
: 135
|
||||
: 135 - 60
|
||||
: notes[0]
|
||||
? 155
|
||||
|
||||
@@ -50,8 +50,7 @@ const Editor = ({navigation, noMenu}) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const {colors} = state;
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
let fullscreen = false;
|
||||
const [fullscreen, setFullscreen] = useState(false);
|
||||
|
||||
// FUNCTIONS
|
||||
|
||||
@@ -105,14 +104,8 @@ const Editor = ({navigation, noMenu}) => {
|
||||
content = null;
|
||||
note = {};
|
||||
saveCounter = 0;
|
||||
EditorWebView.reload();
|
||||
|
||||
post('clear');
|
||||
post(
|
||||
JSON.stringify({
|
||||
type: 'title',
|
||||
value: null,
|
||||
}),
|
||||
);
|
||||
post('focusTitle');
|
||||
};
|
||||
|
||||
@@ -377,28 +370,17 @@ const Editor = ({navigation, noMenu}) => {
|
||||
right: 0,
|
||||
top: 0,
|
||||
}}>
|
||||
{DDS.isTab ? (
|
||||
{DDS.isTab && !fullscreen ? (
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
if (fullscreen) {
|
||||
fullscreen = false;
|
||||
eSendEvent(eCloseFullscreenEditor);
|
||||
post(
|
||||
JSON.stringify({
|
||||
type: 'nomenu',
|
||||
value: true,
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
eSendEvent(eOpenFullscreenEditor);
|
||||
fullscreen = true;
|
||||
setFullscreen(true);
|
||||
post(
|
||||
JSON.stringify({
|
||||
type: 'nomenu',
|
||||
value: false,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
width: 60,
|
||||
@@ -408,7 +390,7 @@ const Editor = ({navigation, noMenu}) => {
|
||||
paddingRight: 12,
|
||||
zIndex: 800,
|
||||
}}>
|
||||
<Icon name="square" color={colors.icon} size={SIZE.xxxl} />
|
||||
<Icon name="fullscreen" color={colors.icon} size={SIZE.xxxl} />
|
||||
</TouchableOpacity>
|
||||
) : null}
|
||||
<TouchableOpacity
|
||||
@@ -505,8 +487,19 @@ const Editor = ({navigation, noMenu}) => {
|
||||
);
|
||||
};
|
||||
|
||||
const closeFullscreen = () => {
|
||||
setFullscreen(false);
|
||||
};
|
||||
|
||||
// EFFECTS
|
||||
|
||||
useEffect(() => {
|
||||
eSubscribeEvent(eCloseFullscreenEditor, closeFullscreen);
|
||||
|
||||
return () => {
|
||||
eUnSubscribeEvent(eCloseFullscreenEditor, closeFullscreen);
|
||||
};
|
||||
});
|
||||
useEffect(() => {
|
||||
let handleBack;
|
||||
if (!noMenu && DDS.isTab) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {ACTIONS} from '../../provider/actions';
|
||||
import {eSendEvent} from '../../services/eventManager';
|
||||
import NavigationService from '../../services/NavigationService';
|
||||
import {SideMenuEvent} from '../../utils/utils';
|
||||
import {eScrollEvent} from '../../services/events';
|
||||
import {eScrollEvent, eOnLoadNote} from '../../services/events';
|
||||
let count = 0;
|
||||
export const AnimatedSafeAreaView = Animatable.createAnimatableComponent(
|
||||
SafeAreaView,
|
||||
|
||||
Reference in New Issue
Block a user