From 5680b19dc86c3072436442b858a0696cf3da9ff1 Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 11 Jun 2021 14:54:42 -0400 Subject: [PATCH] add lists modal stuff --- ui/component/claimCollectionAdd/view.jsx | 38 +++++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/ui/component/claimCollectionAdd/view.jsx b/ui/component/claimCollectionAdd/view.jsx index d1ac92900..bb57de0e1 100644 --- a/ui/component/claimCollectionAdd/view.jsx +++ b/ui/component/claimCollectionAdd/view.jsx @@ -42,6 +42,7 @@ const ClaimCollectionAdd = (props: Props) => { function handleAddCollection() { addCollection(newCollectionName, [permanentUrl], isChannel ? 'collection' : 'playlist'); setNewCollectionName(''); + setAddNewCollection(false); } function altEnterListener(e: SyntheticKeyboardEvent<*>) { @@ -60,6 +61,18 @@ const ClaimCollectionAdd = (props: Props) => { window.removeEventListener('keydown', altEnterListener); } + function handleDone() { + if (addNewCollection && newCollectionName) { + handleAddCollection(); + } + closeModal(); + } + + function handleClearNew() { + setNewCollectionName(''); + setAddNewCollection(false); + } + return ( { onFocus={onTextareaFocus} onBlur={onTextareaBlur} inputButton={ -