Skip to content

Commit

Permalink
fix: make unsupported links not blue
Browse files Browse the repository at this point in the history
  • Loading branch information
ariesclark committed Sep 2, 2024
1 parent 84a5080 commit 637a8d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/templates/main-page/infopush.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ function getArticle({ name, article, imageUrl }: InfoPushData) {
} = item;

return (
<a href={url} title={name}>
<a
href={url}
style={{ color: "var(--link)" }}
title={name}
>
{children()}
</a>
);
Expand All @@ -88,9 +92,9 @@ function getArticle({ name, article, imageUrl }: InfoPushData) {
color: ({ value, children }) => {
if (typeof value !== "string") return <>{children()}</>;

let color =
const color =
defaultColors[value as DefaultColorName] || value;
if (color === "#7777fc") color = "var(--link)";
if (color === "#7777fc") return <>{children()}</>;

return <span style={{ color }}>{children()}</span>;
}
Expand Down

0 comments on commit 637a8d5

Please sign in to comment.