Skip to content

Commit

Permalink
Use vizarr_logo.png as template for dynamic viewer logos
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Mar 10, 2023
1 parent 291e06e commit ddfa12f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/OpenWith.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from "react";

import openwithJson from "../public/openwith.json";
// use static import of vizarr_logo.png to get base URL for other logos
import vizarr_logo from "/vizarr_logo.png";

export default function OpenWith({ source }) {
let viewers = openwithJson.viewers;
Expand All @@ -9,7 +11,7 @@ export default function OpenWith({ source }) {
<React.Fragment>
{viewers.map((viewer) => (
<a key={viewer.name} target="_blank" href={viewer.href + source} title={"Open with " + viewer.name}>
<img className="viewer_icon" src={viewer.logo} />
<img className="viewer_icon" src={vizarr_logo.replace("/vizarr_logo.png", viewer.logo)} />
</a>
))}
</React.Fragment>
Expand Down

0 comments on commit ddfa12f

Please sign in to comment.