Skip to content

Commit 3706d68

Browse files
authored
[CW2-4] Add support for CI (#5)
* Add formatting and linting * Add github workflow
1 parent d8b2b94 commit 3706d68

File tree

17 files changed

+2197
-1209
lines changed

17 files changed

+2197
-1209
lines changed

.eslintrc.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": [
3+
"next/core-web-vitals",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:prettier/recommended"
6+
],
7+
"parser": "@typescript-eslint/parser",
8+
"plugins": ["@typescript-eslint"],
9+
"rules": {
10+
"prettier/prettier": ["error", { "endOfLine": "auto" }]
11+
}
312
}

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Use Node.js 16
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
18+
- name: Install dependencies
19+
run: npm install
20+
21+
- name: Lint code
22+
run: npm run lint
23+
24+
- name: Check types
25+
run: npm run type-check
26+
27+
- name: Build Next.js app
28+
run: npm run build

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"singleQuote": true,
6+
"trailingComma": "none"
7+
}

components/About/index.tsx

Lines changed: 95 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,95 @@
1-
import Image from "next/image";
2-
3-
const About = () => {
4-
return (
5-
<section className="py-8 xl:px-24 sm:px-10 px-5" id="about">
6-
<div className="text-center my-10">
7-
<p className="text-[#3977F8] font-game text-xl">01</p>
8-
<h1 className="font-bold text-6xl">ABOUT</h1>
9-
</div>
10-
<div className="flex justify-center items-center">
11-
<div className="lg:grid grid-cols-6 flex-1 max-w-[90rem]">
12-
{/* LEFT SIDE */}
13-
<div className="col-span-2 md:mx-5">
14-
<div className="flex items-center justify-center">
15-
<Image src="/assets/csesoc_icon.svg" alt="CSESoc Icon" width={150} height={150} />
16-
</div>
17-
<h1 className="mt-10 text-3xl font-extrabold">CSESoc</h1>
18-
<p className="text-[#727B8C] font-medium">unsw-computer-science-soc</p>
19-
<button className="bg-[#444F6F] w-full my-5 py-2 rounded">Follow</button>
20-
<p>We are one of the biggest and most active societies at UNSW, catering to over 3500 CSE students spanning across degrees in Computer Science, Software Engineering, Bioinformatics and Computer Engineering.</p>
21-
<div className="my-4 flex gap-5">
22-
<Image src="/assets/people_icon.svg" alt="People" width={20} height={20} />
23-
<div>
24-
432 <span className="text-[#727B8C]">members</span> · 342 <span className="text-[#727B8C]">subcom</span>
25-
</div>
26-
</div>
27-
<div className="my-4 flex gap-5">
28-
<Image src="/assets/location_icon.svg" alt="Location" width={20} height={20} />
29-
Sydney, Australia
30-
</div>
31-
<div className="flex gap-5">
32-
<Image src="/assets/mail_icon.svg" alt="Mail" width={20} height={20} />
33-
34-
</div>
35-
</div>
36-
{/* RIGHT SIDE */}
37-
<div className="col-span-4 lg:mt-0 mt-10">
38-
<div className="rounded border border-[#595F6D] p-5 2xl:h-80 xl:h-64 lg:h-48 sm:h-36 h-32 h-full">
39-
<p className="text-xs">
40-
csesoc/README<span className="text-[#7A8192]">.md</span>
41-
</p>
42-
<p className="mt-5">Lorem Ipsum</p>
43-
</div>
44-
<div className="mt-10">
45-
Pinned
46-
<div className="sm:flex my-5">
47-
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg mr-5 w-full sm:mb-0 mb-5">
48-
<div className="flex text-[#3A76F8]">
49-
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
50-
csesoc.unsw.edu.au/<span className="font-semibold">events</span>
51-
</div>
52-
<div className="my-5">CSESoc&apos;s recent events</div>
53-
<div className="rounded-full bg-[#CC5421] w-3 h-3" />
54-
</div>
55-
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg w-full">
56-
<div className="flex text-[#3A76F8]">
57-
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
58-
csesoc.unsw.edu.au/<span className="font-semibold">socials</span>
59-
</div>
60-
<div className="my-5">Follow us on all socials</div>
61-
<div className="rounded-full bg-[#566ACE] w-3 h-3" />
62-
</div>
63-
</div>
64-
<div className="sm:flex">
65-
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg mr-5 w-full sm:mb-0 mb-5">
66-
<div className="flex text-[#3A76F8]">
67-
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
68-
csesoc.unsw.edu.au/<span className="font-semibold">join-us</span>
69-
</div>
70-
<div className="my-5">Get involved!</div>
71-
<div className="rounded-full bg-[#E7E923] w-3 h-3" />
72-
</div>
73-
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg w-full">
74-
<div className="flex text-[#3A76F8]">
75-
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
76-
csesoc.unsw.edu.au/<span className="font-semibold">contact</span>
77-
</div>
78-
<div className="my-5">Contact us via email</div>
79-
<div className="rounded-full bg-[#CC5421] w-3 h-3" />
80-
</div>
81-
</div>
82-
</div>
83-
</div>
84-
</div>
85-
</div>
86-
</section>
87-
);
88-
};
89-
90-
export default About;
1+
import Image from 'next/image';
2+
3+
const About = () => {
4+
return (
5+
<section className="py-8 xl:px-24 sm:px-10 px-5" id="about">
6+
<div className="text-center my-10">
7+
<p className="text-[#3977F8] font-game text-xl">01</p>
8+
<h1 className="font-bold text-6xl">ABOUT</h1>
9+
</div>
10+
<div className="flex justify-center items-center">
11+
<div className="lg:grid grid-cols-6 flex-1 max-w-[90rem]">
12+
{/* LEFT SIDE */}
13+
<div className="col-span-2 md:mx-5">
14+
<div className="flex items-center justify-center">
15+
<Image src="/assets/csesoc_icon.svg" alt="CSESoc Icon" width={150} height={150} />
16+
</div>
17+
<h1 className="mt-10 text-3xl font-extrabold">CSESoc</h1>
18+
<p className="text-[#727B8C] font-medium">unsw-computer-science-soc</p>
19+
<button className="bg-[#444F6F] w-full my-5 py-2 rounded">Follow</button>
20+
<p>
21+
We are one of the biggest and most active societies at UNSW, catering to over 3500 CSE
22+
students spanning across degrees in Computer Science, Software Engineering,
23+
Bioinformatics and Computer Engineering.
24+
</p>
25+
<div className="my-4 flex gap-5">
26+
<Image src="/assets/people_icon.svg" alt="People" width={20} height={20} />
27+
<div>
28+
432 <span className="text-[#727B8C]">members</span> · 342{' '}
29+
<span className="text-[#727B8C]">subcom</span>
30+
</div>
31+
</div>
32+
<div className="my-4 flex gap-5">
33+
<Image src="/assets/location_icon.svg" alt="Location" width={20} height={20} />
34+
Sydney, Australia
35+
</div>
36+
<div className="flex gap-5">
37+
<Image src="/assets/mail_icon.svg" alt="Mail" width={20} height={20} />
38+
39+
</div>
40+
</div>
41+
{/* RIGHT SIDE */}
42+
<div className="col-span-4 lg:mt-0 mt-10">
43+
<div className="rounded border border-[#595F6D] p-5 2xl:h-80 xl:h-64 lg:h-48 sm:h-36 h-32 h-full">
44+
<p className="text-xs">
45+
csesoc/README<span className="text-[#7A8192]">.md</span>
46+
</p>
47+
<p className="mt-5">Lorem Ipsum</p>
48+
</div>
49+
<div className="mt-10">
50+
Pinned
51+
<div className="sm:flex my-5">
52+
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg mr-5 w-full sm:mb-0 mb-5">
53+
<div className="flex text-[#3A76F8]">
54+
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
55+
csesoc.unsw.edu.au/<span className="font-semibold">events</span>
56+
</div>
57+
<div className="my-5">CSESoc&apos;s recent events</div>
58+
<div className="rounded-full bg-[#CC5421] w-3 h-3" />
59+
</div>
60+
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg w-full">
61+
<div className="flex text-[#3A76F8]">
62+
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
63+
csesoc.unsw.edu.au/<span className="font-semibold">socials</span>
64+
</div>
65+
<div className="my-5">Follow us on all socials</div>
66+
<div className="rounded-full bg-[#566ACE] w-3 h-3" />
67+
</div>
68+
</div>
69+
<div className="sm:flex">
70+
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg mr-5 w-full sm:mb-0 mb-5">
71+
<div className="flex text-[#3A76F8]">
72+
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
73+
csesoc.unsw.edu.au/<span className="font-semibold">join-us</span>
74+
</div>
75+
<div className="my-5">Get involved!</div>
76+
<div className="rounded-full bg-[#E7E923] w-3 h-3" />
77+
</div>
78+
<div className="p-5 border border-[#595F6D] flex-1 rounded-lg w-full">
79+
<div className="flex text-[#3A76F8]">
80+
<Image src="/assets/book_icon.svg" alt="Book" width={20} height={20} />
81+
csesoc.unsw.edu.au/<span className="font-semibold">contact</span>
82+
</div>
83+
<div className="my-5">Contact us via email</div>
84+
<div className="rounded-full bg-[#CC5421] w-3 h-3" />
85+
</div>
86+
</div>
87+
</div>
88+
</div>
89+
</div>
90+
</div>
91+
</section>
92+
);
93+
};
94+
95+
export default About;

