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