File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,14 @@ export const ActionsDropdown = () => {
7777 < UserSettingsDialog isOpen = { showUserSettingsDialog } setIsOpen = { setShowUserSettingsDialog } />
7878 < DeleteInstrumentDialog isOpen = { showDeleteInstrumentDialog } setIsOpen = { setShowDeleteInstrumentDialog } />
7979 < RestoreDefaultsDialog isOpen = { showRestoreDefaultsDialog } setIsOpen = { setShowRestoreDefaultsDialog } />
80- < UploadBundleDialog isOpen = { showUploadBundleDialog } setIsOpen = { setShowUploadBundleDialog } />
80+ < UploadBundleDialog
81+ isOpen = { showUploadBundleDialog }
82+ setIsOpen = { setShowUploadBundleDialog }
83+ onLoginRequired = { ( ) => {
84+ setShowUploadBundleDialog ( false ) ;
85+ setShowLoginDialog ( true ) ;
86+ } }
87+ />
8188 < LoginDialog isOpen = { showLoginDialog } setIsOpen = { setShowLoginDialog } />
8289 </ React . Fragment >
8390 ) ;
Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ import { useAppStore } from '@/store';
1111
1212export type UploadBundleDialogProps = {
1313 isOpen : boolean ;
14+ onLoginRequired : ( ) => void ;
1415 setIsOpen : ( value : boolean ) => void ;
1516} ;
1617
17- export const UploadBundleDialog = ( { isOpen, setIsOpen } : UploadBundleDialogProps ) => {
18+ export const UploadBundleDialog = ( { isOpen, setIsOpen, onLoginRequired } : UploadBundleDialogProps ) => {
1819 const addNotification = useNotificationsStore ( ( store ) => store . addNotification ) ;
1920
2021 const auth = useAppStore ( ( store ) => store . auth ) ;
@@ -90,7 +91,16 @@ export const UploadBundleDialog = ({ isOpen, setIsOpen }: UploadBundleDialogProp
9091 </ Dialog . Description >
9192 </ Dialog . Header >
9293 < Dialog . Body className = "grid gap-4" >
93- < Button type = "button" onClick = { ( ) => void handleSubmit ( ) . then ( ( ) => setIsOpen ( false ) ) } >
94+ { ! auth && (
95+ < p className = "mb-3 text-sm font-medium" >
96+ Please{ ' ' }
97+ < button className = "text-sky-700 hover:underline" type = "button" onClick = { onLoginRequired } >
98+ login to your account
99+ </ button > { ' ' }
100+ to upload a bundle.
101+ </ p >
102+ ) }
103+ < Button disabled = { ! auth } type = "button" onClick = { ( ) => void handleSubmit ( ) . then ( ( ) => setIsOpen ( false ) ) } >
94104 Upload
95105 </ Button >
96106 </ Dialog . Body >
You can’t perform that action at this time.
0 commit comments