add a remove button

This commit is contained in:
ammarahm-ed
2021-01-14 15:45:07 +05:00
parent 0b0257ed7c
commit 4bda6bb6c5

View File

@@ -10,16 +10,17 @@ import {
eSubscribeEvent, eSubscribeEvent,
eUnSubscribeEvent, eUnSubscribeEvent,
sendNoteEditedEvent, sendNoteEditedEvent,
ToastEvent ToastEvent,
} from '../../services/EventManager'; } from '../../services/EventManager';
import {db} from '../../utils/DB'; import {db} from '../../utils/DB';
import { import {
eOnNewTopicAdded, eOnNewTopicAdded,
eOpenMoveNoteDialog, eOpenMoveNoteDialog,
refreshNotesPage refreshNotesPage,
} from '../../utils/Events'; } from '../../utils/Events';
import {pv, SIZE} from '../../utils/SizeUtils'; import {pv, SIZE} from '../../utils/SizeUtils';
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper'; import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
import {Button} from '../Button';
import DialogHeader from '../Dialog/dialog-header'; import DialogHeader from '../Dialog/dialog-header';
import {PressableButton} from '../PressableButton'; import {PressableButton} from '../PressableButton';
import {Toast} from '../Toast'; import {Toast} from '../Toast';
@@ -432,9 +433,21 @@ const MoveNoteComponent = ({close, note, setNote}) => {
{note?.notebooks?.findIndex( {note?.notebooks?.findIndex(
(o) => o.topics.indexOf(item.id) > -1, (o) => o.topics.indexOf(item.id) > -1,
) > -1 ? ( ) > -1 ? (
<Paragraph size={SIZE.sm} color={colors.errorText}> <Button
Remove Note onPress={() => handlePress(item, index)}
</Paragraph> title="Remove Note"
type="accent"
accentColor="red"
height={22}
style={{
margin: 1,
marginRight: 5,
paddingHorizontal: 0,
paddingVertical: 2.5,
borderRadius: 100,
paddingHorizontal: 12,
}}
/>
) : null} ) : null}
</PressableButton> </PressableButton>
)} )}