{item.label}
diff --git a/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx b/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx
index 3e0d09106..1c17a0ff7 100644
--- a/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx
+++ b/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx
@@ -27,24 +27,25 @@ export function ManageLinkExpiry({
validTill: optionFn,
});
};
+
const [shareExpiryOptionsModalView, setShareExpiryOptionsModalView] =
useState(false);
+
const [shareExpiryValue, setShareExpiryValue] = useState(0);
+
const [labelText, setLabelText] = useState(
publicShareProp?.validTill
? formatDateTime(publicShareProp?.validTill / 1000)
: 'never'
);
- useEffect(() => {
- if (shareExpiryOptionsModalView) {
- setShareExpiryOptionsModalView(true);
- } else setShareExpiryOptionsModalView(false);
- }, [shareExpiryOptionsModalView]);
+
const closeShareExpiryOptionsModalView = () =>
setShareExpiryOptionsModalView(false);
+
const openShareExpiryOptionsModalView = () =>
setShareExpiryOptionsModalView(true);
- const changeshareExpiryValue = (value: number) => () => {
+
+ const changeShareExpiryValue = (value: number) => () => {
updateDeviceExpiry(value);
setLabelText(
publicShareProp?.validTill
@@ -55,6 +56,13 @@ export function ManageLinkExpiry({
shareExpiryValue;
setShareExpiryOptionsModalView(false);
};
+
+ useEffect(() => {
+ if (shareExpiryOptionsModalView) {
+ setShareExpiryOptionsModalView(true);
+ } else setShareExpiryOptionsModalView(false);
+ }, [shareExpiryOptionsModalView]);
+
return (
<>
- {/* */}
{shareExpiryOptions().map((item) => (
{item.label}
diff --git a/src/components/Menu/menuItem.tsx b/src/components/Menu/menuItem.tsx
index d7cd38dc5..bad403783 100644
--- a/src/components/Menu/menuItem.tsx
+++ b/src/components/Menu/menuItem.tsx
@@ -32,19 +32,11 @@ export function EnteMenuItem({
checked,
}: Iprops) {
const menuContext = useContext(OverflowMenuContext);
- // const [buttonState, setButtonState] = useState<
- // 'Default' | 'Loading' | 'Success'
- // >('Default');
const handleClick = () => {
- // setButtonState('Loading');
onClick();
if (!keepOpenAfterClick) {
menuContext.close();
}
- // setButtonState('Success');
- // setTimeout(() => {
- // setButtonState('Default');
- // }, 2000);
};
return (
| |