Skip to content

Commit

Permalink
Fixed Add and Cancel buttons on AddResourceModal (#2077)
Browse files Browse the repository at this point in the history
* Fix Add and Cancel buttons on AddResourceModal

* Update AddResourceModal
  • Loading branch information
docia authored Jul 9, 2024
1 parent 76a138e commit 03706ff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const styles = {
},
buttonsArea: {
display: 'flex',
justifyContent: 'space-between'
justifyContent: 'end',
gap: '30px'
},
addButton: { mr: '16px' }
}
38 changes: 18 additions & 20 deletions src/containers/my-resources/add-resource-modal/AddResourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,25 @@ const AddResourceModal = <T extends TableItem>({
/>

<Box sx={styles.buttonsArea}>
<Box>
<AppButton
disabled={!selectedRows.length}
onClick={onAddItems}
sx={styles.addButton}
>
{t('common.add')}
</AppButton>
<AppButton onClick={closeModal} variant={ButtonVariantEnum.Tonal}>
{t('common.cancel')}
</AppButton>
</Box>

{uploadItem && (
<AddDocuments
buttonText={t('common.uploadNewFile')}
fetchData={uploadItem}
formData={formData}
/>
)}
<AppButton onClick={closeModal} variant={ButtonVariantEnum.Tonal}>
{t('common.cancel')}
</AppButton>
<AppButton
disabled={!selectedRows.length}
onClick={onAddItems}
sx={styles.addButton}
>
{t('common.add')}
</AppButton>
</Box>

{uploadItem && (
<AddDocuments
buttonText={t('common.uploadNewFile')}
fetchData={uploadItem}
formData={formData}
/>
)}
</Box>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/create-or-edit-lesson/CreateOrEditLesson.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ const CreateOrEditLesson = () => {
<Box sx={styles.buttons}>
<AppButton
onClick={navigateToLessonTab}
size={SizeEnum.ExtraLarge}
size={SizeEnum.XXL}
variant={ButtonVariantEnum.Tonal}
>
{t('common.cancel')}
</AppButton>
<AppButton size={SizeEnum.ExtraLarge} type={ButtonTypeEnum.Submit}>
<AppButton size={SizeEnum.XXL} type={ButtonTypeEnum.Submit}>
{t('common.save')}
</AppButton>
</Box>
Expand Down

0 comments on commit 03706ff

Please sign in to comment.