Commit Graph

19 Commits

Author SHA1 Message Date
Shahan Nedadahandeh bb78a3d53d Warning Header (Closes #205) (#394)
continuous-integration/drone/push Build is passing Details
Update:
In order to solve the issues discussed below, we decided to put the warnings in a json file, since they can be easily imported into a javascript file and webpack automatically bundles them with the client side app, so no static props is needed.

__________

To get the warning data, since it is something that needs to be on all pages, it makes sense for the component to go in the app.js file (similar to the nav bar). However, next.js has a cumbersome issue that it does not support getStaticProps in the app.ts file (and getStaticProps only works in page files), thus we have no way of requesting the warning data easily in the \<WarningHeader\> Component. (https://github.com/vercel/next.js/discussions/10949)

Here is my solution:
- Request the warning data on the client side through the use of an api.
    - I made a warning api (/api/currentWarning) which sends a json of the current warning
    - Advantage: warnings will always be up to date since it is recalculated on every request
    - Advantage: It can potentially incorporate with other CSC services who might need to know about the warning (eg linktree?)
    - Disadvantage: can get expensive if we have a lot of warnings, to fix this I can cache the current warning and only re-read the files every 24h if this is a problem, but if we don’t have that many warnings I think it should be fine
    - Disadvantage: listed below:

The current problem with what I implemented is that it doesn’t build in the production environment:
- The way we build the website, when we call “next export” that disables any api endpoints.
- According to this https://github.com/vercel/vercel/discussions/6551, if we want to allow api endpoints, we have to just do “next build”. This has implications that the site won’t be completely static anymore, but the other solutions also have similar problems  ( though the GitHub post says that next will still optimize for static with only next build).

Another advantage of allowing api’s is that maybe in the future we will implement other features where an api might be useful.

If you want to try it out, my branch works fine locally (when just running npm run dev or npm run build”)

Other possible solutions:
- Use getInitialProps inside _app.js, but this has the downside that it will “disable Automatic Static Optimization in pages without Static Generation.” (https://nextjs.org/docs/advanced-features/custom-app), which I believe will slow the whole site down, but, we will be able to still use the old build command I think, I am not sure of the full effect of this.
	- However, implementing this would also be relatively simple.

- Add the warning request to the getStaticProps of every single page, possibly through some wrapper component around every single page, this has the disadvantage that we need to do a lot of refactoring of all the pages of the site and cant use the intended “_app.ts” wrapper.

- Add warning header only to the homepage (or maybe one or two other important pages).

Co-authored-by: shahanneda <shahan.neda@gmail.com>
Reviewed-on: #394
Reviewed-by: Amy <a258wang@csclub.uwaterloo.ca>
2022-02-22 23:29:53 -05:00
Aditya Thakral e73df82bde Update content for advice pages (#299)
continuous-integration/drone/push Build is failing Details
Unblocks #173

https://csclub.uwaterloo.ca/~a3thakra/csc/adi-new-advice/resources/advice/co-op/

Reviewed-on: #299
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
2021-09-11 16:00:22 -04:00
Aditya Thakral 5c6e0c75ca Add ssh key fingerprints (#225)
continuous-integration/drone/push Build is passing Details
Closes #168

https://csclub.uwaterloo.ca/~a3thakra/csc/adi-initial-ssh-key-fingerprints

Reviewed-on: #225
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
2021-09-03 18:15:22 -04:00
Aditya Thakral 6b88cf308b Add mobile styles to the event card (#190)
continuous-integration/drone/push Build is passing Details
closes #160
closes #154

https://csclub.uwaterloo.ca/~a3thakra/csc/adi-mobile-events-card/

Reviewed-on: #190
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
2021-08-28 15:56:23 -04:00
Amy Wang 0b05915342 Shapes Background (#164)
continuous-integration/drone/push Build is passing Details
We have decided to use randomly-generated shapes for most of the pages, instead of hard-coding the shapes backgrounds.

Closes #25

Co-authored-by: Amy <a258wang@uwaterloo.ca>
Reviewed-on: #164
Reviewed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-authored-by: Amy <a258wang@csclub.uwaterloo.ca>
Co-committed-by: Amy <a258wang@csclub.uwaterloo.ca>
2021-08-27 01:45:14 -04:00
Aditya Thakral dc114f742e Add /resources/services page (#169)
continuous-integration/drone/push Build is passing Details
Closes #17

https://csclub.uwaterloo.ca/~a3thakra/csc/adi-resources-services-page

Reviewed-on: #169
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
2021-08-25 15:12:09 -04:00
l42luo 09c704c94c Advice + Internships Page (#161)
continuous-integration/drone/push Build is passing Details
Closes #140
Closes #141

Co-authored-by: Linna Luo <linnaluo18@gmail.com>
Reviewed-on: #161
Reviewed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-authored-by: l42luo <l42luo@localhost>
Co-committed-by: l42luo <l42luo@localhost>
2021-08-23 14:31:04 -04:00
Aditya Thakral 470a70d6b4 Use eslint-plugin-import to bring some order to the mess (#132)
continuous-integration/drone/push Build is passing Details
Fixes #130

Reviewed-on: #132
Reviewed-by: dora <d43su@csclub.uwaterloo.ca>
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
2021-08-13 04:16:37 -04:00
Aditya Thakral af8c750c0c Change CSS variable names + create a themer (#109)
continuous-integration/drone/push Build is passing Details
Try it out at https://csclub.uwaterloo.ca/~a3thakra/website-demo/themer/

- Themes persist across website reloads
- Individual color reset buttons
- Reset all colors button

Reviewed-on: #109
Reviewed-by: n3parikh <n3parikh@localhost>
Reviewed-by: b38peng <b38peng@uwaterloo.ca>
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
2021-08-03 19:37:02 -04:00
Aditya Thakral f670247ec5 About Us page (#70)
continuous-integration/drone/push Build is passing Details
Fixes #7

Co-authored-by: Linna Luo <linnaluo18@gmail.com>
Reviewed-on: #70
Reviewed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-authored-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
Co-committed-by: Aditya Thakral <a3thakra@csclub.uwaterloo.ca>
2021-07-18 03:37:48 -04:00
Adi Thakral 93ede558a4 Fix font-size, line-height, and some other smaller changes 2021-06-27 03:33:09 +00:00
Linhui Luo 7a08e0c331 Footer 2021-06-13 23:55:25 +00:00
Catherine Wan 078276efa7 Link Component 2021-06-13 19:36:34 +00:00
Aditya Thakral 26b279e71d Use custom link for MDX 2021-06-07 20:55:37 -04:00
Amy Wang 4393037e94 Navbar 2021-05-18 03:16:32 -04:00
Amy abf75af472 Add Poppins font family 2021-05-09 00:35:57 -04:00
Aditya Thakral eddce7c909 Add ThemeContext
This implementation uses CSS variables, and not CSS in JS. This is done
so that we can support users who disable JS on their browsers.

Fixes #20
2021-04-28 04:22:30 -04:00
Aditya Thakral 91ee5e5d95 Add mdx support and playground 2021-04-26 19:16:55 -04:00
Aditya Thakral 6a25e28cef Initial commit 🎉 2021-04-25 19:13:07 -04:00