Skip to content

Commit

Permalink
2023 post-event PR (#487)
Browse files Browse the repository at this point in the history
* Add CTF link (#360) (#361)

* Fix scanning on iPhone (#375)

* Deploy "blue" (#397)

* Fixing user spamming the wheel (#391)

* Add links, order members by name and improve labels (#381)

* 🎨 Improve login design (#367)

* Fix typo (#394)

* Fixed date displayed on Schedule

* Change date shown to first day

* Fix build (#395)

Co-authored-by: Enzo Vieira <[email protected]>
Co-authored-by: Nelson Estevão <[email protected]>
Co-authored-by: Filipe Felício <[email protected]>
Co-authored-by: Rui Lopes <[email protected]>
Co-authored-by: tiago-bacelar <[email protected]>

* Add 2023 schedule

* Finish team members

* Sponsor list

* More data

* More data

* Remove hackathons

* Remove hackathons

* Change FAQ date

* Remove login entry & Fix register link

* Update informations in team and schedule page (#421)

* update infos

* Remove login

* Add recruitment forms link

* update eurotux and fujitsu logo (#424)

* Update website informations (#426)

* Update talk schedule (#427)

* Fix mistake

* Update informations 24/06 (#429)

* Update informations (#431)

* Join Our Staff

* add schedule informations

* Change max date (#432)

* Update schedule (#433)

* Update informations (#434)

* add talks & workshops information

* Fix Ricardo Rocha image

* Update information (#436)

* update informations

* report a problem

* fix typos

* Update Informations (#438)

* add informations talk subvisual

* fix typo

* Update informations (#439)

* update informations

* resolve typo

* Update Informations (#440)

* Update informations (#442)

* Update information (#445)

* Update informations (#447)

* Update informations (#449)

* add informations

* change 'report a problem' to footer

* Update photos (#450)

* Update Informations (#456)

* update informations

* add media team

* Update Informations (#461)

* Update Prizes (#464)

* Fix small merge errors

* Fix last details

* Fix typo

* Add login back to navbar

* Bump to prod

* Add pagination to badgedex (#474)

Co-authored-by: Rui Lopes <[email protected]>

* Change login to signup when logged in

* Fix retail consult logo

* Add pagination to badges (#475)

* Add pagination to badges

* Run formatter

* Fix build

* Revert some changes

---------

Co-authored-by: Rui Lopes <[email protected]>

* update saber logo

* Fix Pagination Component (#478)

* Fix Pagination Component

* Fix signup validation (#479)

* feat(pages/identifier): Page that generates qrcode to identify attendee (#476)

Co-authored-by: Rui Lopes <[email protected]>

* Fixed that thing where some people can't see their prizes in the vault (#480)

* Solved typo

* Run Formatter

---------

Co-authored-by: Rui Lopes <[email protected]>
Co-authored-by: Enzo Vieira <[email protected]>
Co-authored-by: tiago-bacelar <[email protected]>

* Minor change

* Update regulamento

* Update details

* Remove pagination from company page

* Fix pagination icons

* small update

---------

Co-authored-by: Miguel Brandão <[email protected]>
Co-authored-by: Filipe Felício <[email protected]>
Co-authored-by: Nelson Estevão <[email protected]>
Co-authored-by: LAraujo7 <[email protected]>
Co-authored-by: Ruben Adão <[email protected]>
Co-authored-by: Francisco Neves <[email protected]>
Co-authored-by: Enzo Vieira <[email protected]>
Co-authored-by: Rui Lopes <[email protected]>
Co-authored-by: tiago-bacelar <[email protected]>
Co-authored-by: Rui Lopes <[email protected]>
Co-authored-by: Mário Rodrigues <[email protected]>
Co-authored-by: Mário Rodrigues <[email protected]>
Co-authored-by: Enzo Vieira <[email protected]>
Co-authored-by: tiago-bacelar <[email protected]>
  • Loading branch information
15 people committed Feb 25, 2023
1 parent dea8b41 commit 5538926
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 178 deletions.
2 changes: 1 addition & 1 deletion context/Auth/withAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function withAuth(WrappedComponent) {
const { user } = useAuth();

if (!user) {
router.replace("/login");
router.replace("/signup");
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion data/challenges.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Playstation 5 + Fifa 23"
},
{
"name": "Tronite Elétrica Xiaomi Mi Essential"
"name": "Trotinete Elétrica Xiaomi Mi Essential"
},
{
"name": "Apple Watch SE"
Expand Down
2 changes: 1 addition & 1 deletion data/sponsors.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"link": "https://www.continental-pneus.pt"
},
{
"image": "rentailconsult",
"image": "retailconsult",
"link": "https://www.retail-consult.com/"
}
]
Expand Down
36 changes: 34 additions & 2 deletions layout/Attendee/Badgedex/Badgedex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,38 @@ import { getAllBadges } from "@lib/api";

import Layout from "@components/Layout";

import Pagination from "./components/Pagination";
import ErrorMessage from "@components/ErrorMessage";
import Badge from "@components/Badge";
import BadgeFilter from "@components/BadgeFilter";

interface Badges {
id: string;
type: string;
name: string;
description: string;
}

function Badgedex() {
const { user } = useAuth();
const [allBadges, updateAllBadges] = useState([]);
const [allBadges, updateAllBadges] = useState<Badges[]>([]);
const [all, updateAll] = useState(true);
const [filter, updateFilter] = useState(null);
const [error, setError] = useState();
const [currentPage, setCurrentPage] = useState(1);
const [badgesPerPage] = useState(10);

const indexOfLastVisitor = currentPage * badgesPerPage;
const indexOfFirstVisitor = indexOfLastVisitor - badgesPerPage;
const currentBadges: any = allBadges.slice(
indexOfFirstVisitor,
indexOfLastVisitor
);

const paginate = (pageNumber) => setCurrentPage(pageNumber);
if (currentBadges.length === 0 && currentPage !== 1) {
paginate(0);
}

useEffect(() => {
getAllBadges()
Expand Down Expand Up @@ -59,7 +81,7 @@ function Badgedex() {
</div>
<div className="mt-8 grid grid-cols-1 gap-x-10 gap-y-5 text-white xs:grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6">
{all
? allBadges
? currentBadges
.filter((badge) => badge.type == filter || filter == null)
.map((badge) => (
<Badge
Expand All @@ -72,6 +94,16 @@ function Badgedex() {
.filter((badge) => badge.type == filter || filter == null)
.map((badge) => <Badge key={badge.id} owned={true} {...badge} />)}
</div>
{all && (
<div className="mt-5">
<Pagination
badgesPerPage={badgesPerPage}
totalBadges={allBadges.length}
paginate={paginate}
currentPage={currentPage}
/>
</div>
)}
{error && <ErrorMessage />}
</Layout>
);
Expand Down
32 changes: 32 additions & 0 deletions layout/Attendee/Badgedex/components/Pagination.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { ArrowRightIcon, ArrowLeftIcon } from "@heroicons/react/solid";

const Pagination = ({ badgesPerPage, totalBadges, paginate, currentPage }) => {
const pageNumbers = [];

for (let i = 1; i <= Math.ceil(totalBadges / badgesPerPage); i++) {
pageNumbers.push(i);
}

return (
<nav>
<ul className="flex flex-row justify-center">
{totalBadges !== 0 && currentPage !== 1 && (
<li className="page-item mr-1">
<button onClick={() => paginate(currentPage - 1)}>
<ArrowLeftIcon className="h-5 w-5" />
</button>
</li>
)}
{totalBadges !== 0 && currentPage !== pageNumbers.length && (
<li className="mx-1">
<button onClick={() => paginate(currentPage + 1)}>
<ArrowRightIcon className="h-5 w-5" />
</button>
</li>
)}
</ul>
</nav>
);
};

export default Pagination;
15 changes: 7 additions & 8 deletions layout/Attendee/Profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ function Profile() {
} else if (companyBadges < 15) {
level = 2;
neededBadges = 15 - companyBadges;
} else if (companyBadges < 19) {
} else if (companyBadges < 20) {
level = 3;
neededBadges = 19 - companyBadges;
} else {
neededBadges = 20 - companyBadges;
} else if (companyBadges < 24) {
level = 4;
neededBadges = 24 - companyBadges;
} else {
level = 5;
neededBadges = 0;
}

Expand Down Expand Up @@ -117,7 +120,7 @@ function Profile() {
)}

{editing && (
<label className="absolute top-0 left-0 flex h-[220px] w-[220px] cursor-pointer items-center justify-center rounded-full bg-quinary text-white opacity-50 transition-all ease-linear hover:opacity-90">
<label className="absolute top-0 left-0 flex h-[220px] w-[220px] cursor-pointer items-center justify-center rounded-full bg-quinary text-black opacity-50 transition-all ease-linear hover:opacity-90">
<input
type="file"
className="hidden"
Expand Down Expand Up @@ -235,10 +238,6 @@ function Profile() {

<div className="mt-10 text-white">
<Heading text="Upload CV" />
<p className="font-iregular">
Get a chance to win a spot at the Corporate dinner by submiting
you CV!
</p>
<CVInput cv={user?.cv} onSubmit={submitCV}></CVInput>
</div>
</div>
Expand Down
21 changes: 15 additions & 6 deletions layout/Attendees/Attendees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getAttendee, isAttendeeRegistered } from "@lib/api";

function Profile() {
const [attendee, updateAttendee] = useState(null);
const [avatar, setAvatar] = useState(null);
const router = useRouter();
const { uuid } = router.query;
const [filter, updateFilter] = useState(null);
Expand All @@ -35,12 +36,20 @@ function Profile() {
<div className="col-span-1 float-left w-full xl:w-1/2">
<Heading text="User Profile"></Heading>
<div className="pl-6">
<div className="relative h-[220px] w-[220px] overflow-hidden rounded-full hover:border-2 hover:border-quinary">
<img
src={attendee.avatar}
alt="Avatar Photo"
className="rounded-full"
/>
<div className="relative h-[220px] w-[220px] overflow-hidden rounded-full border-2 border-white hover:border-quinary">
{attendee.avatar == null ? (
<img
src="/images/mascot-head.png"
alt="Avatar Photo"
className="h-[220px] w-[220px] object-cover"
/>
) : (
<img
src={attendee.avatar}
alt="Avatar Photo"
className="h-[220px] w-[220px] object-cover"
/>
)}
</div>
</div>
</div>
Expand Down
21 changes: 1 addition & 20 deletions layout/Sponsor/Visitors/Visitors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ const navigation = ["scanner", "visitors"];
const SponsorVisitors: React.FC<Props> = () => {
const { user } = useAuth();
const [visitors, setVisitors] = useState<Visitor[]>([]);
const [currentPage, setCurrentPage] = useState(1);
const [visitorsPerPage] = useState(30);

const indexOfLastVisitor = currentPage * visitorsPerPage;
const indexOfFirstVisitor = indexOfLastVisitor - visitorsPerPage;
const currentVisitors = visitors.slice(
indexOfFirstVisitor,
indexOfLastVisitor
);

const paginate = (pageNumber) => setCurrentPage(pageNumber);
const [downloading, setDownloading] = useState<boolean>(false);

const downloadCVs = () => {
Expand Down Expand Up @@ -89,7 +78,7 @@ const SponsorVisitors: React.FC<Props> = () => {
</button>
)}
<div className="grid grid-cols-1 lg:grid-cols-4">
{currentVisitors.map((visitor) => (
{visitors.map((visitor) => (
<div
key={visitor.id}
className="hover:b-4 m-2 mb-4 flex flex-col items-center justify-center rounded-lg p-2 hover:border-blue-500"
Expand All @@ -116,14 +105,6 @@ const SponsorVisitors: React.FC<Props> = () => {
</div>
))}
</div>
<div className="mt-5">
<Pagination
visitorsPerPage={visitorsPerPage}
totalVisitors={visitors.length}
paginate={paginate}
currentPage={currentPage}
/>
</div>
</div>
</Layout>
);
Expand Down
56 changes: 15 additions & 41 deletions layout/Sponsor/components/Pagination.jsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,31 @@
import { ArrowRightIcon, ArrowLeftIcon } from "@heroicons/react/solid";

const Pagination = ({
visitorsPerPage,
totalVisitors,
paginate,
currentPage,
}) => {
const totalPages = Math.ceil(totalVisitors / visitorsPerPage);
const pageNumbers = [
...new Set(
[1, currentPage - 1, currentPage, currentPage + 1, totalPages].filter(
(x) => x >= 1 && x <= totalPages
)
),
]; // Filter in range [1..totalPages]
const pageNumbers = [];

const pageComponents = [];
for (let i = 1; i <= pageNumbers.length; i++) {
if (i > 1 && pageNumbers[i - 1] - 1 > pageNumbers[i - 2])
pageComponents.push(<>..</>);
pageComponents.push(
<li
key={i}
className={`page-item m-auto px-2 ${
currentPage === i ? "active text-quinary" : ""
}`}
>
<button onClick={() => paginate(i)} className="page-link">
{i}
</button>
</li>
);
for (let i = 1; i <= Math.ceil(totalVisitors / visitorsPerPage); i++) {
pageNumbers.push(i);
}

return (
<nav className="m-auto w-fit">
<ul className="pagination flex flex-row">
{currentPage !== 1 && (
<li className="page-item mr-1">
<button
onClick={() => paginate(currentPage - 1)}
className="page-link mr-4"
>
&larr;
<nav>
<ul className="flex flex-row justify-center">
{totalVisitors !== 0 && currentPage !== 1 && (
<li className="mx-1">
<button onClick={() => paginate(currentPage - 1)}>
<ArrowLeftIcon className="h-5 w-5" />
</button>
</li>
)}
{pageComponents}
{currentPage !== totalPages && (
<li className="page-item mr-1">
<button
onClick={() => paginate(currentPage + 1)}
className="page-link ml-4"
>
&rarr;
{totalVisitors !== 0 && currentPage !== pageNumbers.length && (
<li className="mx-1">
<button onClick={() => paginate(currentPage + 1)}>
<ArrowRightIcon className="h-5 w-5" />
</button>
</li>
)}
Expand Down
15 changes: 11 additions & 4 deletions layout/Team/components/FindUs/Map/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,24 @@ class Map extends Component {
return (
<ReactMapGL
width="100%"
height="300px"
mapStyle="mapbox://styles/cesinformaticaum/ckwtkrcrc2ypr15nv538kb58z"
height="400px"
mapStyle="mapbox://styles/cesiuminho/cle4zw39g000i01t6aco31jq1"
mapboxApiAccessToken="pk.eyJ1IjoiY2VzaW5mb3JtYXRpY2F1bSIsImEiOiJja3d0aGRoc3ExZ2E2Mm9wbTlrbjlucmt1In0.vMxC_EtVdBjkc9-F7HsMCw"
onViewportChange={(viewport) => {
this.setState({ viewport });
}}
{...this.state.viewport}
>
<Marker
latitude={41.56223051893658}
longitude={-8.39774542273983}
latitude={41.5599239}
longitude={-8.3963955}
style={{
cursor: "pointer",
"background-color": "#F52AB1",
width: "20px",
height: "20px",
"border-radius": "50%",
}}
></Marker>
</ReactMapGL>
);
Expand Down
1 change: 0 additions & 1 deletion layout/Team/components/Organization/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export default function Organization() {
title={team["activities"].title}
list={sortListMembers(team["activities"].list)}
/>

<Team
title={team["merch"].title}
list={sortListMembers(team["merch"].list)}
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package = "@netlify/plugin-nextjs"

[context.production.environment]
NEXT_PUBLIC_API_URL = "https://sei23-staging.herokuapp.com"
NEXT_PUBLIC_API_URL = "https://sei23-production.herokuapp.com"

[context.deploy-preview.environment]
NEXT_PUBLIC_API_URL = "https://sei23-staging.herokuapp.com"
NEXT_PUBLIC_API_URL = "https://sei23-production.herokuapp.com"
10 changes: 10 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
module.exports = {
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: "http",
hostname: "localhost",
port: "3000",
pathname: "**",
},
],
},
};
1 change: 0 additions & 1 deletion pages/hackathon.tsx

This file was deleted.

Binary file modified public/docs/regulamento.pdf
Binary file not shown.
Loading

0 comments on commit 5538926

Please sign in to comment.