Skip to content

Commit a0fac30

Browse files
awpalaawpalatran-christian
authored
feat(/recent): add recent reviews view (#130)
* 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 <[email protected]> Co-authored-by: Christian Tran <[email protected]>
1 parent 4cda0f9 commit a0fac30

File tree

10 files changed

+979
-137
lines changed

10 files changed

+979
-137
lines changed

firebase/dbOperations.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
TPayloadReviews,
2020
TPayloadSemesters,
2121
TPayloadSpecializations,
22-
} from '../globals/types'
22+
} from '@globals/types'
2323
import { parseReviewId } from './utilityFunctions'
2424
import {
2525
addOrUpdateReview,
@@ -290,8 +290,9 @@ export const getReviews = async (
290290
export const getReviewsRecent50 = async () => {
291291
try {
292292
const snapshot = await getDoc(doc(db, baseDocumentReviewsRecent50))
293-
const recentReviews50 = snapshot.data()
294-
return recentReviews50 ?? null
293+
const data = snapshot.data()
294+
const recentReviews50: Review[] = data ? data?.data : []
295+
return recentReviews50
295296
} catch (e: any) {
296297
console.log(e)
297298
throw new Error(e)

0 commit comments

Comments
 (0)