-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
77 additions
and
33 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* This program has been developed by students from the bachelor | ||
* Computer Science at Utrecht University within the Software Project course. | ||
* | ||
* © Copyright Utrecht University | ||
* (Department of Information and Computing Sciences) | ||
*/ | ||
|
||
import { Addon } from "@polarexpress/types/addon"; | ||
import React from "react"; | ||
import GpLogo from "../../assets/favicon-180x180.png"; | ||
|
||
type AddonItemProperties = { | ||
addon: Addon; | ||
} & React.HTMLAttributes<HTMLDivElement>; | ||
|
||
/** | ||
* Renders the icon for a given addon. | ||
*/ | ||
function AddonIcon({ addon, ...properties }: AddonItemProperties) { | ||
const { _id, icon, name } = addon; | ||
|
||
return ( | ||
<div {...properties}> | ||
<img | ||
alt={`Icon for ${name}`} | ||
src={ | ||
icon | ||
? `${import.meta.env.VITE_API_BASE}/store/addons/${_id}/${icon}` | ||
: GpLogo | ||
} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default AddonIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters