diff --git a/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx b/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx index 7900fad82..36f95055e 100644 --- a/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx +++ b/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx @@ -52,7 +52,6 @@ import { WsTag } from "@app/hooks/api/types"; import { formSchema, SecretActionType, TFormSchema } from "./SecretListView.utils"; import { CreateReminderForm } from "./CreateReminderForm"; - type Props = { secret: DecryptedSecret; onSaveSecret: ( @@ -71,8 +70,6 @@ type Props = { secretPath: string; }; - - export const SecretItem = memo( ({ secret, @@ -189,346 +186,344 @@ export const SecretItem = memo( return ( <> + { + if (data) { + setValue("reminderCron", data.cron, { shouldDirty: true }); + setValue("reminderNote", data.note, { shouldDirty: true }); + } + setCreateReminderFormOpen.off(); + }} + /> - { - if(data) { - setValue("reminderCron", data.cron, {shouldDirty: true}); - setValue("reminderNote", data.note, {shouldDirty: true}); - } - setCreateReminderFormOpen.off(); - }} - /> - -
-
-
-
- onToggleSecretSelect(secret._id)} - className={twMerge("ml-3 hidden group-hover:flex", isSelected && "flex")} - /> - -
-
- ( - +
+
+
+ onToggleSecretSelect(secret._id)} + className={twMerge("ml-3 hidden group-hover:flex", isSelected && "flex")} + /> + +
+
+ ( + + )} + /> +
+
+ {isOverriden ? ( + ( + + )} + /> + ) : ( + ( + + )} /> )} - /> -
-
- {isOverriden ? ( - ( - - )} - /> - ) : ( - ( - - )} - /> - )} -
- - - - - - - - {(isAllowed) => ( - - - - - - - - )} - - - Apply tags to this secrets - {tags.map((tag) => { - const { _id: tagId, name, tagColor } = tag; - - const isTagSelected = selectedTagsGroupById?.[tagId]; - return ( - handleTagSelect(tag)} - key={tagId} - icon={isTagSelected && } - iconPos="right" - > -
-
- {name} -
- - ); - })} - - - - - - - {(isAllowed) => ( +
+ - + - )} - + + + + {(isAllowed) => ( + + + + + + + + )} + + + Apply tags to this secrets + {tags.map((tag) => { + const { _id: tagId, name, tagColor } = tag; - - - - { - if(!hasReminder) { - setCreateReminderFormOpen.on(); - } - else { - setValue("reminderCron", null, {shouldDirty: true}); - setValue("reminderNote", null, {shouldDirty: true}); - } - }} - icon={faClock} /> - - - - + const isTagSelected = selectedTagsGroupById?.[tagId]; + return ( + handleTagSelect(tag)} + key={tagId} + icon={isTagSelected && } + iconPos="right" + > +
+
+ {name} +
+ + ); + })} + + + + + - {(isAllowed) => ( - - - - - - - - )} - - - -