mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
minor fixes
This commit is contained in:
@@ -216,7 +216,7 @@ export const ActionSheetComponent = ({
|
||||
func: () => {
|
||||
db.restoreItem(item.dateCreated);
|
||||
ToastEvent.show(
|
||||
item.type == 'note' ? 'Note restored' : 'Notebook restored',
|
||||
item.type === 'note' ? 'Note restored' : 'Notebook restored',
|
||||
'success',
|
||||
1000,
|
||||
() => {},
|
||||
|
||||
@@ -3,7 +3,7 @@ import {Modal, Text, TouchableOpacity, View} from 'react-native';
|
||||
import {TextInput} from 'react-native-gesture-handler';
|
||||
import Icon from 'react-native-vector-icons/Feather';
|
||||
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
|
||||
import {useTracked} from '../../provider';
|
||||
|
||||
import {getElevation, ToastEvent} from '../../utils/utils';
|
||||
|
||||
export class AddTopicDialog extends React.Component {
|
||||
@@ -40,7 +40,7 @@ export class AddTopicDialog extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {visible} = this.state;
|
||||
const {visible, titleFocused} = this.state;
|
||||
const {colors, toEdit} = this.props;
|
||||
|
||||
return (
|
||||
@@ -184,13 +184,3 @@ export class AddTopicDialog extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const AddTopicDialog = ({
|
||||
visible,
|
||||
close = () => {},
|
||||
notebookID,
|
||||
toEdit = null,
|
||||
}) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const {colors} = state;
|
||||
};
|
||||
|
||||
@@ -246,21 +246,26 @@ export class DialogManager extends Component {
|
||||
switch (this.show) {
|
||||
case 'delete': {
|
||||
this._showSimpleDialog(TEMPLATE_DELETE(this.state.item.type));
|
||||
break;
|
||||
}
|
||||
case 'lock': {
|
||||
this._showVaultDialog();
|
||||
break;
|
||||
}
|
||||
case 'unlock': {
|
||||
this.setState({
|
||||
isPerm: true,
|
||||
});
|
||||
this._showVaultDialog();
|
||||
break;
|
||||
}
|
||||
case 'notebook': {
|
||||
this.showAddNotebook();
|
||||
break;
|
||||
}
|
||||
case 'topic': {
|
||||
this.showAddTOpic();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ import {w} from '../../utils/utils';
|
||||
import {NotesPlaceHolder} from '../ListPlaceholders';
|
||||
import NoteItem from '../NoteItem';
|
||||
import SelectionWrapper from '../SelectionWrapper';
|
||||
|
||||
import PullToRefresh from '../PullToRefresh';
|
||||
let sectionListRef;
|
||||
export const NotesList = ({
|
||||
onScroll,
|
||||
isSearch = false,
|
||||
@@ -42,6 +43,7 @@ export const NotesList = ({
|
||||
|
||||
const _onScroll = event => {
|
||||
if (!event) return;
|
||||
|
||||
y = event.nativeEvent.contentOffset.y;
|
||||
onScroll(y);
|
||||
};
|
||||
@@ -147,6 +149,7 @@ export const NotesList = ({
|
||||
|
||||
return isGrouped && !isSearch ? (
|
||||
<SectionList
|
||||
ref={ref => (sectionListRef = ref)}
|
||||
sections={notes}
|
||||
keyExtractor={_listKeyExtractor}
|
||||
renderSectionHeader={_renderSectionHeader}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {SafeAreaView} from 'react-native';
|
||||
import {SafeAreaView, View} from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import {db} from '../../../App';
|
||||
import Container from '../../components/Container';
|
||||
@@ -11,6 +11,7 @@ import {ACTIONS, useTracked} from '../../provider';
|
||||
import NavigationService from '../../services/NavigationService';
|
||||
import {SideMenuEvent, ToastEvent} from '../../utils/utils';
|
||||
import {useIsFocused} from 'react-navigation-hooks';
|
||||
import PullToRefresh from '../../components/PullToRefresh';
|
||||
|
||||
export const AnimatedSafeAreaView = Animatable.createAnimatableComponent(
|
||||
SafeAreaView,
|
||||
@@ -20,7 +21,7 @@ export const Home = ({navigation}) => {
|
||||
// State
|
||||
const [state, dispatch] = useTracked();
|
||||
const {colors, selectionMode, notes} = state;
|
||||
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
const [text, setText] = useState('');
|
||||
const [hideHeader, setHideHeader] = useState(false);
|
||||
const [keyword, setKeyword] = useState('');
|
||||
|
||||
Reference in New Issue
Block a user