Skip to content

Commit

Permalink
Use absolute urls to assets
Browse files Browse the repository at this point in the history
  • Loading branch information
starsep committed Feb 12, 2024
1 parent a776abd commit 2435b96
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/3rdparty/reactStoreBadges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React, { FC, useLayoutEffect, useState } from "react";
const HEIGHT_RATIO = 3.375;

export const googlePlayPath = (language: string) =>
`img/google-play/${language}.svg`;
`/img/google-play/${language}.svg`;

export const appStorePath = (language: string) =>
`img/play-store/${language}.svg`;
`/img/play-store/${language}.svg`;

const badgePath = (platform: "ios" | "android", language: string): string =>
platform === "android" ? googlePlayPath(language) : appStorePath(language);
Expand Down
2 changes: 1 addition & 1 deletion src/components/map_style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Country } from "~/model/country";

const getUrl = window.location;
const baseUrl = `${getUrl.protocol}//${getUrl.host}${getUrl.pathname}`;
const spriteUrl = new URL("img/sprite", baseUrl).href;
const spriteUrl = new URL("/img/sprite", baseUrl).href;
// can't use URL class since this is a template not literal url
const tilesUrl = `${backendBaseUrl}/api/v1/tile/{z}/{x}/{y}.mvt`;
const TILE_COUNTRIES_MAX_ZOOM = 6;
Expand Down
4 changes: 2 additions & 2 deletions src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const SiteNavbar: FC<SiteNavbarProps> = ({ toggleSidebarShown }) => {
target="_blank"
title="CloudFerro"
>
<img alt="CloudFerro" src="img/cloudferro_logo.png" />
<img alt="CloudFerro" src="/img/cloudferro_logo.png" />
</a>
</Navbar.Item>
<LanguageSwitcher />
Expand Down Expand Up @@ -153,7 +153,7 @@ const SiteNavbar: FC<SiteNavbarProps> = ({ toggleSidebarShown }) => {
>
{t("navbar.hosted_by")}{" "}
</span>
<img alt="CloudFerro" src="img/cloudferro_logo.png" />
<img alt="CloudFerro" src="/img/cloudferro_logo.png" />
</Navbar.Item>
</Navbar.Container>
</Navbar.Menu>
Expand Down
2 changes: 1 addition & 1 deletion src/components/partnersModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const PartnersModal: FC = () => {
<figure className="image">
<img
alt={partner.name}
src={`./img/${partner.image}`}
src={`/img/${partner.image}`}
style={{ height: `${partner.imageHeight}px` }}
/>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/defibrillatorDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const DefibrillatorDetails: FC<DefibrillatorDetailsProps> = (props) => {
<Image
m={2}
className="icon"
src="./img/logo-aed.svg"
src="/img/logo-aed.svg"
color="white"
alt=""
size={48}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/defibrillatorEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const DefibrillatorEditor: FC<DefibrillatorEditorProps> = ({
<Image
m={2}
className="icon"
src="./img/logo-aed.svg"
src="/img/logo-aed.svg"
color="white"
alt=""
size={48}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/photoReporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const PhotoReport: FC<DefibrillatorDetailsProps> = (props) => {
<Image
m={2}
className="icon"
src="./img/logo-aed.svg"
src="/img/logo-aed.svg"
color="white"
alt=""
size={48}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/photoUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const PhotoUpload: FC<DefibrillatorDetailsProps> = (props) => {
<Image
m={2}
className="icon"
src="./img/logo-aed.svg"
src="/img/logo-aed.svg"
color="white"
alt=""
size={48}
Expand Down
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ i18n
escapeValue: false, // not needed for react as it escapes by default
},
backend: {
loadPath: "./locales/{{lng}}/{{ns}}.json",
loadPath: "/locales/{{lng}}/{{ns}}.json",
},
detection: {
order: ["localStorage", "path", "navigator", "htmlTag"],
Expand Down

0 comments on commit 2435b96

Please sign in to comment.