Commit Graph

399 Commits

Author SHA1 Message Date
Aaron William Po
b1a403e4f2 Slightly alter colours in themes, change cards to compact 2023-04-16 20:32:12 -04:00
Aaron Po
7ffeb08acf Merge pull request #24 from aaronpo97/navbar-update
Update navbar, implement useNavbar hook, style updates
2023-04-15 22:20:55 -04:00
Aaron William Po
07330beb9c Update navbar, implement useNavbar hook, style updates
- Created a custom hook that returns an object with pages depending on user auth. This is a refactor of the logic found in the navbar component.
- Updated styles for card components
- Fix font size issues for mobile.
- Update theming to include a new pastel theme.
2023-04-13 23:04:25 -04:00
Aaron Po
8867c0bc56 Update README.md 2023-04-12 21:54:06 -04:00
Aaron Po
f25d5b5964 Merge pull request #23 from aaronpo97/documentation-updates
Update readme, add docs to useMediaQuery, fix security issue with vm2
2023-04-12 21:49:03 -04:00
Aaron William Po
7185734f3c Update readme, add docs to useMediaQuery, fix security issue with vm2 2023-04-12 21:41:19 -04:00
Aaron Po
8ec9f46fad Merge pull request #21 from aaronpo97/dev
Improving code structure and implement features to enhance user experience.
2023-04-12 00:15:32 -04:00
Aaron William Po
08422fe24e Restructure codebase to use src directory 2023-04-11 23:32:06 -04:00
Aaron William Po
90f2cc2c0c Begin work on tab components for beer by id page 2023-04-11 22:18:29 -04:00
Aaron William Po
f5abc518a4 Update register user form disable itself when loading
Fix error where a user could click submit multiple times while the form is submitting.
2023-04-11 20:24:40 -04:00
Aaron William Po
ea3e8a0023 Refactor beer comment section and incorporate image carousel
Beer comment section now uses a ternary expression for isLoading. Image carousel implemented in beer by id page.
2023-04-11 20:23:55 -04:00
Aaron William Po
6c8a510d80 Update seed
Create new users updated to create a longer random value to prevent duplication when seeding db. Beer images now use a generated caption and alt text.
2023-04-11 20:22:21 -04:00
Aaron Po
4594e22a4f Merge pull request #20 from aaronpo97/infinite-comment-scroll
Feature: infinite comment scroll
2023-04-09 18:51:08 -04:00
Aaron William Po
851c95d621 fix linting error 2023-04-09 18:49:20 -04:00
Aaron William Po
915adb722a Implement react-intersection-observer to facilitate infinite scroll
Uses react-intersection-observer to load more comments when the last of the previously loaded comments is in the viewport.
2023-04-09 18:41:58 -04:00
Aaron William Po
8981bcb4b8 Replace useSWR with useSWRInfinite to facilitate infinite scrolling 2023-04-09 11:25:10 -04:00
Aaron Po
06f496ecd2 Merge pull request #18 from aaronpo97/style-updates-and-login-fix
Style updates and login fix
2023-04-08 02:48:44 -04:00
Aaron William Po
cbc5671b0e Fix login glitch where user session wouldn't load properly into context 2023-04-08 02:46:42 -04:00
Aaron William Po
80bed9b4dc Style updates
fix navbar to remain sticky, add fade in to layout component, update font to Space Grotesk
2023-04-08 02:11:13 -04:00
Aaron Po
d2821eeec0 Merge pull request #17 from aaronpo97/env
Add environment variable validation and parsing
2023-04-07 12:12:28 -04:00
Aaron William Po
5779ff6530 Update documentation 2023-04-07 12:03:39 -04:00
Aaron William Po
0d3785ad1a Add environment variable validation and parsing
Adds a validation schema for the application's environment variables using the Zod library. The parsed environment variables are then exported as constants that can be imported throughout the application, replacing the direct use of process.env.
2023-04-07 11:37:30 -04:00
Aaron Po
2d5998c634 Merge pull request #16 from aaronpo97/read-me
create readme
2023-04-05 23:33:41 -04:00
Aaron William Po
6b65e09c17 create readme 2023-04-05 23:33:19 -04:00
Aaron Po
fa3d9b9195 Merge pull request #15 from aaronpo97/login-form-update
Updated login form to disable the form when submitting
2023-04-05 22:47:41 -04:00
Aaron William Po
38950390cd Updated login form to disable the form when submitting 2023-04-05 22:46:13 -04:00
Aaron Po
58c981a019 Merge pull request #14 from aaronpo97/refactoring
Refactoring
2023-04-05 22:38:02 -04:00
Aaron William Po
c8a8c70127 Update login to redirect to current user page 2023-04-05 22:24:02 -04:00
Aaron William Po
7db7b8264f Switch database to cockroach db and remove height on comment card 2023-04-05 21:38:36 -04:00
Aaron William Po
8414a7645d Fix glitch where like count would just show up as '0' 2023-04-04 22:13:27 -04:00
Aaron William Po
fe683282b2 Package updates
update types in /api/users/login to avoid tsc error
2023-04-04 22:07:04 -04:00
Aaron William Po
796a5fce3f Styling changes and refactor
Switch google fonts to use Next.js font optimization, animate comment fade in, and refactor beer like handler and comment submit handler.
2023-04-04 20:51:29 -04:00
Aaron William Po
a4362a531c Add custom hooks for time distance and retrieving like count
Documentation added to all custom hooks
2023-04-03 23:32:32 -04:00
Aaron William Po
801a3c8ad3 Refactor comment cards out of comment section 2023-04-02 22:10:04 -04:00
Aaron William Po
f8ecaa51b5 Update beer like button to use custom hook to load like status 2023-04-02 21:51:10 -04:00
Aaron William Po
de3964dbfa Rewrote beer by id page comments to load on client 2023-04-02 21:50:42 -04:00
Aaron William Po
b69dbc95b4 Work on brewery page, refactors
Refactor query types to explicitly use z.infer
2023-03-31 21:13:35 -04:00
Aaron Po
244acf73de Merge pull request #13 from aaronpo97/search-feat-and-refactor
Add beer search feature and refactor components
2023-03-27 19:15:14 -04:00
Aaron William Po
d8a8dad37f Refactor beer by id page
Extracted services to separate files.
2023-03-27 19:02:45 -04:00
Aaron William Po
2efc506250 Add beer search feature
This commit adds the necessary components and hooks to implement a beer search feature on the website. It includes the following changes:

