Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [NOT CONFIRMED] Monorepo #296

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/lint.yml → .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: lint
name: check

on:
push:
Expand All @@ -7,12 +7,13 @@ on:
branches: [main, development]

jobs:
lint:
check:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
pnpm-version: [8.15.9]

steps:
- name: Setup repo
Expand All @@ -23,5 +24,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: npm ci
- run: npm run lint
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ matrix.pnpm-version }}

- run: pnpm install
- run: pnpm -r check
- run: pnpm -r lint
- run: pnpm run lint-format
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
**/node_modules
/.pnp
.pnp.js
.env.local
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
pnpm run lint-staged
11 changes: 0 additions & 11 deletions .lintstagedrc.mjs

This file was deleted.

24 changes: 21 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
**/.git
**/node_modules
**/.next
**/.husky
**/.github
**/.DS_Store

**/node_modules

**/.next
**/.turbo
**/dist
**/out
**/coverage

public/*
static/*
apps/*/public/*
apps/*/static/*
packages/*/public/*
packages/*/static/*

LICENSE
.prettierignore
.gitignore
app/favicon.ico
pnpm-lock.yaml
yarn.lock
package-lock.json

apps/*/app/favicon.ico
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/closed/page.tsx → apps/main/app/closed/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
logOut
} from "@/util/api";
import { usePathname, useRouter } from "next/navigation";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";
import LOGOUT from "@/public/registration/logout.svg";

const Closed: React.FC = () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions app/page.tsx → apps/main/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import styles from "./page.module.scss";
import Olympian from "@/components/Home/Olympian/Olympian";
import Olympian from "@/components/Home/Hero/Hero";
import Footer from "@/components/Home/Footer/Footer";
import FAQJoinUs from "@/components/Home/FAQJoinUs/FAQJoinUs";
import FAQJoinUs from "@/components/Home/JoinUs/JoinUs";
import Sponsors from "@/components/Home/Sponsors/Sponsors";
import FAQSection from "@/components/Home/FAQ/FAQ";

Expand Down
4 changes: 2 additions & 2 deletions app/profile/page.tsx → apps/main/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import clsx from "clsx";
import Head from "next/head";
import { RegistrationData, RSVPType } from "@/util/types";
import { registrationFromAPI } from "@/util/helpers";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";
import { usePathname, useRouter } from "next/navigation";
import { QRCodeSVG } from "qrcode.react";
import Modal from "react-modal";
Expand All @@ -27,7 +27,7 @@ import {
Waitlisted
} from "@/components/Profile/RSVP/ModalViews/Rejected";
import Accepted from "@/components/Profile/RSVP/ModalViews/Accepted";
import CloseButton from "@/components/CloseButton/CloseButton";
import CloseButton from "@/components/Profile/RSVP/CloseButton/CloseButton";
import Image from "next/image";
import LOGOUT from "@/public/registration/logout.svg";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@
min-height: calc(100% - (4rem + 30vw));
padding: calc(2rem + 30vw) 1rem 2rem 1rem;
}

width: 100%;
}

.modalContent p {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getChallenge, getRegistrationOrDefault } from "@/util/api";
import Registration from "@/components/Registration/Registration";
import React, { useEffect, useState } from "react";
import { registrationFromAPI } from "@/util/helpers";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";
import { RegistrationData } from "@/util/types";

const GeneralRegistration = ({ children }: { children: React.ReactNode }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
getRegistrationOrDefault
} from "@/util/api";
import { usePathname, useRouter } from "next/navigation";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";

const Confirmation: React.FC = () => {
const [isLoading, setIsLoading] = useState(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ReviewForm from "@/components/Registration/ReviewForm";
import { getChallenge, getRegistrationOrDefault } from "@/util/api";
import { registrationFromAPI } from "@/util/helpers";
import { RegistrationData } from "@/util/types";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";

const ReviewInfo: React.FC = () => {
const [registration, setRegistration] = useState<RegistrationData | null>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import NavigationButton from "@/components/Form/NavigationButton/NavigationButto
import { isAuthenticated, authenticate, getChallenge } from "@/util/api";
import { usePathname, useRouter } from "next/navigation";
import { useState, useEffect } from "react";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";

const jwtUrl = `https://adonix.hackillinois.org/auth/login/github/?device=challenge`;
const challengeEndpoint =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import clsx from "clsx";
import { getChallenge } from "@/util/api";
import Link from "next/link";
import { useEffect, useState } from "react";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";
import { ChallengeStatus } from "@/util/types";

interface SolidButtonsProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";
import {
isAuthenticated,
authenticate,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/rsvp/page.tsx → apps/main/app/rsvp/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import AvatarSelector from "@/components/AvatarSelector/AvatarSelector";
import AvatarSelector from "@/components/Profile/RSVP/AcceptForm/AvatarSelector/AvatarSelector";
import styles from "./styles.module.scss";
import { Formik } from "formik";

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.faqMain {
position: relative;
background-color: #384646;
width: 100vw;
}

.background {
height: fit-content;
width: 100vw;
}

.faqContainer {
position: absolute;
display: flex;
Expand Down
80 changes: 49 additions & 31 deletions components/FAQ/FAQ.tsx → apps/main/components/Home/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
"use client";
import React, { useContext, useEffect, useMemo, useState } from "react";
import { FC, useContext, useEffect, useMemo, useState } from "react";

import styles from "./FAQ.module.scss";
import Link from "next/link";
import BACKGROUND_MOBILE from "@/public/home/faq/background-mobile.svg";
import BACKGROUND_DESKTOP from "@/public/home/faq/background-desktop.svg";

import Image from "next/image";
import useWindowSize from "@/hooks/use-window-size";
import clsx from "clsx";
import GlobalContext from "@/app/context";
import Link from "next/link";

const FAQ: React.FC = () => {
const FAQSection: FC = () => {
const { eventStatus } = useContext(GlobalContext);
const [currentPage, setCurrentPage] = useState(0);
const [windowWidth, setWindowWidth] = useState(0);
const windowSizeHook = useWindowSize();

const faqData = [
{
Expand Down Expand Up @@ -183,35 +190,46 @@ const FAQ: React.FC = () => {
);

return (
<div className={styles.faqContainer}>
{showArrows && (
<button
className={clsx(styles.faqArrow, styles.faqArrowLeft)}
onClick={() => navigatePage(-1)}
disabled={currentPage === 0}
>
&#x25c4;
</button>
)}
<div className={styles.faqContent}>
{currentFAQs.map((faq, index) => (
<div className={styles.faqItem} key={index}>
<h3>{faq.question}</h3>
{faq.answer}
</div>
))}
<section className={styles.faqMain}>
<Image
alt="background"
src={
windowSizeHook?.width && windowSizeHook.width >= 768
? BACKGROUND_DESKTOP
: BACKGROUND_MOBILE
}
className={styles.background}
/>
<div className={styles.faqContainer}>
{showArrows && (
<button
className={clsx(styles.faqArrow, styles.faqArrowLeft)}
onClick={() => navigatePage(-1)}
disabled={currentPage === 0}
>
&#x25c4;
</button>
)}
<div className={styles.faqContent}>
{currentFAQs.map((faq, index) => (
<div className={styles.faqItem} key={index}>
<h3>{faq.question}</h3>
{faq.answer}
</div>
))}
</div>
{showArrows && (
<button
className={clsx(styles.faqArrow, styles.faqArrowRight)}
onClick={() => navigatePage(1)}
disabled={currentPage === totalPages - 1}
>
&#x25ba;
</button>
)}
</div>
{showArrows && (
<button
className={clsx(styles.faqArrow, styles.faqArrowRight)}
onClick={() => navigatePage(1)}
disabled={currentPage === totalPages - 1}
>
&#x25ba;
</button>
)}
</div>
</section>
);
};

export default FAQ;
export default FAQSection;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import styles from "./Olympian.module.scss";
import styles from "./Hero.module.scss";
import { useContext } from "react";

import Image from "next/image";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FC } from "react";

import styles from "./FAQJoinUs.module.scss";
import styles from "./JoinUs.module.scss";
import BACKGROUND from "@/public/home/faq-joinus/faq-joinus-background.svg";

import Image from "next/image";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client";

import React, { useState } from "react";
import styles from "./AcceptRSVPForm.module.scss";
import styles from "./AcceptForm.module.scss";
import { Form, Formik } from "formik";
import * as yup from "yup";
import Checkboxes from "@/components/Form/Checkboxes/Checkboxes";
import TextInput from "@/components/Form/TextInput/TextInput";
import AvatarSelector from "../AvatarSelector/AvatarSelector";
import AvatarSelector from "./AvatarSelector/AvatarSelector";
import { refreshToken, setProfile } from "@/util/api";
import Link from "next/link";
import { RSVPDecideAccept } from "@/util/api";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";
import Image from "next/image";

const schema = yup.object({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import AcceptRSVPForm from "@/components/AcceptRSVPForm/AcceptRSVPForm";
import OlympianButton from "@/components/OlympianButton/OlympianButton";
import { useState } from "react";
import styles from "./styles.module.scss";
import ConfirmReject from "./ConfirmReject";
import { RSVPDecideDecline } from "@/util/api";
import Loading from "@/components/Loading/Loading";
import Loading from "@/components/Loading";
import Image from "next/image";
import AcceptForm from "../AcceptForm/AcceptForm";

type AcceptedType = "PRO" | "PRO_TO_GENERAL" | "GENERAL";

Expand All @@ -32,7 +32,7 @@ export default function Accepted({
};

if (accepted) {
return <AcceptRSVPForm closeModal={onRequestClose} />;
return <AcceptForm closeModal={onRequestClose} />;
}

if (declined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { RegistrationData } from "@/util/types";
import { usePathname, useRouter } from "next/navigation";
import NavigationButton from "../Form/NavigationButton/NavigationButton";
import { registerUpdate } from "@/util/api";
import Loading from "../Loading/Loading";
import Loading from "../Loading";
import { handleError, registrationToAPI } from "@/util/helpers";
import { getRegistrationSchema } from "./validation";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { reviewSchema } from "./validation";
import { registerSubmit } from "@/util/api";
import { handleError, registrationToAPI } from "@/util/helpers";
import { useRouter } from "next/navigation";
import Loading from "../Loading/Loading";
import Loading from "../Loading";
import NavigationButton from "../Form/NavigationButton/NavigationButton";

type ReviewFormProps = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading