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