components/Background.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
import Spline from "@splinetool/react-spline";
2-
3-
const Background = () => {
4-
return <Spline className="absolute " scene="https://prod.spline.design/thPGkOvNXu8XjGlk/scene.splinecode" />;
5-
};
6-
7-
export default Background;
1+
import Spline from '@splinetool/react-spline';
2+
3+
const Background = () => {
4+
return (
5+
<Spline
6+
className="absolute "
7+
scene="https://prod.spline.design/thPGkOvNXu8XjGlk/scene.splinecode"
8+
/>
9+
);
10+
};
11+
12+
export default Background;

components/Event/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const Event = () => {
2-
return <section></section>;
3-
};
4-
5-
export default Event;
1+
const Event = () => {
2+
return <section></section>;
3+
};
4+
5+
export default Event;

components/Landing/index.tsx

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,49 @@
1-
import Background from "../Background";
2-
import Navbar from "../Navbar";
3-
4-
const Landing = () => {
5-
return (
6-
<section className="flex flex-col min-h-screen justify-between py-8 xl:px-24 md:px-10 px-5 relative overflow-hidden" id="landing">
7-
<Navbar />
8-
<Background />
9-
<div className="flex justify-between items-end">
10-
<div>
11-
<div className="font-semibold">
12-
<p>{"<h1>"}</p>
13-
<h1 className="font-black 2xl:text-8xl lg:text-6xl text-4xl">Hello World!</h1>
14-
<p>{"</h1>"}</p>
15-
</div>
16-
<div className="font-semibold mt-10">
17-
<p>{"<h2>"}</p>
18-
<h2 className="font-bold 2xl:text-3xl text-xl">
19-
We are the principal representative body for <span className="text-[#3977F9]">UNSW computing</span> students.
20-
</h2>
21-
<p>{"</h2>"}</p>
22-
</div>
23-
</div>
24-
<div className="w-72 font-semibold text-xl lg:block hidden">
25-
<p className="font-bold bg-[#3977F8] inline px-3 py-1">STATS</p>
26-
<hr className="mb-3 mt-5" />
27-
<div className="flex justify-between">
28-
<p>323,000</p>
29-
<p>Members</p>
30-
</div>
31-
<div className="flex justify-between">
32-
<p>300</p>
33-
<p>Team Members</p>
34-
</div>
35-
<div className="flex justify-between">
36-
<p>52</p>
37-
<p>Events held</p>
38-
</div>
39-
</div>
40-
</div>
41-
</section>
42-
);
43-
};
44-
45-
export default Landing;
1+
import Background from '../Background';
2+
import Navbar from '../Navbar';
3+
4+
const Landing = () => {
5+
return (
6+
<section
7+
className="flex flex-col min-h-screen justify-between py-8 xl:px-24 md:px-10 px-5 relative overflow-hidden"
8+
id="landing"
9+
>
10+
<Navbar />
11+
<Background />
12+
<div className="flex justify-between items-end">
13+
<div>
14+
<div className="font-semibold">
15+
<p>{'<h1>'}</p>
16+
<h1 className="font-black 2xl:text-8xl lg:text-6xl text-4xl">Hello World!</h1>
17+
<p>{'</h1>'}</p>
18+
</div>
19+
<div className="font-semibold mt-10">
20+
<p>{'<h2>'}</p>
21+
<h2 className="font-bold 2xl:text-3xl text-xl">
22+
We are the principal representative body for{' '}
23+
<span className="text-[#3977F9]">UNSW computing</span> students.
24+
</h2>
25+
<p>{'</h2>'}</p>
26+
</div>
27+
</div>
28+
<div className="w-72 font-semibold text-xl lg:block hidden">
29+
<p className="font-bold bg-[#3977F8] inline px-3 py-1">STATS</p>
30+
<hr className="mb-3 mt-5" />
31+
<div className="flex justify-between">
32+
<p>323,000</p>
33+
<p>Members</p>
34+
</div>
35+
<div className="flex justify-between">
36+
<p>300</p>
37+
<p>Team Members</p>
38+
</div>
39+
<div className="flex justify-between">
40+
<p>52</p>
41+
<p>Events held</p>
42+
</div>
43+
</div>
44+
</div>
45+
</section>
46+
);
47+
};
48+
49+
export default Landing;

0 commit comments

Comments
 (0)