From a78a1698cf802181f0b6d5ff369366c98256a5b1 Mon Sep 17 00:00:00 2001 From: yggdrasil Date: Fri, 1 Nov 2024 10:45:29 +0800 Subject: [PATCH] fix: add base URL for footer assets from env --- src/components/Footer/Footer.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 7913191..aded835 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -15,7 +15,11 @@ export const Footer: FunctionComponent = () => { const containerRef = useRef(null); useEffect(() => { - fetch(`/footer/${LOCALE_MAPPING[intl.locale as ILocale]}.html`) + fetch( + `${process?.env?.PUBLIC_URL ?? ''}/footer/${ + LOCALE_MAPPING[intl.locale as ILocale] + }.html` + ) .then((response) => response.text()) .then((data) => { const element = containerRef.current;