1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-04 23:10:13 +01:00

fix: autocomplete on create share modal

This commit is contained in:
Elias Schneider 2023-09-03 22:07:40 +02:00
parent 4df8dea5cc
commit d4e8d4f58b
No known key found for this signature in database
GPG Key ID: 07E623B294202B6C
2 changed files with 14 additions and 12 deletions

View File

@ -23,7 +23,7 @@ import showCompletedReverseShareModal from "./showCompletedReverseShareModal";
const showCreateReverseShareModal = (
modals: ModalsContextProps,
showSendEmailNotificationOption: boolean,
getReverseShares: () => void,
getReverseShares: () => void
) => {
return modals.openModal({
title: "Create reverse share",
@ -64,7 +64,7 @@ const Body = ({
values.expiration_num + values.expiration_unit,
values.maxShareSize,
values.maxUseCount,
values.sendEmailNotification,
values.sendEmailNotification
)
.then(({ link }) => {
modals.closeAll();
@ -150,7 +150,7 @@ const Body = ({
expiresOn: t("account.reverseShare.expires-on"),
neverExpires: t("account.reverseShare.never-expires"),
},
form,
form
)}
</Text>
</div>
@ -174,7 +174,7 @@ const Body = ({
labelPosition="left"
label={t("account.reverseShares.modal.send-email")}
description={t(
"account.reverseShares.modal.send-email.description",
"account.reverseShares.modal.send-email.description"
)}
{...form.getInputProps("sendEmailNotification", {
type: "checkbox",

View File

@ -38,7 +38,7 @@ const showCreateUploadModal = (
allowUnauthenticatedShares: boolean;
enableEmailRecepients: boolean;
},
uploadCallback: (createShare: CreateShare) => void,
uploadCallback: (createShare: CreateShare) => void
) => {
const t = translateOutsideContext();
@ -152,7 +152,7 @@ const CreateUploadModalBody = ({
"link",
Buffer.from(Math.random().toString(), "utf8")
.toString("base64")
.substr(10, 7),
.substr(10, 7)
)
}
>
@ -251,7 +251,7 @@ const CreateUploadModalBody = ({
neverExpires: t("upload.modal.completed.never-expires"),
expiresOn: t("upload.modal.completed.expires-on"),
},
form,
form
)}
</Text>
</>
@ -266,7 +266,7 @@ const CreateUploadModalBody = ({
<Textarea
variant="filled"
placeholder={t(
"upload.modal.accordion.description.placeholder",
"upload.modal.accordion.description.placeholder"
)}
{...form.getInputProps("description")}
/>
@ -283,14 +283,14 @@ const CreateUploadModalBody = ({
data={form.values.recipients}
placeholder={t("upload.modal.accordion.email.placeholder")}
searchable
{...form.getInputProps("recipients")}
creatable
autoComplete="email-recipients"
getCreateLabel={(query) => `+ ${query}`}
onCreate={(query) => {
if (!query.match(/^\S+@\S+\.\S+$/)) {
form.setFieldError(
"recipients",
t("upload.modal.accordion.email.invalid-email"),
t("upload.modal.accordion.email.invalid-email")
);
} else {
form.setFieldError("recipients", null);
@ -301,6 +301,7 @@ const CreateUploadModalBody = ({
return query;
}
}}
{...form.getInputProps("recipients")}
/>
</Accordion.Panel>
</Accordion.Item>
@ -315,9 +316,10 @@ const CreateUploadModalBody = ({
<PasswordInput
variant="filled"
placeholder={t(
"upload.modal.accordion.security.password.placeholder",
"upload.modal.accordion.security.password.placeholder"
)}
label={t("upload.modal.accordion.security.password.label")}
autoComplete="off"
{...form.getInputProps("password")}
/>
<NumberInput
@ -325,7 +327,7 @@ const CreateUploadModalBody = ({
type="number"
variant="filled"
placeholder={t(
"upload.modal.accordion.security.max-views.placeholder",
"upload.modal.accordion.security.max-views.placeholder"
)}
label={t("upload.modal.accordion.security.max-views.label")}
{...form.getInputProps("maxViews")}