Skip to content

Commit f6d3177

Browse files
committed
refactor: minor fixes to home component styles
1 parent a54c5b5 commit f6d3177

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

web/src/components/RegistryCard/StatusBanner.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,28 @@ export const mapFromSubgraphStatus = (status: string, isDisputed: boolean) => {
3838
return Status.ClearingPending;
3939
}
4040
};
41+
42+
const statusStyles: Record<Status, string> = {
43+
[Status.RegistrationPending]:
44+
"border-t-klerosUIComponentsPrimaryBlue bg-klerosUIComponentsMediumBlue [&_.front-color]:text-klerosUIComponentsPrimaryBlue [&_.dot::before]:bg-klerosUIComponentsPrimaryBlue",
45+
[Status.ClearingPending]:
46+
"border-t-klerosUIComponentsPrimaryBlue bg-klerosUIComponentsMediumBlue [&_.front-color]:text-klerosUIComponentsPrimaryBlue [&_.dot::before]:bg-klerosUIComponentsPrimaryBlue",
47+
[Status.Disputed]:
48+
"border-t-klerosUIComponentsSecondaryPurple bg-klerosUIComponentsMediumPurple [&_.front-color]:text-klerosUIComponentsSecondaryPurple [&_.dot::before]:bg-klerosUIComponentsSecondaryPurple",
49+
[Status.Included]:
50+
"border-t-klerosUIComponentsSuccess bg-klerosUIComponentsSuccessLight [&_.front-color]:text-klerosUIComponentsSuccess [&_.dot::before]:bg-klerosUIComponentsSuccess",
51+
[Status.Removed]:
52+
"border-t-klerosUIComponentsError bg-klerosUIComponentsErrorLight [&_.front-color]:text-klerosUIComponentsError [&_.dot::before]:bg-klerosUIComponentsError",
53+
};
54+
4155
const StatusBanner: React.FC<IStatusBanner> = ({ status, isListView = false }) => (
4256
<div
4357
className={cn(
4458
"flex items-center justify-between px-6 rounded-t-[3px]",
4559
isListView ? "h-min" : "h-11",
4660
isListView && "p-0",
4761
"[&_.dot::before]:content-[''] [&_.dot::before]:inline-block [&_.dot::before]:h-2 [&_.dot::before]:w-2 [&_.dot::before]:rounded-[50%] [&_.dot::before]:mr-2",
48-
!isListView && [
49-
"border-t-[5px]",
50-
(status === Status.RegistrationPending || status === Status.ClearingPending) &&
51-
"border-t-klerosUIComponentsPrimaryBlue bg-klerosUIComponentsMediumBlue [&_.front-color]:text-klerosUIComponentsPrimaryBlue [&_.dot::before]:bg-klerosUIComponentsPrimaryBlue",
52-
status === Status.Disputed &&
53-
"border-t-klerosUIComponentsSecondaryPurple bg-klerosUIComponentsMediumPurple [&_.front-color]:text-klerosUIComponentsSecondaryPurple [&_.dot::before]:bg-klerosUIComponentsSecondaryPurple",
54-
status === Status.Included &&
55-
"border-t-klerosUIComponentsSuccess bg-klerosUIComponentsSuccessLight [&_.front-color]:text-klerosUIComponentsSuccess [&_.dot::before]:bg-klerosUIComponentsSuccess",
56-
status === Status.Removed &&
57-
"border-t-klerosUIComponentsError bg-klerosUIComponentsErrorLight [&_.front-color]:text-klerosUIComponentsError [&_.dot::before]:bg-klerosUIComponentsError",
58-
]
62+
!isListView && ["border-t-[5px]", statusStyles[status]]
5963
)}
6064
>
6165
<label className="front-color dot">{getStatusLabel(status)}</label>

web/src/components/TruncatedText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface ITruncatedText {
1414
*/
1515
const TruncatedText: React.FC<ITruncatedText> = ({ text, maxLength, className }) => {
1616
const truncatedText = text?.length <= maxLength ? text : text?.slice(0, maxLength) + "…";
17-
return <h3 className={cn("font-normal m-0", className)}>{truncatedText}</h3>;
17+
return <div className={cn("text-klerosUIComponentsPrimaryText font-normal m-0", className)}>{truncatedText}</div>;
1818
};
1919

2020
export default TruncatedText;

0 commit comments

Comments
 (0)