Skip to content

Commit

Permalink
feat(/recent): add recent reviews view (#130)
Browse files Browse the repository at this point in the history
* fix(db): correct logic in `getReviewsRecent50()`

* fix: change color scheme to more intuitive scale

* feat(recents): init new components

* feat(NavBar): add new view to nav bar

* refactor: extract entity `CourseDataStatic`

* refactor(ReviewCard): add course info to card

* feat: add return button in `/recents`

* fix(review): lots of styling updates

* fix(styling): fix loading icon and long course titles

* chore: run linter

Co-authored-by: awpala <apala7@gatech.edu>
Co-authored-by: Christian Tran <ctran4347@gmail.com>
  • Loading branch information
3 people authored Aug 9, 2022
1 parent 4cda0f9 commit a0fac30
Show file tree
Hide file tree
Showing 10 changed files with 979 additions and 137 deletions.
7 changes: 4 additions & 3 deletions firebase/dbOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TPayloadReviews,
TPayloadSemesters,
TPayloadSpecializations,
} from '../globals/types'
} from '@globals/types'
import { parseReviewId } from './utilityFunctions'
import {
addOrUpdateReview,
Expand Down Expand Up @@ -290,8 +290,9 @@ export const getReviews = async (
export const getReviewsRecent50 = async () => {
try {
const snapshot = await getDoc(doc(db, baseDocumentReviewsRecent50))
const recentReviews50 = snapshot.data()
return recentReviews50 ?? null
const data = snapshot.data()
const recentReviews50: Review[] = data ? data?.data : []
return recentReviews50
} catch (e: any) {
console.log(e)
throw new Error(e)
Expand Down
Loading

1 comment on commit a0fac30

@vercel
Copy link

@vercel vercel bot commented on a0fac30 Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

website – ./

website-git-main-omshub.vercel.app
website-omshub.vercel.app
www.omshub.org
omshub.org

Please # to comment.