Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve containers images modal #3471

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions web/src/layout/common/SeeAllModal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
width: 620px !important;
}

.modalBig {
width: 840px !important;
}

.summary {
font-size: 70%;
top: -1px;
Expand Down
7 changes: 6 additions & 1 deletion web/src/layout/common/SeeAllModal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import classNames from 'classnames';
import { isUndefined } from 'lodash';
import { useEffect, useState } from 'react';
import { HiPlusCircle } from 'react-icons/hi';
Expand All @@ -16,6 +17,7 @@ interface Props {
modalClassName?: string;
moreBtnText?: string;
visibleModal?: boolean;
size?: string;
}

const DEFAULT_VISIBLE_ITEMS = 5;
Expand Down Expand Up @@ -74,11 +76,14 @@ const SeeAllModal = (props: Props) => {

<Modal
modalDialogClassName={styles.modalDialog}
modalClassName={`${props.modalClassName} ${styles.modal}`}
modalClassName={classNames(props.modalClassName, styles.modal, {
[styles.modalBig]: !isUndefined(props.size) && props.size === 'xl',
})}
header={<div className={`h3 m-2 flex-grow-1 text-truncate ${styles.title}`}>{props.title}</div>}
open={openStatus}
onClose={() => setOpenStatus(false)}
footerClassName={styles.modalFooter}
size={props.size}
>
<div className="my-3 mw-100">
<div className="d-none d-md-block">{props.itemsForModal || props.items}</div>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions web/src/layout/package/ContainersImages.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,11 @@
background-color: var(--color-black-15) !important;
color: var(--color-font);
}

.image {
font-size: 0.9rem;
}

.imageCol {
width: 70%;
}
5 changes: 3 additions & 2 deletions web/src/layout/package/ContainersImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const ContainersImages = (props: Props) => {

itemsForModal.push(
<tr key={`container-row-${index}-${containerImage.image}`}>
<td>
<td className={styles.image}>
<div className={`d-flex flex-row align-items-center`}>
<div className="mx-1">
<FiPackage className="text-muted" />
Expand Down Expand Up @@ -124,7 +124,7 @@ const ContainersImages = (props: Props) => {
<table className={`table table-striped table-bordered table-sm mb-0 ${styles.table}`}>
<thead>
<tr className={styles.tableTitle}>
<th scope="col">
<th scope="col" className={styles.imageCol}>
<span className="px-1">Image</span>
</th>
<th scope="col">
Expand Down Expand Up @@ -155,6 +155,7 @@ const ContainersImages = (props: Props) => {
moreBtnText="details"
{...containers}
packageId={props.packageId}
size="xl"
visibleModal
/>
</div>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.