@@ -12,6 +12,7 @@ import {
1212 Select ,
1313 Stack ,
1414 Text ,
15+ Textarea ,
1516 TextInput ,
1617 Title ,
1718} from "@mantine/core" ;
@@ -22,7 +23,7 @@ import { useState } from "react";
2223import { TbAlertCircle } from "react-icons/tb" ;
2324import * as yup from "yup" ;
2425import shareService from "../../../services/share.service" ;
25- import { ShareSecurity } from "../../../types/share.type" ;
26+ import { CreateShare } from "../../../types/share.type" ;
2627import ExpirationPreview from "../ExpirationPreview" ;
2728
2829const showCreateUploadModal = (
@@ -32,12 +33,7 @@ const showCreateUploadModal = (
3233 allowUnauthenticatedShares : boolean ;
3334 enableEmailRecepients : boolean ;
3435 } ,
35- uploadCallback : (
36- id : string ,
37- expiration : string ,
38- recipients : string [ ] ,
39- security : ShareSecurity
40- ) => void
36+ uploadCallback : ( createShare : CreateShare ) => void
4137) => {
4238 return modals . openModal ( {
4339 title : < Title order = { 4 } > Share</ Title > ,
@@ -54,12 +50,7 @@ const CreateUploadModalBody = ({
5450 uploadCallback,
5551 options,
5652} : {
57- uploadCallback : (
58- id : string ,
59- expiration : string ,
60- recipients : string [ ] ,
61- security : ShareSecurity
62- ) => void ;
53+ uploadCallback : ( createShare : CreateShare ) => void ;
6354 options : {
6455 isUserSignedIn : boolean ;
6556 allowUnauthenticatedShares : boolean ;
@@ -88,6 +79,7 @@ const CreateUploadModalBody = ({
8879 recipients : [ ] as string [ ] ,
8980 password : undefined ,
9081 maxViews : undefined ,
82+ description : undefined ,
9183 expiration_num : 1 ,
9284 expiration_unit : "-days" ,
9385 never_expires : false ,
@@ -116,9 +108,15 @@ const CreateUploadModalBody = ({
116108 const expiration = form . values . never_expires
117109 ? "never"
118110 : form . values . expiration_num + form . values . expiration_unit ;
119- uploadCallback ( values . link , expiration , values . recipients , {
120- password : values . password ,
121- maxViews : values . maxViews ,
111+ uploadCallback ( {
112+ id : values . link ,
113+ expiration : expiration ,
114+ recipients : values . recipients ,
115+ description : values . description ,
116+ security : {
117+ password : values . password ,
118+ maxViews : values . maxViews ,
119+ } ,
122120 } ) ;
123121 modals . closeAll ( ) ;
124122 }
@@ -258,6 +256,18 @@ const CreateUploadModalBody = ({
258256 </ Accordion . Panel >
259257 </ Accordion . Item >
260258 ) }
259+ < Accordion . Item value = "description" sx = { { borderBottom : "none" } } >
260+ < Accordion . Control > Description</ Accordion . Control >
261+ < Accordion . Panel >
262+ < Stack align = "stretch" >
263+ < Textarea
264+ variant = "filled"
265+ placeholder = "Note for the recepients"
266+ { ...form . getInputProps ( "description" ) }
267+ />
268+ </ Stack >
269+ </ Accordion . Panel >
270+ </ Accordion . Item >
261271 < Accordion . Item value = "security" sx = { { borderBottom : "none" } } >
262272 < Accordion . Control > Security options</ Accordion . Control >
263273 < Accordion . Panel >
0 commit comments