From 6be66a1a72a0a465c291ffa01029c0ad095020ed Mon Sep 17 00:00:00 2001
From: Rafael Laszlo <rlacko99@gmail.com>
Date: Sun, 24 Oct 2021 21:32:45 +0200
Subject: [PATCH] Update proxy to use env and move about loading under members

---
 src/pages/AboutPage.tsx | 28 ++++++++++++++--------------
 src/setupProxy.js       |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/pages/AboutPage.tsx b/src/pages/AboutPage.tsx
index 0476af9..1e16a5a 100644
--- a/src/pages/AboutPage.tsx
+++ b/src/pages/AboutPage.tsx
@@ -9,10 +9,6 @@ import Page from './Page';
 const AboutPage: React.FC = () => {
   const { data, status } = useGetStaff();
 
-  if (!data || status === 'loading') {
-    return <CircularProgress />;
-  }
-
   return (
     <Page>
       <Box display="flex" flexDirection="column" alignItems="center" padding={3}>
@@ -30,16 +26,20 @@ const AboutPage: React.FC = () => {
           </Typography>
         </Box>
         <Box marginBottom={8} display="flex" justifyContent="center" flexWrap="wrap">
-          {data?.map((m) => (
-            <Box m={3} key={m.email}>
-              <MemberCard
-                name={m.name}
-                email={m.email}
-                acceptedPicture={m.acceptedPicture}
-                staffMemberText={m.staffMemberText}
-              />
-            </Box>
-          ))}
+          {!data || status === 'loading' ? (
+            <CircularProgress />
+          ) : (
+            data?.map((m) => (
+              <Box m={3} key={m.email}>
+                <MemberCard
+                  name={m.name}
+                  email={m.email}
+                  acceptedPicture={m.acceptedPicture}
+                  staffMemberText={m.staffMemberText}
+                />
+              </Box>
+            ))
+          )}
         </Box>
         <Box marginY={4}>
           <Typography variant="h4" color="textPrimary">
diff --git a/src/setupProxy.js b/src/setupProxy.js
index 971e367..94fbbe6 100644
--- a/src/setupProxy.js
+++ b/src/setupProxy.js
@@ -4,7 +4,7 @@ module.exports = function (app) {
   app.use(
     '/api/v1',
     createProxyMiddleware({
-      target: 'https://body-dev.maze.sch.bme.hu/dev',
+      target: process.env.REACT_APP_PROXY_TARGET,
       changeOrigin: true,
     }),
   );
-- 
GitLab