@@ -14,6 +14,7 @@ import DocumentUpload from "@/components/document-upload";
1414import { Button } from "@/components/ui/button" ;
1515import { Input } from "@/components/ui/input" ;
1616import { Label } from "@/components/ui/label" ;
17+ import { ScrollArea } from "@/components/ui/scroll-area" ;
1718import {
1819 Sheet ,
1920 SheetContent ,
@@ -151,7 +152,7 @@ export default function AgreementSheet({
151152
152153 return (
153154 < Sheet open = { isOpen } onOpenChange = { setIsOpen } >
154- < SheetContent className = "flex w-[85%] flex-col justify-between bg-background px-4 text-foreground sm:w-[500px] md:px-5" >
155+ < SheetContent className = "flex h-full w-[85%] flex-col justify-between bg-background px-4 text-foreground sm:w-[500px] md:px-5" >
155156 < SheetHeader className = "text-start" >
156157 < SheetTitle > Create a new agreement</ SheetTitle >
157158 < SheetDescription >
@@ -160,89 +161,91 @@ export default function AgreementSheet({
160161 </ SheetDescription >
161162 </ SheetHeader >
162163
163- < form className = "flex grow flex-col" onSubmit = { handleSubmit } >
164- < div className = "flex-grow space-y-6" >
165- < div className = "w-full space-y-2" >
166- < Label htmlFor = "name" > Display name</ Label >
167- < Input
168- className = "flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
169- id = "name"
170- type = "text"
171- name = "name"
172- required
173- autoComplete = "off"
174- data-1p-ignore
175- placeholder = "Standard NDA"
176- value = { data . name || "" }
177- onChange = { ( e ) =>
178- setData ( {
179- ...data ,
180- name : e . target . value ,
181- } )
182- }
183- />
184- </ div >
185-
186- < div >
187- < LinkItem
188- title = "Require viewer's name"
189- enabled = { data . requireName }
190- action = { ( ) =>
191- setData ( { ...data , requireName : ! data . requireName } )
192- }
193- />
194- </ div >
195-
196- < div className = "space-y-4" >
164+ < ScrollArea className = "flex-1" >
165+ < form className = "flex grow flex-col" onSubmit = { handleSubmit } >
166+ < div className = "flex-grow space-y-6" >
197167 < div className = "w-full space-y-2" >
198- < Label htmlFor = "link" > Link to an agreement </ Label >
168+ < Label htmlFor = "name" > Display name </ Label >
199169 < Input
200170 className = "flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
201- id = "link"
202- type = "url"
203- pattern = "https://.*"
204- name = "link"
171+ id = "name"
172+ type = "text"
173+ name = "name"
205174 required
206175 autoComplete = "off"
207176 data-1p-ignore
208- placeholder = "https://www.papermark.io/nda "
209- value = { data . link || "" }
177+ placeholder = "Standard NDA "
178+ value = { data . name || "" }
210179 onChange = { ( e ) =>
211180 setData ( {
212181 ...data ,
213- link : e . target . value ,
182+ name : e . target . value ,
214183 } )
215184 }
216- onInvalid = { ( e ) =>
217- e . currentTarget . setCustomValidity (
218- "Please enter a valid URL starting with https://" ,
219- )
185+ />
186+ </ div >
187+
188+ < div >
189+ < LinkItem
190+ title = "Require viewer's name"
191+ enabled = { data . requireName }
192+ action = { ( ) =>
193+ setData ( { ...data , requireName : ! data . requireName } )
220194 }
221195 />
222196 </ div >
223197
224- < div className = "space-y-12" >
225- < div className = "space-y-2 pb-6" >
226- < Label > Or upload an agreement</ Label >
227- < div className = "grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6" >
228- < DocumentUpload
229- currentFile = { currentFile }
230- setCurrentFile = { setCurrentFile }
231- />
198+ < div className = "space-y-4" >
199+ < div className = "w-full space-y-2" >
200+ < Label htmlFor = "link" > Link to an agreement</ Label >
201+ < Input
202+ className = "flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
203+ id = "link"
204+ type = "url"
205+ pattern = "https://.*"
206+ name = "link"
207+ required
208+ autoComplete = "off"
209+ data-1p-ignore
210+ placeholder = "https://www.papermark.io/nda"
211+ value = { data . link || "" }
212+ onChange = { ( e ) =>
213+ setData ( {
214+ ...data ,
215+ link : e . target . value ,
216+ } )
217+ }
218+ onInvalid = { ( e ) =>
219+ e . currentTarget . setCustomValidity (
220+ "Please enter a valid URL starting with https://" ,
221+ )
222+ }
223+ />
224+ </ div >
225+
226+ < div className = "space-y-12" >
227+ < div className = "space-y-2 pb-6" >
228+ < Label > Or upload an agreement</ Label >
229+ < div className = "grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6" >
230+ < DocumentUpload
231+ currentFile = { currentFile }
232+ setCurrentFile = { setCurrentFile }
233+ />
234+ </ div >
232235 </ div >
233236 </ div >
234237 </ div >
235238 </ div >
236- </ div >
237239
238- < SheetFooter >
239- < div className = "flex items-center" >
240- < Button type = "submit" loading = { isLoading } >
241- Create Agreement
242- </ Button >
243- </ div >
244- </ SheetFooter >
245- </ form >
240+ < SheetFooter className = "flex-shrink-0" >
241+ < div className = "flex items-center" >
242+ < Button type = "submit" loading = { isLoading } >
243+ Create Agreement
244+ </ Button >
245+ </ div >
246+ </ SheetFooter >
247+ </ form >
248+ </ ScrollArea >
246249 </ SheetContent >
247250 </ Sheet >
248251 ) ;
0 commit comments