- Add a new BeerSearch API route that returns a list of beers matching a search query.
-  Implement a new hook useBeerPostSearch that utilizes SWR to fetch data from the API and parse it using a schema.
- Add a new page SearchPage that displays a search input field and a list of beer search results.
- Use lodash's debounce function to avoid making too many requests while the user is typing in the search input field.
2023-03-27 19:02:03 -04:00
Aaron William Po
7194f140aa refactor: update Spinner component to accept size prop
This commit updates the `Spinner` component to accept a `size` prop that determines the width of the spinner
2023-03-27 19:00:32 -04:00
Aaron William Po
cf6a8309f1 Rework pagination and cookies 2023-03-19 18:04:13 -04:00
Aaron Po
cbd650abb4 Merge pull request #12 from aaronpo97/dev
Refactor BeerPostHeader, refactor login and register
2023-03-16 23:28:07 -04:00
Aaron Po
c01f6ad63d Merge pull request #11 from aaronpo97/confirm-user
Implement confirm user functionality
2023-03-15 22:02:20 -04:00
Aaron William Po
6b12cb72c5 Refactor BeerPostHeader, refactor login and register
- Updated BeerPostHeader in /id page to use semantic HTML tags
- Removed the getServerSidesProps fn in /login and /register. Moved the redirect logic over to the client, will redirect on the client side.
- Added delete BeerPost option on the edit page.
2023-03-15 21:30:26 -04:00
Aaron William Po
584e3b349f Implement confirm user functionality
This commit adds the necessary functionality to confirm a user's account.

It includes the addition of a new column in the user table to track whether an account is confirmed or not, and the implementation of JWT for confirmation tokens.

This commit integrates the SparkPost API as well as React Email to send dynamic emails for whatever purpose.

Upon user registration, a confirmation email will be sent to the user.
2023-03-13 22:35:57 -04:00
Aaron Po
f576f515a1 Merge pull request #10 from aaronpo97/beer-page-refactoring
Added beer comments section component, delete comment by id
2023-03-03 21:31:25 -05:00
Aaron William Po
472ead9abd Refactoring beer by id page, add delete comment
Refactored the comments ui into various new components, added the delete beer comment by id feature.
2023-03-03 21:28:44 -05:00
Aaron Po
4a6e10572c Merge pull request #9 from aaronpo97/dev
Add edit beer post, 500 page, and redirectIfLoggedIn getServerSideProps.
2023-02-27 18:22:46 -05:00
Aaron William Po
7126c74d5d Add edit beer post, 500 page, and redirectIfLoggedIn getServerSideProps.
Implement edit beer post functionality.

Register, edit and create beer post forms are now using the same layout found in components/ui/forms/BeerPostFormPageLayout. All forms are now extracted into their own components and are now found in components.

Added redirectIfLoggedIn getServerSidesProp fn for login and register pages.
2023-02-27 18:19:58 -05:00