diff --git a/apps/mobile/src/common/common.js b/apps/mobile/src/common/common.js index a39904780..d2c02e84a 100755 --- a/apps/mobile/src/common/common.js +++ b/apps/mobile/src/common/common.js @@ -11,7 +11,6 @@ export const scale = { fontScale: 1, }; const {height, width} = Dimensions.get('window'); -const standardLength = width > height ? width : height; //COLOR SCHEME export const ACCENT = { @@ -102,7 +101,7 @@ const correction = (size, multiplier) => { let dSize = getDeviceSize(); if (dSize > 4 && dSize <= 5.3 && pixelDensity <= 3) { - return size * 0.87; + return size * 0.92; } else if (dSize > 5.5 && dSize < 6.5 && pixelDensity <= 3) { if (Platform.OS === 'ios') { return size; @@ -125,7 +124,6 @@ const correction = (size, multiplier) => { export const normalize = size => { let pd = pixelDensity; - console.log(pd); if (pd === 1 || pd < 1) { return correction(size, 0.75); } else if (pd > 1 && pd <= 1.5) { diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.js index ff40b7182..725e8cc2b 100644 --- a/apps/mobile/src/components/NoteItem/index.js +++ b/apps/mobile/src/components/NoteItem/index.js @@ -82,31 +82,6 @@ export default class NoteItem extends React.Component { }, customStyle ? customStyle : {}, ]}> - {pinned ? ( - - - - ) : null} - onLongPress()} diff --git a/apps/mobile/src/components/NotebookItem/index.js b/apps/mobile/src/components/NotebookItem/index.js index 9b3986fea..c942e26d9 100644 --- a/apps/mobile/src/components/NotebookItem/index.js +++ b/apps/mobile/src/components/NotebookItem/index.js @@ -70,31 +70,6 @@ export const NotebookItem = ({ }, customStyle, ]}> - {pinned ? ( - - - - ) : null} - { const PinnedItems = () => { const [state, dispatch] = useTracked(); - const {pinned, colors} = state; + const {pinned, colors, selectionMode} = state; useEffect(() => { dispatch({type: ACTIONS.PINNED}); @@ -269,26 +269,43 @@ const PinnedItems = () => { keyExtractor={(item, index) => item.id.toString()} renderItem={({item, index}) => item.type === 'note' ? ( - {}} - pinned={true} - item={item} + + currentEditingNote={false} + pinned={true} + background={ + Platform.ios + ? hexToRGBA(colors.accent + '19') + : hexToRGBA(colors.shade) + } + item={item}> + { + if (!selectionMode) { + dispatch({type: ACTIONS.SELECTION_MODE, enabled: true}); + } + dispatch({type: ACTIONS.SELECTED_ITEMS, item: item}); + }} + update={() => { + dispatch({type: ACTIONS.NOTES}); + }} + item={item} + index={index} + /> + ) : null } /> diff --git a/apps/mobile/src/components/SelectionWrapper/index.js b/apps/mobile/src/components/SelectionWrapper/index.js index c4d2b858d..6249f2a4f 100644 --- a/apps/mobile/src/components/SelectionWrapper/index.js +++ b/apps/mobile/src/components/SelectionWrapper/index.js @@ -5,8 +5,16 @@ import {SIZE} from '../../common/common'; import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; import Animated from 'react-native-reanimated'; +import {getElevation} from '../../utils/utils'; -const SelectionWrapper = ({children, item, currentEditingNote, index}) => { +const SelectionWrapper = ({ + children, + item, + currentEditingNote, + index, + background, + pinned, +}) => { const [state, dispatch] = useTracked(); const {colors, selectionMode, selectedItemsList} = state; const [selected, setSelected] = useState(false); @@ -34,11 +42,44 @@ const SelectionWrapper = ({children, item, currentEditingNote, index}) => { alignItems: 'center', width: '100%', paddingHorizontal: 12, + marginTop: + index === 0 && pinned && !selectionMode + ? 15 + : index === 0 && pinned && selectionMode + ? 30 + : 0, backgroundColor: currentEditingNote === item.dateCreated ? colors.shade + : background + ? background : 'transparent', }}> + {pinned ? ( + + + + ) : null} + item.id.toString()} renderItem={({item, index}) => item.type === 'notebook' ? ( - {}} - noteToMove={noteToMove} - item={item} - pinned={true} + + currentEditingNote={false} + pinned={true} + background={ + Platform.ios + ? hexToRGBA(colors.accent + '19') + : hexToRGBA(colors.shade) + } + item={item}> + { + if (!selectionMode) { + dispatch({ + type: ACTIONS.SELECTION_MODE, + enabled: true, + }); + } + dispatch({type: ACTIONS.SELECTED_ITEMS, item: item}); + }} + noteToMove={noteToMove} + item={item} + pinned={true} + index={index} + colors={colors} + /> + ) : null } />