Skip to content

Commit ad0edeb

Browse files
committed
fix: added comments
1 parent 946f8b4 commit ad0edeb

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

frontend/src/components/CardDetailsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const DetailsCard = ({
7474
const { data } = useSession()
7575
const router = useRouter()
7676

77+
// compute styles based on type prop
7778
const secondaryCardStyles = (() => {
7879
if (type === 'program' || type === 'module') {
7980
return 'gap-2 md:col-span-7'

frontend/src/components/ProgramCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const ProgramCard: React.FC<ProgramCardProps> = ({ program, onEdit, onView, acce
3131
? `${program.description.slice(0, 100)}...`
3232
: program.description || 'No description available.'
3333

34+
// computes a formatted date string for the program based on its start and end dates.
3435
const dateInfo = (() => {
3536
if (program.startedAt && program.endedAt) {
3637
return `${formatDate(program.startedAt)}${formatDate(program.endedAt)}`

frontend/src/hooks/useSearchPage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ export function useSearchPage<T>({
8484
try {
8585
let computedIndexName = indexName
8686

87+
// check if valid sort option is selected
8788
const hasValidSort = sortBy && sortBy !== 'default' && sortBy[0] !== 'default'
8889

8990
if (hasValidSort) {
91+
// if sorting is active then appends the sort field and order to the base index name.
9092
const orderSuffix = order && order !== '' ? `_${order}` : ''
9193
computedIndexName = `${indexName}_${sortBy}${orderSuffix}`
9294
}

frontend/src/utils/milestoneProgress.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { faCircleCheck, faClock, faUserGear } from '@fortawesome/free-solid-svg-icons'
22

3+
// helper functions used in about/page.tsx
34
export const getMilestoneProgressText = (progress: number): string => {
45
if (progress === 100) {
56
return 'Completed'

0 commit comments

Comments
 (0)