Skip to content
Open
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
12 changes: 10 additions & 2 deletions src/components/CategorySections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,19 @@ const CategorySections: React.FC<CategorySectionsProps> = ({
[filteredList, selectedCategories],
);

// Sort categories: non-empty first, empty last (preserves relative order)
const sortedCategories = React.useMemo(() => {
const nonEmpty = selectedCategories.filter(
(cat) => buckets[cat]?.length,
);
const empty = selectedCategories.filter((cat) => !buckets[cat]?.length);
return [...nonEmpty, ...empty];
}, [selectedCategories, buckets]);

return (
<>
{selectedCategories.map((cat) => {
{sortedCategories.map((cat) => {
const data = buckets[cat] || [];
if (!data.length) return null;
return (
<CellLineTable
key={cat}
Expand Down
34 changes: 34 additions & 0 deletions src/components/CellLineTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const {
comingSoon,
container,
dataComplete,
emptyMessage,
hoveredRow,
link,
tableTitle,
titleContainer,
} = require("../../style/table.module.css");
Expand Down Expand Up @@ -118,6 +120,36 @@ const CellLineTable = ({
};
});

const noDataMessage = (
<div className={emptyMessage}>
<h2>We can't seem to find what you're looking for...</h2>
<p>
But don't cell yourself short! Try adjusting your search
parameters or reach out to our{" "}
<a
rel="noopener noreferrer"
target="_blank"
href="https://forum.allencell.org/"
className={link}
>
forum
</a>{" "}
to ask about availability.
</p>
<p>
Looking for a cell line with a disease mutation?{" "}
<a
rel="noopener noreferrer"
target="_blank"
href="https://cell-catalog.allencell.org/disease-catalog/"
className={link}
>
Check out our Disease Cell Catalog.
</a>
</p>
</div>
);

return (
<>
<Table
Expand Down Expand Up @@ -148,6 +180,8 @@ const CellLineTable = ({
dataSource={cellLines}
showSorterTooltip={false}
sortDirections={["ascend", "descend", "ascend"]}
showHeader={cellLines.length > 0}
locale={{ emptyText: noDataMessage }}
/>
</>
);
Expand Down
60 changes: 60 additions & 0 deletions src/style/table.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,40 @@
background-color: var(--WHITE);
}

.container .empty-message {
padding: 40px 0;
color: var(--BLACK);
text-align: center;
margin: 0px 29%;
}

.container .empty-message h2 {
font-size: 32px;
font-weight: 600;
}

.container .empty-message p {
font-size: 24px;
}

.link {
color: var(--link-color);
}

@media screen and (max-width: 1720px) {
.container .empty-message {
margin: 0px 18%;
}

.container .empty-message h2 {
font-size: 22px;
}

.container .empty-message p {
font-size: 18px;
}
}

@media screen and (max-width: 744px) {
.container h4 {
font-size: 20px;
Expand All @@ -334,6 +368,19 @@
.container :global(.ant-table-cell).cell-line-id {
padding: 8px 4px 8px 14px;
}

.container .empty-message {
padding: 30px 0;
margin: 0px 14%;
}

.container .empty-message h2 {
font-size: 20px;
}

.container .empty-message p {
font-size: 16px;
}
}

@media screen and (max-width: 576px) {
Expand Down Expand Up @@ -361,4 +408,17 @@
) {
width: initial;
}

.container .empty-message {
padding: 0px;
margin: 0px 6%;
}

.container .empty-message h2 {
font-size: 20px;
}

.container .empty-message p {
font-size: 16px;
}
}