From f37b9e989dc119b8a58360eedc8a3f4b1a89528a Mon Sep 17 00:00:00 2001 From: Pavlos Orfanidis Date: Sun, 24 Nov 2024 18:11:31 +0200 Subject: [PATCH] Updated the card fonts and the contact page to use the new Grid2 --- package-lock.json | 14 ++++ package.json | 2 + src/Contact.jsx | 62 ++++++++++++++--- src/Home/Departments/DepartmentCard.jsx | 92 ++++++++++++------------- 4 files changed, 111 insertions(+), 59 deletions(-) diff --git a/package-lock.json b/package-lock.json index f57fa60..6ec5c65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,9 @@ "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", + "@fontsource/indie-flower": "^5.1.0", "@fontsource/montserrat": "^5.1.0", + "@fontsource/pacifico": "^5.1.0", "@fontsource/roboto": "^5.1.0", "@mui/icons-material": "^6.1.6", "@mui/material": "^6.1.6", @@ -3317,12 +3319,24 @@ "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==", "license": "MIT" }, + "node_modules/@fontsource/indie-flower": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@fontsource/indie-flower/-/indie-flower-5.1.0.tgz", + "integrity": "sha512-haIicLlGtHNxekUmWD508DMwr/Bac7eG0bAS/xdXdpfI9m0rg4a1ojb8qCLj+hioMBTCmR540kgCoccSTr9kxQ==", + "license": "OFL-1.1" + }, "node_modules/@fontsource/montserrat": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@fontsource/montserrat/-/montserrat-5.1.0.tgz", "integrity": "sha512-HB4+rWP9Y8g6T9RGRVJk2SvAJtx2eBAXuivvPOqQdD806/9WESUfucfH9LqFj3bGgdhNCfh0Rv0NGuwEmBLRiw==", "license": "OFL-1.1" }, + "node_modules/@fontsource/pacifico": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@fontsource/pacifico/-/pacifico-5.1.0.tgz", + "integrity": "sha512-IdnKKkRr2eYw+c3WaYwJGDaaBqaLkLZ9DMUWunQ5wR+J3BxfonwmOo/c3HDmErGTSXqSJ5bG+h8BPJq80fQigA==", + "license": "OFL-1.1" + }, "node_modules/@fontsource/roboto": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.1.0.tgz", diff --git a/package.json b/package.json index 2daaefd..dd7b12c 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", + "@fontsource/indie-flower": "^5.1.0", "@fontsource/montserrat": "^5.1.0", + "@fontsource/pacifico": "^5.1.0", "@fontsource/roboto": "^5.1.0", "@mui/icons-material": "^6.1.6", "@mui/material": "^6.1.6", diff --git a/src/Contact.jsx b/src/Contact.jsx index 4c2cb38..58842e4 100644 --- a/src/Contact.jsx +++ b/src/Contact.jsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; -import { Typography, TextField, Button, Alert, CircularProgress, Box, Paper, Grid } from '@mui/material'; -import { getFunctions, httpsCallable } from 'firebase/functions'; +import { Typography, TextField, Button, Alert, CircularProgress, Box, Paper, Skeleton } from '@mui/material'; +import Grid2 from '@mui/material/Grid2'; // Import Grid2 from MUI +import { httpsCallable } from 'firebase/functions'; import { functions } from "./firebase.js"; function Contact() { @@ -10,6 +11,7 @@ function Contact() { const [success, setSuccess] = useState(false); const [error, setError] = useState(null); const [loading, setLoading] = useState(false); + const [mapLoading, setMapLoading] = useState(true); const sendContactMessage = httpsCallable(functions, 'sendContactMessage'); @@ -44,9 +46,30 @@ function Contact() { Συμπληρώστε την παρακάτω φόρμα για να επικοινωνήσετε μαζί μας. - - -
+ {/* Main Container */} + + {/* Left Column (Form) */} + + {success && Το μήνυμα στάλθηκε με επιτυχία!} {error && {error}} - - + + + {/* Right Column (Map) */} + + {mapLoading && } - - + + ); } -export default Contact; \ No newline at end of file +export default Contact; diff --git a/src/Home/Departments/DepartmentCard.jsx b/src/Home/Departments/DepartmentCard.jsx index ddca398..1838fe2 100644 --- a/src/Home/Departments/DepartmentCard.jsx +++ b/src/Home/Departments/DepartmentCard.jsx @@ -7,6 +7,9 @@ import CalendarTodayIcon from '@mui/icons-material/CalendarToday'; import { useSpring, animated } from '@react-spring/web'; import useMediaQuery from "@mui/material/useMediaQuery"; import { useTheme } from "@mui/styles"; +import '@fontsource/pacifico'; +import '@fontsource/roboto'; +import '@fontsource/indie-flower'; const DepartmentCard = ({ department, chief }) => { const theme = useTheme(); @@ -21,7 +24,7 @@ const DepartmentCard = ({ department, chief }) => { const overlayAnimation = useSpring({ loop: true, from: { transform: 'rotate(0deg)' }, - to: { transform: 'rotate(30deg)' }, + to: { transform: 'rotate(360deg)' }, config: { duration: 5000 }, }); @@ -116,59 +119,52 @@ const DepartmentCard = ({ department, chief }) => { ) )} - - + + {department.name} - + {department.moto} - - - {department.age} χρονών - - - {chief && ( - - - - Αρχηγός: {chief.name} - - - - Τηλέφωνο: {chief.phone} - - - - Email: {chief.email} + {department.age && ( + + + {department.age} χρονών + + )} + {chief && <> + {chief.meetingDate && ( + + + {chief.meetingDate} - - - Συνάντηση: {chief.meeting} + )} + {chief.name ? ( + + + Chief: {chief.name} + + {chief.phone && ( + + + {chief.phone} + + )} + {chief.email && ( + + + {chief.email} + + )} + + ) : ( + + No chief information available. - - )} + )} + } );