feat: light icons on the dark cards
A link without an icon of its own gets the library's light version when there is one (github-light), instead of a dark logo on a dark card. The server keeps the library's list of names for a day.
This commit is contained in:
@@ -12,14 +12,16 @@ export type HomeLink = {
|
||||
name: string
|
||||
url: string
|
||||
icon: string | null
|
||||
/** the library's light version of the icon, when the link has no icon of its own */
|
||||
lightIcon: string | null
|
||||
}
|
||||
|
||||
type IconProps = { link: HomeLink; className?: string }
|
||||
|
||||
/** Starts the fallback chain again when the link changes. */
|
||||
export function LinkIcon(props: IconProps) {
|
||||
const { id, name, url, icon } = props.link
|
||||
return <Icon key={[id, name, url, icon].join("|")} {...props} />
|
||||
const { id, name, url, icon, lightIcon } = props.link
|
||||
return <Icon key={[id, name, url, icon, lightIcon].join("|")} {...props} />
|
||||
}
|
||||
|
||||
function Icon({ link, className }: IconProps) {
|
||||
|
||||
Reference in New Issue
Block a user