Skip to content

Commit

Permalink
fix: update min height of modals
Browse files Browse the repository at this point in the history
  • Loading branch information
prinsss committed Jun 16, 2024
1 parent e4d6aa2 commit 2d284b5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
8 changes: 1 addition & 7 deletions src/components/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ type ModalProps = {
/**
* Common template for modals.
*/
export function Modal({
show,
onClose,
title,
children,
class: className = 'max-w-4xl md:max-w-screen-md sm:max-w-screen-sm',
}: ModalProps) {
export function Modal({ show, onClose, title, children, class: className }: ModalProps) {
if (!show) {
return <dialog class="modal" />;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/export-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function ExportDataModal<T>({ title, table, show, onClose }: ExportDataMo

return (
<Modal
class="max-w-sm md:max-w-screen-sm sm:max-w-screen-sm"
class="max-w-sm md:max-w-screen-sm sm:max-w-screen-sm max-h-full"
title={`${t(title as TranslationKey, title, { ns: 'common' })} ${t('Data')}`}
show={show}
onClose={onClose}
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/export-media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function ExportMediaModal<T>({

return (
<Modal
class="max-w-sm md:max-w-screen-sm sm:max-w-screen-sm"
class="max-w-sm md:max-w-screen-sm sm:max-w-screen-sm max-h-full"
title={`${t(title as TranslationKey, title, { ns: 'common' })} ${t('Media')}`}
show={show}
onClose={onClose}
Expand Down
7 changes: 6 additions & 1 deletion src/components/module-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export function CommonModuleUI({ extension }: CommonModuleUIProps) {
onClick={toggleShowModal}
indicatorColor={extension.type === ExtensionType.TWEET ? 'bg-primary' : 'bg-secondary'}
>
<Modal title={title} show={showModal} onClose={toggleShowModal}>
<Modal
class="max-w-4xl md:max-w-screen-md sm:max-w-screen-sm min-h-[512px]"
title={title}
show={showModal}
onClose={toggleShowModal}
>
<TableView title={title} extension={extension} />
</Modal>
</ExtensionPanel>
Expand Down
2 changes: 1 addition & 1 deletion src/components/table/table-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function TableView({ title, extension }: TableViewProps) {
</table>
{/* Empty view. */}
{table.getRowModel().rows.length > 0 ? null : (
<div class="flex items-center justify-center h-52 w-full">
<div class="flex items-center justify-center h-[320px] w-full">
<p class="text-base-content text-opacity-50">{t('No data available.')}</p>
</div>
)}
Expand Down

0 comments on commit 2d284b5

Please sign in to comment.