mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 22:19:41 +01:00
fix eslint warnings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Appearance, SafeAreaView } from 'react-native';
|
||||
import RNBootSplash from "react-native-bootsplash";
|
||||
import RNBootSplash from 'react-native-bootsplash';
|
||||
import { COLOR_SCHEME_DARK, COLOR_SCHEME_LIGHT } from '../src/utils/Colors';
|
||||
import NotesnookShare from './index';
|
||||
|
||||
@@ -8,16 +8,13 @@ export default class QuickNoteIOS extends Component {
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
this.state = {
|
||||
colors:
|
||||
Appearance.getColorScheme() === 'dark'
|
||||
? COLOR_SCHEME_DARK
|
||||
: COLOR_SCHEME_LIGHT,
|
||||
colors: Appearance.getColorScheme() === 'dark' ? COLOR_SCHEME_DARK : COLOR_SCHEME_LIGHT,
|
||||
height: 0
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
RNBootSplash.hide({fade:true})
|
||||
RNBootSplash.hide({ fade: true });
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -28,7 +25,8 @@ export default class QuickNoteIOS extends Component {
|
||||
height: '100%',
|
||||
justifyContent: 'flex-start',
|
||||
backgroundColor: this.state.colors.nav
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<NotesnookShare quicknote={true} />
|
||||
</SafeAreaView>
|
||||
);
|
||||
|
||||
@@ -26,10 +26,7 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
const notes = useRef(null);
|
||||
const timer = useRef(null);
|
||||
const inputRef = useRef();
|
||||
const insets =
|
||||
Platform.OS === 'android'
|
||||
? {top: StatusBar.currentHeight}
|
||||
: useSafeAreaInsets();
|
||||
const insets = Platform.OS === 'android' ? { top: StatusBar.currentHeight } : useSafeAreaInsets();
|
||||
|
||||
const onSelectItem = async item => {
|
||||
if (item.locked) {
|
||||
@@ -65,7 +62,7 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
(async () => {
|
||||
await db.init();
|
||||
await db.notes.init();
|
||||
notes.current = db.notes.all
|
||||
notes.current = db.notes.all;
|
||||
setResults(notes.current);
|
||||
})();
|
||||
setTimeout(() => {
|
||||
@@ -73,21 +70,24 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
}, 300);
|
||||
}, []);
|
||||
|
||||
const renderItem = ({item, index}) => !item.locked ? (
|
||||
const renderItem = ({ item, index }) =>
|
||||
!item.locked ? (
|
||||
<TouchableOpacity
|
||||
activeOpacity={0.7}
|
||||
onPress={() => onSelectItem(item)}
|
||||
style={{
|
||||
height: 50,
|
||||
paddingHorizontal: 12
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
numberOfLines={1}
|
||||
style={{
|
||||
color: colors.pri,
|
||||
fontFamily: 'OpenSans-SemiBold',
|
||||
fontSize: 15
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{item.title}
|
||||
</Text>
|
||||
|
||||
@@ -97,11 +97,12 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
color: colors.icon,
|
||||
fontSize: 12,
|
||||
fontFamily: 'OpenSans-Regular'
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{item.headline}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
) : null
|
||||
) : null;
|
||||
|
||||
let extra = quicknote
|
||||
? {
|
||||
@@ -123,7 +124,8 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
zIndex: 999,
|
||||
...getElevation(quicknote ? 1 : 5),
|
||||
...extra
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flexShrink: 1,
|
||||
@@ -133,7 +135,8 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
paddingHorizontal: 12,
|
||||
marginBottom: 10,
|
||||
height: 50
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<TextInput
|
||||
ref={inputRef}
|
||||
placeholder="Search for a note"
|
||||
@@ -152,12 +155,7 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
{searching ? (
|
||||
<ActivityIndicator size={25} color={colors.icon} />
|
||||
) : (
|
||||
<Icon
|
||||
name="magnify"
|
||||
color={colors.pri}
|
||||
size={25}
|
||||
onPress={onSearch}
|
||||
/>
|
||||
<Icon name="magnify" color={colors.pri} size={25} onPress={onSearch} />
|
||||
)}
|
||||
</View>
|
||||
|
||||
@@ -177,12 +175,14 @@ export const Search = ({close, getKeyboardHeight, quicknote}) => {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
height: 200
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{
|
||||
fontFamily: 'OpenSans-Regular',
|
||||
color: colors.icon
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
Search for a note to append to it.
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
@@ -1,27 +1,20 @@
|
||||
import { Appearance } from 'react-native';
|
||||
import create from 'zustand';
|
||||
import {
|
||||
ACCENT, COLOR_SCHEME_DARK,
|
||||
COLOR_SCHEME_LIGHT,
|
||||
setAccentColor
|
||||
} from '../src/utils/Colors';
|
||||
import { ACCENT, COLOR_SCHEME_DARK, COLOR_SCHEME_LIGHT, setAccentColor } from '../src/utils/Colors';
|
||||
import { MMKV } from '../src/utils/mmkv';
|
||||
|
||||
export const useShareStore = create((set, get) => ({
|
||||
colors:
|
||||
Appearance.getColorScheme() === 'dark'
|
||||
? COLOR_SCHEME_DARK
|
||||
: COLOR_SCHEME_LIGHT,
|
||||
colors: Appearance.getColorScheme() === 'dark' ? COLOR_SCHEME_DARK : COLOR_SCHEME_LIGHT,
|
||||
accent: ACCENT,
|
||||
setAccent: async () => {
|
||||
let accent = await MMKV.getItem('accentColor');
|
||||
if (accent) {
|
||||
accent = {
|
||||
color: accent,
|
||||
shade:accent + "12"
|
||||
}
|
||||
set({accent:accent});
|
||||
shade: accent + '12'
|
||||
};
|
||||
set({ accent: accent });
|
||||
}
|
||||
},
|
||||
appendNote: null,
|
||||
setAppendNote: note => {
|
||||
|
||||
Reference in New Issue
Block a user