feat(front): back button in upload modal on topleft
This commit is contained in:
		
							parent
							
								
									0c0a02fcd5
								
							
						
					
					
						commit
						1a9245dfec
					
				|  | @ -89,10 +89,7 @@ onKeyboardShortcut('escape', () => { isOpen.value = false }) | ||||||
|               section-heading |               section-heading | ||||||
|               :class="{'destructive-header': destructive}" |               :class="{'destructive-header': destructive}" | ||||||
|             /> |             /> | ||||||
|             <Spacer |             <Spacer grow /> | ||||||
|               v-if="!$slots.topleft" |  | ||||||
|               grow |  | ||||||
|             /> |  | ||||||
|             <Button |             <Button | ||||||
|               icon="bi-x-lg" |               icon="bi-x-lg" | ||||||
|               ghost |               ghost | ||||||
|  |  | ||||||
|  | @ -46,10 +46,18 @@ const state = ref<State>(init()) | ||||||
| 
 | 
 | ||||||
| const pages = ['selectDestination', 'uploadFiles', 'uploadsInProgress'] as const | const pages = ['selectDestination', 'uploadFiles', 'uploadsInProgress'] as const | ||||||
| 
 | 
 | ||||||
|  | const goBack = computed(() => | ||||||
|  |   state.value.page === 'selectDestination' | ||||||
|  |     ? undefined | ||||||
|  |     : () => { state.value.page = pages[pages.indexOf(state.value.page) - 1] } | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| // Step 1 | // Step 1 | ||||||
| const destinationSelected = (destination: UploadDestination) => | const destinationSelected = (destination: UploadDestination) => | ||||||
|   state.value = { ...state.value, uploadDestination: destination, page: 'uploadFiles' } |   state.value = { ...state.value, uploadDestination: destination, page: 'uploadFiles' } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| // Wait for pablo: If no channel exists, auto-create an empty channel | // Wait for pablo: If no channel exists, auto-create an empty channel | ||||||
| 
 | 
 | ||||||
| // Step 1.1 | // Step 1.1 | ||||||
|  | @ -71,6 +79,17 @@ const channelUpload = ref() | ||||||
|     :cancel="t('components.channels.UploadModal.button.close')" |     :cancel="t('components.channels.UploadModal.button.close')" | ||||||
|     :title="modalTitle" |     :title="modalTitle" | ||||||
|   > |   > | ||||||
|  |     <template | ||||||
|  |       v-if="goBack" | ||||||
|  |       #topleft | ||||||
|  |     > | ||||||
|  |       <Button | ||||||
|  |         icon="bi-chevron-compact-left" | ||||||
|  |         :title="t('components.channels.UploadModal.button.previous')" | ||||||
|  |         @click="goBack" | ||||||
|  |       /> | ||||||
|  |       <Spacer grow /> | ||||||
|  |     </template> | ||||||
|     <!-- Page content --> |     <!-- Page content --> | ||||||
|     <!-- Page 1 --> |     <!-- Page 1 --> | ||||||
| 
 | 
 | ||||||
|  | @ -147,13 +166,6 @@ const channelUpload = ref() | ||||||
|     </Layout> |     </Layout> | ||||||
| 
 | 
 | ||||||
|     <template #actions> |     <template #actions> | ||||||
|       <Button |  | ||||||
|         v-if="state.page !== pages[0]" |  | ||||||
|         secondary |  | ||||||
|         :on-click="() => { state.page = pages[(pages.indexOf(state.page) || 1) - 1] }" |  | ||||||
|       > |  | ||||||
|         {{ t('components.channels.UploadModal.button.previous') }} |  | ||||||
|       </Button> |  | ||||||
|       <Spacer |       <Spacer | ||||||
|         h |         h | ||||||
|         grow |         grow | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 upsiflu
						upsiflu