diff --git a/apps/portal/src/components/global/AppShell.tsx b/apps/portal/src/components/global/AppShell.tsx index bcb9af67..a458a433 100644 --- a/apps/portal/src/components/global/AppShell.tsx +++ b/apps/portal/src/components/global/AppShell.tsx @@ -85,8 +85,8 @@ function ProfileJewel() { {({ active }) => ( @@ -178,9 +178,9 @@ export default function AppShell({ children }: Props) { {/* Content area */}
-
+

Discussions

@@ -131,7 +154,7 @@ export default function ProfileComments({
+ )} +
+ ); +} + +type ProfileDetailsProps = Readonly<{ analysis?: ProfileAnalysis; background?: BackgroundDisplayData; + isEditable: boolean; isLoading: boolean; offers: Array; - selectedTab: string; + profileId: string; + selectedTab: ProfileDetailTab; }>; export default function ProfileDetails({ + analysis, background, isLoading, offers, selectedTab, -}: ProfileHeaderProps) { + profileId, + isEditable, +}: ProfileDetailsProps) { if (isLoading) { return (
@@ -31,46 +157,20 @@ export default function ProfileDetails({
); } - if (selectedTab === 'offers') { - if (offers.length !== 0) { - return ( - <> - {offers.map((offer) => ( - - ))} - - ); - } - return ( -
- - No offer is attached. -
- ); + if (selectedTab === ProfileDetailTab.OFFERS) { + return ; + } + if (selectedTab === ProfileDetailTab.BACKGROUND) { + return ; } - if (selectedTab === 'background') { + if (selectedTab === ProfileDetailTab.ANALYSIS) { return ( - <> - {background?.experiences && background?.experiences.length > 0 && ( - <> -
- - Work Experience -
- - - )} - {background?.educations && background?.educations.length > 0 && ( - <> -
- - Education -
- - - )} - + ); } - return
Detail page for {selectedTab}
; + return null; } diff --git a/apps/portal/src/components/offers/profile/ProfileHeader.tsx b/apps/portal/src/components/offers/profile/ProfileHeader.tsx index 4ef3c581..4a0d944b 100644 --- a/apps/portal/src/components/offers/profile/ProfileHeader.tsx +++ b/apps/portal/src/components/offers/profile/ProfileHeader.tsx @@ -13,13 +13,16 @@ import type { BackgroundDisplayData } from '~/components/offers/types'; import { getProfileEditPath } from '~/utils/offers/link'; +import type { ProfileDetailTab } from '../constants'; +import { profileDetailTabs } from '../constants'; + type ProfileHeaderProps = Readonly<{ background?: BackgroundDisplayData; handleDelete: () => void; isEditable: boolean; isLoading: boolean; - selectedTab: string; - setSelectedTab: (tab: string) => void; + selectedTab: ProfileDetailTab; + setSelectedTab: (tab: ProfileDetailTab) => void; }>; export default function ProfileHeader({ @@ -139,9 +142,9 @@ export default function ProfileHeader({ Current: - {`${experiences[0]?.companyName || ''} ${ - experiences[0]?.jobLevel || '' - } ${experiences[0]?.jobTitle || ''}`} + {`${experiences[0].companyName || ''} ${ + experiences[0].jobLevel || '' + } ${experiences[0].jobTitle || ''}`}
)} @@ -165,20 +168,7 @@ export default function ProfileHeader({
setSelectedTab(value)} /> diff --git a/apps/portal/src/components/offers/profile/ProfilePhotoHolder.tsx b/apps/portal/src/components/offers/profile/ProfilePhotoHolder.tsx index 8fdb126b..f12f8de6 100644 --- a/apps/portal/src/components/offers/profile/ProfilePhotoHolder.tsx +++ b/apps/portal/src/components/offers/profile/ProfilePhotoHolder.tsx @@ -8,9 +8,9 @@ export default function ProfilePhotoHolder({ const sizeMap = { lg: '16', sm: '12' }; return ( + className={`inline-block h-${sizeMap[size]} w-${sizeMap[size]} overflow-hidden rounded-full bg-slate-100`}> diff --git a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx index beeea146..c5face80 100644 --- a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx +++ b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx @@ -43,6 +43,10 @@ export default function CommentCard({ }); function handleReply() { + if (!currentReply.length) { + return; + } + if (token && token.length > 0) { // If it is with edit permission, send comment to API with username = null createCommentMutation.mutate( @@ -96,12 +100,12 @@ export default function CommentCard({
{message}
-
{`${timeSinceNow( +
{`${timeSinceNow( createdAt, )} ago`}
{replyLength > 0 && (
{isExpanded ? `Hide replies` : `View replies (${replyLength})`}
@@ -132,6 +136,7 @@ export default function CommentCard({
) : ( - +
{renderHeader()} {offers.map((offer) => ( diff --git a/apps/portal/src/components/offers/table/OffersTablePagination.tsx b/apps/portal/src/components/offers/table/OffersTablePagination.tsx index ad0bc0e6..1a24a045 100644 --- a/apps/portal/src/components/offers/table/OffersTablePagination.tsx +++ b/apps/portal/src/components/offers/table/OffersTablePagination.tsx @@ -19,13 +19,13 @@ export default function OffersTablePagination({