From e5efc80a36ece75700b6e0106b0dd2957f97374c Mon Sep 17 00:00:00 2001 From: RodBrowning Date: Fri, 29 Jul 2022 19:34:57 -0300 Subject: [PATCH] Set dynamic base URL path for Github pages --- .env.development | 1 + src/Components/Flags/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 33c35ca..f0ff756 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ VITE_BASE_API_URL = "http://localhost:3004/" VITE_API_KEY = "PlaceHolderText" +VITE_BASE_URL = "/" \ No newline at end of file diff --git a/src/Components/Flags/index.tsx b/src/Components/Flags/index.tsx index 0b00547..dfc39ae 100644 --- a/src/Components/Flags/index.tsx +++ b/src/Components/Flags/index.tsx @@ -44,7 +44,7 @@ const Flag: React.FC = ({ currency }) => { className="flag" key={flag} style={{ - backgroundImage: `url(/assets/flags/${flag})`, + backgroundImage: `url(${import.meta.env.BASE_URL}assets/flags/${flag})`, }} /> );