diff --git a/examples/web/gb.ts b/examples/web/gb.ts index 6f2cf8aa71d3607d5f05d424f6acbd0b86d44ed3..0f6dc9d40df4eaaba9cf4d5b305c0059e7b76cff 100644 --- a/examples/web/gb.ts +++ b/examples/web/gb.ts @@ -373,6 +373,14 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { return "https://gitlab.stage.hive.pt/joamag/boytacean/-/blob/master/CHANGELOG.md"; } + get repository(): string | undefined { + return "GitLab"; + } + + get repositoryUrl(): string | undefined { + return "https://gitlab.stage.hive.pt/joamag/boytacean"; + } + get features(): Feature[] { return [ Feature.Debug, diff --git a/examples/web/react/app.tsx b/examples/web/react/app.tsx index 21113e59f91185e8e6ae13f9ef5899ab1b8f454e..89ab434ad43ed2775aefc7a5aaf54c4a2e158856 100644 --- a/examples/web/react/app.tsx +++ b/examples/web/react/app.tsx @@ -128,7 +128,11 @@ export interface Emulator extends ObservableI { * The URL to the page describing the current version * of the emulator. */ - get versionUrl(): string; + get versionUrl(): string | undefined; + + get repository(): string | undefined; + + get repositoryUrl(): string | undefined; /** * The features available and compatible with the emulator, @@ -264,6 +268,14 @@ export class EmulatorBase extends Observable { return undefined; } + get repository(): string | undefined { + return undefined; + } + + get repositoryUrl(): string | undefined { + return undefined; + } + get features(): Feature[] { return []; } @@ -645,16 +657,22 @@ export const App: FC<AppProps> = ({ </Link> . </Paragraph> - <Paragraph> - You can check the source code of it at{" "} - <Link - href="https://gitlab.stage.hive.pt/joamag/boytacean" - target="_blank" - > - GitLab - </Link> - . - </Paragraph> + {emulator.repository && ( + <Paragraph> + You can check the source code of it at{" "} + {emulator.repositoryUrl ? ( + <Link + href={emulator.repositoryUrl} + target="_blank" + > + {emulator.repository} + </Link> + ) : ( + <>{emulator.repository}</> + )} + . + </Paragraph> + )} <Paragraph> TIP: Drag and Drop ROM files to the Browser to load the ROM.