Skip to content

Commit 464dfd8

Browse files
committed
chore: tweak empty assets message design
1 parent 4c7a4cf commit 464dfd8

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/components/Assets/AssetsEmpty.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ const kindsData = {
2222

2323
export const AssetsEmpty: FC<AssetsEmptyProps> = ({ kind }) => {
2424
return (
25-
<div className="flex flex-col items-center justify-center gap-3 w-full max-w-sm mx-auto min-h-full">
26-
<div className="flex flex-col items-center justify-center gap-1">
25+
<div className="flex flex-col items-center justify-center gap-3 w-full max-w-sm mx-auto pt-1 pb-4 min-h-full">
26+
<div className="flex flex-col items-center justify-center gap-0.5 text-center">
2727
<img
2828
src={kindsData[kind].icon}
2929
alt={kindsData[kind].name + " icon"}
30-
className="h-[clamp(3rem,10vh,4rem)] object-contain pixelated grayscale opacity-20"
30+
className="h-16 object-contain pixelated grayscale opacity-20"
3131
>
3232
</img>
3333

34-
<h2 className="mt-3 font-bold text-lg">
34+
<h2 className="mt-0.5 font-bold text-lg">
3535
No {kindsData[kind].name}, yet
3636
</h2>
37-
<h2>
37+
<h2 className="text-sm">
3838
Click plus or drag & drop to upload
3939
</h2>
4040
</div>

src/components/Assets/AssetsList.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { type FC } from "react";
22
import type { AssetKind } from "../../features/Projects/models/AssetKind";
33
import { useProject } from "../../features/Projects/stores/useProject";
44
import { useAssets } from "../../hooks/useAssets";
5+
import { cn } from "../../util/cn";
56
import { AssetsEmpty } from "./AssetsEmpty";
67
import type { ResourceProps } from "./AssetsItem";
78
import AssetsItem from "./AssetsItem";
@@ -15,7 +16,12 @@ const AssetsList: FC<Props> = ({ kind, visibleIcon }) => {
1516
useProject((s) => s.project);
1617

1718
return (
18-
<ul className="inline-flex flex-wrap gap-6 content-start h-full pb-14 overflow-auto scrollbar-thin">
19+
<ul
20+
className={cn(
21+
"inline-flex flex-wrap gap-6 content-start h-full overflow-auto scrollbar-thin",
22+
{ "pb-14": assets.length > 0 },
23+
)}
24+
>
1925
{assets.length > 0 && assets.map((resource, i) => (
2026
<AssetsItem
2127
key={i}

0 commit comments

Comments
 (0)