Skip to content

Commit 52e86bd

Browse files
pumpedlunchclaude
andauthored
feat(ui): demote project logos to metadata tags (#263)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent ebc8437 commit 52e86bd

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

src/components/OracleQueryList/ItemTitle.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ChainNameAndIcon, TruncatedTitle } from "@/components";
2-
import { getProjectIcon } from "@/constants";
32
import type { OracleQueryUI } from "@/types";
43
import { HeaderWrapper, TitleHeader, TitleText, TitleWrapper } from "./style";
54

@@ -11,13 +10,11 @@ export function ItemTitle({
1110
timeFormatted,
1211
expiryType,
1312
}: OracleQueryUI) {
14-
const ProjectIcon = getProjectIcon(project);
1513
const isKnownProject = project !== "Unknown";
1614

1715
return (
1816
<TitleWrapper>
1917
<HeaderWrapper>
20-
<ProjectIcon className="w-[18px] h-[18px] mt-[2px]" />
2118
<TitleHeader>
2219
<TruncatedTitle title={title} />
2320
</TitleHeader>

src/components/OracleQueryTable/TitleCell.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { getProjectIcon } from "@/constants";
21
import type { OracleQueryUI } from "@/types";
32
import { ChainNameAndIcon } from "../ChainNameAndIcon";
43
import { TruncatedTitle } from "../TruncatedTitle";
@@ -28,13 +27,11 @@ export function TitleCell({
2827
timeFormatted,
2928
expiryType,
3029
}: OracleQueryUI) {
31-
const ProjectIcon = getProjectIcon(project);
3230
const isKnownProject = project !== "Unknown";
3331

3432
return (
3533
<TitleTD>
3634
<TitleWrapper>
37-
<ProjectIcon className="w-[clamp(24px,3vw,40px)] h-[clamp(24px,3vw,40px)] min-w-[24px]" />
3835
<TextWrapper>
3936
<TitleHeader>
4037
<TruncatedTitle title={title} />

src/components/Panel/InfoIcons/InfoIcons.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ import type { OracleQueryUI } from "@/types";
22
import { ChainIcon } from "./ChainIcon";
33
import { ExpiryTypeIcon } from "./ExpiryTypeIcon";
44
import { OoTypeIcon } from "./OoTypeIcon";
5+
import { ProjectTag } from "./ProjectTag";
56

6-
export function InfoIcons({ chainId, oracleType, expiryType }: OracleQueryUI) {
7+
export function InfoIcons({
8+
chainId,
9+
oracleType,
10+
expiryType,
11+
project,
12+
}: OracleQueryUI) {
713
return (
814
<div className="flex flex-wrap gap-3 mt-5 px-page-padding lg:px-7 mb-11">
15+
<ProjectTag project={project} />
916
<ChainIcon chainId={chainId} />
1017
<OoTypeIcon ooType={oracleType} />
1118
{expiryType && <ExpiryTypeIcon expiryType={expiryType} />}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { PanelInfoIconText, PanelInfoIconWrapper } from "@/components/style";
2+
import { getProjectIcon } from "@/constants";
3+
import type { ProjectName } from "@/projects";
4+
5+
/**
6+
* Displays a tag for the given project name.
7+
* @param project The project name to display a tag for.
8+
* @returns The tag for the given project, or null if the project is unknown or undefined.
9+
*/
10+
export function ProjectTag({ project }: { project: ProjectName | undefined }) {
11+
if (!project || project === "Unknown") return null;
12+
13+
const Icon = getProjectIcon(project);
14+
15+
return (
16+
<PanelInfoIconWrapper>
17+
<Icon className="w-6 h-6" />
18+
<PanelInfoIconText>{project}</PanelInfoIconText>
19+
</PanelInfoIconWrapper>
20+
);
21+
}

src/components/Panel/Title.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { getProjectIcon } from "@/constants";
21
import { CloseButton } from "../CloseButton";
32
import { LoadingSkeleton } from "../LoadingSkeleton";
43
import { TruncatedTitle } from "../TruncatedTitle";
@@ -10,9 +9,7 @@ type Props = {
109
isLoading: boolean;
1110
close: () => void;
1211
};
13-
export function Title({ project, title, isLoading, close }: Props) {
14-
const ProjectIcon = getProjectIcon(project);
15-
12+
export function Title({ title, isLoading, close }: Props) {
1613
const buttonMinWidth = "1rem";
1714
const buttonMaxWidth = "1.25rem";
1815
const buttonPreferredWidth = "calc(0.9rem + 0.4vw)";
@@ -21,14 +18,7 @@ export function Title({ project, title, isLoading, close }: Props) {
2118
const iconStyles =
2219
"min-w-[1.25rem] flex items-center justify-center w-[clamp(1.25rem,0.8rem+2vw,2.5rem)] h-[clamp(1.25rem,0.8rem+2vw,2.5rem)] rounded-full";
2320
return (
24-
<div className="grid grid-cols-[auto,1fr,auto] content-center gap-page-padding min-h-[84px] px-page-padding lg:px-7 py-5 bg-blue-grey-700">
25-
{isLoading ? (
26-
<div className={iconStyles}>
27-
<LoadingSkeleton width="100%" height="100%" borderRadius="50%" />
28-
</div>
29-
) : (
30-
<ProjectIcon className={iconStyles} />
31-
)}
21+
<div className="grid grid-cols-[1fr,auto] content-center gap-page-padding min-h-[84px] px-page-padding lg:px-7 py-5 bg-blue-grey-700">
3222
<h1
3323
className="inline-flex items-center max-w-[400px] text-lg text-light"
3424
id="panel-title"

0 commit comments

Comments
 (0)