From a89e108b6a224b0d1ad54c51c7a07937af513470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Rodrigues?= <93675410+MarioRodrigues10@users.noreply.github.com> Date: Fri, 24 Nov 2023 20:08:18 +0000 Subject: [PATCH 01/15] feat: faqs animation (#577) --- .github/workflows/trello.yml | 4 ++-- layout/FAQs/components/Question/index.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trello.yml b/.github/workflows/trello.yml index cc4842dd..a449624e 100644 --- a/.github/workflows/trello.yml +++ b/.github/workflows/trello.yml @@ -10,8 +10,8 @@ on: jobs: build: runs-on: ubuntu-latest - steps: - # Link PR to Trello + steps: + # Link PR to Trello - name: Link to Trello uses: rematocorp/trello-integration-action@v7.1.0 with: diff --git a/layout/FAQs/components/Question/index.tsx b/layout/FAQs/components/Question/index.tsx index cfb5f589..d4b49686 100644 --- a/layout/FAQs/components/Question/index.tsx +++ b/layout/FAQs/components/Question/index.tsx @@ -21,7 +21,13 @@ export default function Question({

{title}

- {showQuestion &&

{description}

} +
+ {description &&

{description}

} +
); } From c08956593dd4f680173f473816c28bba4bff9960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Rodrigues?= <93675410+MarioRodrigues10@users.noreply.github.com> Date: Sun, 26 Nov 2023 18:30:03 +0000 Subject: [PATCH 06/15] chore: standardize buttons using a button component (#571) * chore: use a Button component chore: use a Button component * fix: run formatter * fix: styling problems * fix: implement suggestions * chore: implement suggestions * fix: implement suggestions * fix: implement suggestions * fix: build error * fix: build error * fix: types error in button --- components/Button/index.tsx | 30 +++++++++++++++---- components/Layout/Layout.tsx | 2 +- components/QRScanner/index.jsx | 2 +- layout/Attendee/Profile/Profile.tsx | 12 ++++---- layout/Attendee/Wheel/Wheel.tsx | 14 ++++----- .../components/Challenges/Challenge/index.tsx | 2 +- layout/Hackathon/components/Hero/index.jsx | 2 +- .../components/Regulations/index.jsx | 2 +- layout/Home/components/Hackathon/index.jsx | 2 +- layout/Home/components/Hero/Pitch/index.jsx | 5 ++-- layout/Home/components/Speakers/index.jsx | 5 ++-- layout/Login/components/LoginForm/index.tsx | 4 +-- layout/Product/Product.tsx | 14 ++++----- .../components/ResetPasswordForm/index.tsx | 2 +- layout/SignUp/components/SignUpForm/index.tsx | 8 ++--- layout/Staff/Prize/Prize.tsx | 4 +-- .../components/StaffRedeemButton/index.jsx | 8 +++-- .../dashboard/SponsorBadgeButton/index.jsx | 9 ++++-- .../dashboard/SponsorPrizeButton/index.jsx | 9 ++++-- .../spotlight/SpotlightButton/index.jsx | 9 ++++-- layout/shared/Leaderboard/Leaderboard.tsx | 20 ++++++------- pages/register/[uuid].js | 4 +-- 22 files changed, 99 insertions(+), 70 deletions(-) diff --git a/components/Button/index.tsx b/components/Button/index.tsx index 87dcc5f3..d2ff5b36 100644 --- a/components/Button/index.tsx +++ b/components/Button/index.tsx @@ -1,27 +1,45 @@ -import { ButtonHTMLAttributes } from "react"; +import { ButtonHTMLAttributes, ReactNode } from "react"; -interface Props extends ButtonHTMLAttributes { - text: string; +interface Props extends Omit, "title"> { + title: ReactNode; + description?: string; customStyle?: string; + bold?: boolean; + disabled?: boolean; +} + +interface ButtonTitleProps { + title: ReactNode; + bold?: boolean; } export default function Button({ - text, + title, + description, type, disabled, onClick, customStyle, + bold, + ...rest }: Props) { return ( ); } + +function ButtonTitle({ title, bold }: ButtonTitleProps) { + const className = bold ? "font-ibold" : "font-iregular"; + return
{title}
; +} diff --git a/components/Layout/Layout.tsx b/components/Layout/Layout.tsx index 2a82e41b..21c4feef 100644 --- a/components/Layout/Layout.tsx +++ b/components/Layout/Layout.tsx @@ -174,7 +174,7 @@ function MobileNavbar({ diff --git a/components/QRScanner/index.jsx b/components/QRScanner/index.jsx index 9a043354..5d05d4be 100644 --- a/components/QRScanner/index.jsx +++ b/components/QRScanner/index.jsx @@ -52,7 +52,7 @@ function QRScanner({ {removeClose !== true && ( + + title="SPIN THE WHEEL" + description={`${price} tokens💰`} + bold={true} + />
diff --git a/layout/Challenges/components/Challenges/Challenge/index.tsx b/layout/Challenges/components/Challenges/Challenge/index.tsx index 24935b26..065cdeea 100644 --- a/layout/Challenges/components/Challenges/Challenge/index.tsx +++ b/layout/Challenges/components/Challenges/Challenge/index.tsx @@ -6,7 +6,7 @@ function Action({ text, url }) {
diff --git a/layout/Hackathon/components/Hero/index.jsx b/layout/Hackathon/components/Hero/index.jsx index b360cc59..04adabc4 100644 --- a/layout/Hackathon/components/Hero/index.jsx +++ b/layout/Hackathon/components/Hero/index.jsx @@ -24,7 +24,7 @@ export default function Hero() {
diff --git a/layout/Home/components/Speakers/index.jsx b/layout/Home/components/Speakers/index.jsx index a1ebfccb..12c38d12 100644 --- a/layout/Home/components/Speakers/index.jsx +++ b/layout/Home/components/Speakers/index.jsx @@ -15,8 +15,9 @@ export default function Speakers() {
diff --git a/layout/Login/components/LoginForm/index.tsx b/layout/Login/components/LoginForm/index.tsx index 5f2412a5..7bd2a561 100644 --- a/layout/Login/components/LoginForm/index.tsx +++ b/layout/Login/components/LoginForm/index.tsx @@ -51,10 +51,10 @@ export default function LoginForm() { href="/forgot-password" /> + title="REDEEM" + description={`${product.price} tokens 💰`} + bold={true} + /> )}
diff --git a/layout/ResetPassword/components/ResetPasswordForm/index.tsx b/layout/ResetPassword/components/ResetPasswordForm/index.tsx index c3855666..2a942c19 100644 --- a/layout/ResetPassword/components/ResetPasswordForm/index.tsx +++ b/layout/ResetPassword/components/ResetPasswordForm/index.tsx @@ -96,7 +96,7 @@ export default function ResetPasswordForm() {
+
); } diff --git a/layout/moonstone/sponsor/dashboard/SponsorBadgeButton/index.jsx b/layout/moonstone/sponsor/dashboard/SponsorBadgeButton/index.jsx index 3fb2f6ef..5eb272bd 100644 --- a/layout/moonstone/sponsor/dashboard/SponsorBadgeButton/index.jsx +++ b/layout/moonstone/sponsor/dashboard/SponsorBadgeButton/index.jsx @@ -1,3 +1,5 @@ +import Button from "@components/Button"; + export default function SponsorBadgeButton({ sponsor, all }) { let text = all ? ( <> @@ -8,9 +10,10 @@ export default function SponsorBadgeButton({ sponsor, all }) { ); return (
- +
); } diff --git a/layout/moonstone/sponsor/dashboard/SponsorPrizeButton/index.jsx b/layout/moonstone/sponsor/dashboard/SponsorPrizeButton/index.jsx index ae0e2fde..6fad0b9e 100644 --- a/layout/moonstone/sponsor/dashboard/SponsorPrizeButton/index.jsx +++ b/layout/moonstone/sponsor/dashboard/SponsorPrizeButton/index.jsx @@ -1,9 +1,12 @@ +import Button from "@components/Button"; + export default function SponsorPrizeButton({ prize }) { return (
- +
); } diff --git a/layout/moonstone/sponsor/spotlight/SpotlightButton/index.jsx b/layout/moonstone/sponsor/spotlight/SpotlightButton/index.jsx index 40b85b0c..9c518ce8 100644 --- a/layout/moonstone/sponsor/spotlight/SpotlightButton/index.jsx +++ b/layout/moonstone/sponsor/spotlight/SpotlightButton/index.jsx @@ -1,9 +1,12 @@ +import Button from "@components/Button"; + export default function SpotlightButton() { return (
- +
); } diff --git a/layout/shared/Leaderboard/Leaderboard.tsx b/layout/shared/Leaderboard/Leaderboard.tsx index faf30317..29a45442 100644 --- a/layout/shared/Leaderboard/Leaderboard.tsx +++ b/layout/shared/Leaderboard/Leaderboard.tsx @@ -5,6 +5,7 @@ import { withAuth, useAuth } from "@context/Auth"; import Layout from "@components/Layout"; import { Table } from "./components"; +import Button from "@components/Button"; import Day from "@components/Schedule/Day"; import ErrorMessage from "@components/ErrorMessage"; @@ -130,26 +131,25 @@ function Leaderboard() {
- - + title="HALL OF FAME" + />
{error && } diff --git a/pages/register/[uuid].js b/pages/register/[uuid].js index 728191d7..265df8b3 100644 --- a/pages/register/[uuid].js +++ b/pages/register/[uuid].js @@ -86,9 +86,9 @@ function Register() { onChange={(e) => updatePasswordConfirmation(e.currentTarget.value)} /> + ))}
-
- {Object.keys(challenges).map((k) => { +
+ {Object.keys(challenges).map((key) => { return ( -
+
); From fe4618a4e99eae78055d16fe437790c463df7a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lobo?= <30907944+joaodiaslobo@users.noreply.github.com> Date: Tue, 5 Dec 2023 00:31:56 +0000 Subject: [PATCH 12/15] feat: improve map design (#592) --- layout/FAQs/FAQs.tsx | 45 +++--- .../components/FindUs/index.tsx} | 15 +- layout/FAQs/components/index.ts | 3 +- layout/Team/Team.tsx | 3 +- layout/Team/components/FindUs/Map/index.jsx | 46 ------ layout/Team/components/index.ts | 3 +- public/images/map/location.svg | 140 ++++++++++++++++++ 7 files changed, 175 insertions(+), 80 deletions(-) rename layout/{Team/components/FindUs/index.jsx => FAQs/components/FindUs/index.tsx} (73%) delete mode 100644 layout/Team/components/FindUs/Map/index.jsx create mode 100644 public/images/map/location.svg diff --git a/layout/FAQs/FAQs.tsx b/layout/FAQs/FAQs.tsx index c1ca82b1..892e10f2 100644 --- a/layout/FAQs/FAQs.tsx +++ b/layout/FAQs/FAQs.tsx @@ -3,35 +3,38 @@ import { withoutAuth } from "@context/Auth"; import Navbar from "@components/Navbar"; import Footer from "@components/Footer"; -import { Question } from "./components"; +import { Question, FindUs } from "./components"; import questions from "@data/faqs.json"; function Faq() { return ( - -
-
-

- Frequently Asked Questions -

-

- This list of frequently asked questions serves to complement the - general rules that you can find below. Get in touch with the - organizing team whenever a question arises and we will add answers - to the most frequently asked questions here. -

-
-
-
- {questions.map((question, i) => ( - - ))} + <> + +
+
+

+ Frequently Asked Questions +

+

+ This list of frequently asked questions serves to complement the + general rules that you can find below. Get in touch with the + organizing team whenever a question arises and we will add answers + to the most frequently asked questions here. +

+
+
+
+ {questions.map((question, i) => ( + + ))} +
-
+ +
- + ); } diff --git a/layout/Team/components/FindUs/index.jsx b/layout/FAQs/components/FindUs/index.tsx similarity index 73% rename from layout/Team/components/FindUs/index.jsx rename to layout/FAQs/components/FindUs/index.tsx index e8c0648e..b5015166 100644 --- a/layout/Team/components/FindUs/index.jsx +++ b/layout/FAQs/components/FindUs/index.tsx @@ -1,8 +1,4 @@ -import dynamic from "next/dynamic"; - -const Map = dynamic(() => import("./Map"), { - ssr: false, -}); +import { motion as Motion } from "framer-motion"; const email = "cesium@di.uminho.pt"; @@ -15,10 +11,13 @@ export default function FindUs() {

- The SEI is free for participants and is organized by volunteers from + SEI is free for participants and is organized by volunteers from CeSIUM and from the university community.

- +

+ This years event will take place at Pedagogic Complex 2, Gualtar + Campus. +

Centro de Estudantes de Engenharia Informática

@@ -30,7 +29,7 @@ export default function FindUs() {
- +
); diff --git a/layout/FAQs/components/index.ts b/layout/FAQs/components/index.ts index 623c0a31..572c4b32 100644 --- a/layout/FAQs/components/index.ts +++ b/layout/FAQs/components/index.ts @@ -1,3 +1,4 @@ import Question from "./Question"; +import FindUs from "./FindUs"; -export { Question }; +export { FindUs, Question }; diff --git a/layout/Team/Team.tsx b/layout/Team/Team.tsx index a845572e..f70d455b 100644 --- a/layout/Team/Team.tsx +++ b/layout/Team/Team.tsx @@ -1,6 +1,6 @@ import { withoutAuth } from "@context/Auth"; -import { Hero, FindUs, Organization } from "./components"; +import { Hero, Organization } from "./components"; import Navbar from "@components/Navbar"; import Footer from "@components/Footer"; @@ -10,7 +10,6 @@ function Index() { -
); diff --git a/layout/Team/components/FindUs/Map/index.jsx b/layout/Team/components/FindUs/Map/index.jsx deleted file mode 100644 index 8c1c62d7..00000000 --- a/layout/Team/components/FindUs/Map/index.jsx +++ /dev/null @@ -1,46 +0,0 @@ -import { Component } from "react"; -import ReactMapGL, { Marker } from "react-map-gl"; - -class Map extends Component { - state = { - viewport: { - latitude: 41.56223051893658, - longitude: -8.39774542273983, - zoom: 15, - }, - }; - - onViewportChange = (viewport) => { - const { width, height, ...etc } = viewport; - this.setState({ viewport: etc }); - }; - - render() { - return ( - { - this.setState({ viewport }); - }} - {...this.state.viewport} - > - - - ); - } -} - -export default Map; diff --git a/layout/Team/components/index.ts b/layout/Team/components/index.ts index 4bb20541..e5eff99c 100644 --- a/layout/Team/components/index.ts +++ b/layout/Team/components/index.ts @@ -1,5 +1,4 @@ import Hero from "./Hero"; -import FindUs from "./FindUs"; import Organization from "./Organization"; -export { Hero, FindUs, Organization }; +export { Hero, Organization }; diff --git a/public/images/map/location.svg b/public/images/map/location.svg new file mode 100644 index 00000000..e79ea704 --- /dev/null +++ b/public/images/map/location.svg @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4b897ad9e7504da8b73a7971c7542bf43a269789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1rio=20Guimar=C3=A3es?= <49988070+Darguima@users.noreply.github.com> Date: Wed, 6 Dec 2023 23:30:57 +0000 Subject: [PATCH 13/15] fix: standardize button component implementation (#585) --- components/Button/index.tsx | 17 ++++------------- components/Layout/Layout.tsx | 2 +- layout/Attendee/Profile/Profile.tsx | 4 ++-- layout/Attendee/Wheel/Wheel.tsx | 4 ++-- .../components/Challenges/Challenge/index.tsx | 2 +- layout/Home/components/Hero/Pitch/index.jsx | 4 ++-- layout/Home/components/Speakers/index.jsx | 2 +- layout/Login/components/LoginForm/index.tsx | 2 +- layout/Product/Product.tsx | 2 +- .../components/ResetPasswordForm/index.tsx | 2 +- layout/SignUp/components/SignUpForm/index.tsx | 4 ++-- .../components/StaffRedeemButton/index.jsx | 5 +---- .../dashboard/SponsorBadgeButton/index.jsx | 5 +---- .../dashboard/SponsorPrizeButton/index.jsx | 2 +- .../sponsor/spotlight/SpotlightButton/index.jsx | 5 +---- layout/shared/Leaderboard/Leaderboard.tsx | 4 ++-- pages/register/[uuid].js | 6 +++--- 17 files changed, 27 insertions(+), 45 deletions(-) diff --git a/components/Button/index.tsx b/components/Button/index.tsx index d2ff5b36..dc0deab6 100644 --- a/components/Button/index.tsx +++ b/components/Button/index.tsx @@ -3,9 +3,7 @@ import { ButtonHTMLAttributes, ReactNode } from "react"; interface Props extends Omit, "title"> { title: ReactNode; description?: string; - customStyle?: string; bold?: boolean; - disabled?: boolean; } interface ButtonTitleProps { @@ -16,22 +14,15 @@ interface ButtonTitleProps { export default function Button({ title, description, - type, - disabled, - onClick, - customStyle, - bold, + bold = false, ...rest }: Props) { return (
diff --git a/layout/Attendee/Profile/Profile.tsx b/layout/Attendee/Profile/Profile.tsx index ff26cc7e..4f3c9494 100644 --- a/layout/Attendee/Profile/Profile.tsx +++ b/layout/Attendee/Profile/Profile.tsx @@ -102,10 +102,10 @@ function Profile({ courses }) {
diff --git a/layout/Attendee/Wheel/Wheel.tsx b/layout/Attendee/Wheel/Wheel.tsx index aeacf190..6cbf0c1a 100644 --- a/layout/Attendee/Wheel/Wheel.tsx +++ b/layout/Attendee/Wheel/Wheel.tsx @@ -203,11 +203,11 @@ function WheelPage() {