mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
hide pinned button
This commit is contained in:
@@ -3,11 +3,12 @@ import {TouchableOpacity, View} from 'react-native';
|
|||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
|
import {ToastEvent} from '../../services/EventManager';
|
||||||
import {getElevation} from '../../utils';
|
import {getElevation} from '../../utils';
|
||||||
|
import {COLORS_NOTE} from '../../utils/Colors';
|
||||||
|
import {db} from '../../utils/DB';
|
||||||
|
import {SIZE} from '../../utils/SizeUtils';
|
||||||
import {PressableButton} from '../PressableButton';
|
import {PressableButton} from '../PressableButton';
|
||||||
import {ToastEvent} from "../../services/EventManager";
|
|
||||||
import {SIZE} from "../../utils/SizeUtils";
|
|
||||||
import {db} from "../../utils/DB";
|
|
||||||
|
|
||||||
const SelectionWrapper = ({
|
const SelectionWrapper = ({
|
||||||
children,
|
children,
|
||||||
@@ -15,8 +16,8 @@ const SelectionWrapper = ({
|
|||||||
currentEditingNote,
|
currentEditingNote,
|
||||||
index,
|
index,
|
||||||
background,
|
background,
|
||||||
pinned,
|
|
||||||
onLongPress,
|
onLongPress,
|
||||||
|
|
||||||
onPress,
|
onPress,
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
@@ -68,21 +69,19 @@ const SelectionWrapper = ({
|
|||||||
return (
|
return (
|
||||||
<PressableButton
|
<PressableButton
|
||||||
color={
|
color={
|
||||||
currentEditingNote || pinned
|
currentEditingNote
|
||||||
? colors.shade
|
? item.type === 'note' && item.colors[0]
|
||||||
|
? COLORS_NOTE[item.colors[0]]
|
||||||
|
: colors.shade
|
||||||
: background
|
: background
|
||||||
? background
|
? background
|
||||||
: 'transparent'
|
: 'transparent'
|
||||||
}
|
}
|
||||||
onLongPress={onLongPress}
|
onLongPress={onLongPress}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
selectedColor={
|
selectedColor={currentEditingNote ? colors.accent : colors.nav}
|
||||||
currentEditingNote || pinned
|
|
||||||
? colors.accent
|
|
||||||
: colors.nav
|
|
||||||
}
|
|
||||||
alpha={!colors.night ? -0.02 : 0.02}
|
alpha={!colors.night ? -0.02 : 0.02}
|
||||||
opacity={currentEditingNote || pinned ? 0.12 : 1}
|
opacity={ currentEditingNote ? 0.15 : 1}
|
||||||
customStyle={{
|
customStyle={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
@@ -91,16 +90,18 @@ const SelectionWrapper = ({
|
|||||||
paddingHorizontal: 12,
|
paddingHorizontal: 12,
|
||||||
borderRadius: 0,
|
borderRadius: 0,
|
||||||
marginTop:
|
marginTop:
|
||||||
index === 0 && pinned && !selectionMode
|
index === 0 && !selectionMode
|
||||||
? 15
|
? 15
|
||||||
: index === 0 && pinned && selectionMode
|
: index === 0 && selectionMode
|
||||||
? 30
|
? 30
|
||||||
: 0,
|
: 0,
|
||||||
}}>
|
}}>
|
||||||
{pinned ? (
|
{/* {item.pinned ? (
|
||||||
<PressableButton
|
<PressableButton
|
||||||
color={colors.accent}
|
color={item.colors[0] ? COLORS_NOTE[item.colors[0]] : colors.accent}
|
||||||
selectedColor={colors.accent}
|
selectedColor={
|
||||||
|
item.colors[0] ? COLORS_NOTE[item.colors[0]] : colors.accent
|
||||||
|
}
|
||||||
alpha={!colors.night ? -0.1 : 0.1}
|
alpha={!colors.night ? -0.1 : 0.1}
|
||||||
onPress={onPressPin}
|
onPress={onPressPin}
|
||||||
customStyle={{
|
customStyle={{
|
||||||
@@ -124,7 +125,7 @@ const SelectionWrapper = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</PressableButton>
|
</PressableButton>
|
||||||
) : null}
|
) : null} */}
|
||||||
|
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Reference in New Issue
Block a user