From fa18a5e6a866bc498831ecd43603fb468de2afc6 Mon Sep 17 00:00:00 2001 From: Akseli Kolari Date: Wed, 17 Apr 2024 15:28:04 +0300 Subject: [PATCH] Fix issues in react files --- src/components/Footer/Footer.tsx | 2 +- src/components/Register/RegisterForm.tsx | 2 +- src/index.tsx | 1 - src/lib/apiRequests/api.ts | 2 +- src/views/FrontPage/FrontPage.tsx | 4 ++-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index cad3995..c4e7adb 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,6 +1,6 @@ import React from 'react'; import styles from './Footer.module.scss'; -import { ReactComponent as Tayttopaikka } from '../../svg/tayttopaikka.svg'; +import Tayttopaikka from '../../svg/tayttopaikka.svg?react'; import happihakkiInstructions from '../../Files/happihakki-instructions.pdf'; export const Footer: React.FC = () => { diff --git a/src/components/Register/RegisterForm.tsx b/src/components/Register/RegisterForm.tsx index c9f5883..cce2d9b 100644 --- a/src/components/Register/RegisterForm.tsx +++ b/src/components/Register/RegisterForm.tsx @@ -18,7 +18,7 @@ type RegisterFormFields = { turnstileToken: string; }; -const TURNSTILE_SITE_KEY = process.env.REACT_APP_TURNSTILE_SITE_KEY; +const TURNSTILE_SITE_KEY = import.meta.env.VITE_TURNSTILE_SITE_KEY; export const RegisterForm: React.FC = () => { if (TURNSTILE_SITE_KEY === undefined) { diff --git a/src/index.tsx b/src/index.tsx index 7b11861..36e782f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom/client'; import '@fontsource/roboto'; import 'bootstrap/dist/css/bootstrap.min.css'; diff --git a/src/lib/apiRequests/api.ts b/src/lib/apiRequests/api.ts index d9f85d5..6e85a4f 100644 --- a/src/lib/apiRequests/api.ts +++ b/src/lib/apiRequests/api.ts @@ -2,7 +2,7 @@ import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; import { getValidToken } from '../auth'; const AXIOS_CONFIG: AxiosRequestConfig = { - baseURL: process.env.REACT_APP_BACKEND_URL, + baseURL: import.meta.env.VITE_BACKEND_URL, }; export const getAsync = async ( diff --git a/src/views/FrontPage/FrontPage.tsx b/src/views/FrontPage/FrontPage.tsx index b8afe13..e1b1bdf 100644 --- a/src/views/FrontPage/FrontPage.tsx +++ b/src/views/FrontPage/FrontPage.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { BsArrowLeftCircle } from 'react-icons/bs'; -import { ReactComponent as Tayttopaikka } from '../../svg/tayttopaikka.svg'; -import { ReactComponent as D12 } from '../../svg/D12.svg'; +import Tayttopaikka from '../../svg/tayttopaikka.svg?react'; +import D12 from '../../svg/D12.svg?react'; import { Outlet, Link, useLocation } from 'react-router-dom'; import styles from './FrontPage.module.scss'; import { Container } from 'react-bootstrap';