Skip to content

Commit f034936

Browse files
committed
Fixed Tab redirection issue in interview prep
1 parent 2238973 commit f034936

2 files changed

Lines changed: 55 additions & 50 deletions

File tree

src/pages/interview-prep/PracticeTab.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ interface PracticeStats {
3737
}
3838

3939
interface PracticeTabProps {
40-
mockInterviewQuestions?: MockQuestion[]
41-
onTabChange?: (tab: string) => void
40+
mockInterviewQuestions?: MockQuestion[];
41+
onTabChange?: (tab: "overview" | "technical" | "behavioral" | "companies" | "practice") => void;
4242
}
4343

44+
4445
const fadeIn = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { duration: 0.6 } } }
4546
const staggerContainer = { hidden: {}, visible: { transition: { staggerChildren: 0.1 } } }
4647
const scaleIn = { hidden: { scale: 0.8, opacity: 0 }, visible: { scale: 1, opacity: 1, transition: { duration: 0.5 } } }
@@ -188,11 +189,12 @@ const PracticeTab: React.FC<PracticeTabProps> = ({ mockInterviewQuestions = [],
188189
})
189190
}
190191

191-
const handleTabNavigation = (tab: string) => {
192-
if (onTabChange) {
193-
onTabChange(tab)
194-
}
192+
const handleTabNavigation = (tab: "overview" | "technical" | "behavioral" | "companies" | "practice") => {
193+
if (onTabChange) {
194+
onTabChange(tab)
195195
}
196+
}
197+
196198

197199
const progressPercentage = allQuestions.length > 0 ? (practiceStats.totalCompleted / allQuestions.length) * 100 : 0
198200

src/pages/interview-prep/index.tsx

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,54 +1138,57 @@ function InterviewPrepContent({
11381138
</div>
11391139
</div>
11401140

1141-
{/* Tab Content */}
1142-
<div className="interview-prep-page max-w-6xl mx-auto px-4 py-12">
1143-
{/* Overview Tab */}
1144-
{activeTab === "overview" && (
1145-
<OverviewTab
1146-
toggleTips={toggleTips}
1147-
toggleQuestions={toggleQuestions}
1148-
showTips={showTips}
1149-
showQuestions={showQuestions}
1150-
setActiveTab={setActiveTab}
1151-
/>
1152-
)}
1141+
{/* Tab Content */}
1142+
<div className="interview-prep-page max-w-6xl mx-auto px-4 py-12">
1143+
{/* Overview Tab */}
1144+
{activeTab === "overview" && (
1145+
<OverviewTab
1146+
toggleTips={toggleTips}
1147+
toggleQuestions={toggleQuestions}
1148+
showTips={showTips}
1149+
showQuestions={showQuestions}
1150+
setActiveTab={setActiveTab}
1151+
/>
1152+
)}
11531153

1154-
{/* Technical Tab */}
1155-
{activeTab === "technical" && (
1156-
<TechnicalTab
1157-
technicalResources={technicalResources}
1158-
practicePlatforms={practicePlatforms}
1159-
expandedCategories={expandedCategories}
1160-
toggleCategory={toggleCategory}
1161-
/>
1162-
)}
1154+
{/* Technical Tab */}
1155+
{activeTab === "technical" && (
1156+
<TechnicalTab
1157+
technicalResources={technicalResources}
1158+
practicePlatforms={practicePlatforms}
1159+
expandedCategories={expandedCategories}
1160+
toggleCategory={toggleCategory}
1161+
/>
1162+
)}
11631163

1164-
{/* Behavioral Tab */}
1165-
{activeTab === "behavioral" && (
1166-
<BehavioralTab
1167-
behavioralQuestions={behavioralQuestions}
1168-
expandedCategories={expandedCategories}
1169-
toggleCategory={toggleCategory}
1170-
/>
1171-
)}
1164+
{/* Behavioral Tab */}
1165+
{activeTab === "behavioral" && (
1166+
<BehavioralTab
1167+
behavioralQuestions={behavioralQuestions}
1168+
expandedCategories={expandedCategories}
1169+
toggleCategory={toggleCategory}
1170+
/>
1171+
)}
11721172

1173-
{/* Companies Tab */}
1174-
{activeTab === "companies" && (
1175-
<CompaniesTab
1176-
companyTips={companyTips}
1177-
toggleTips={toggleTips}
1178-
toggleQuestions={toggleQuestions}
1179-
showTips={showTips}
1180-
showQuestions={showQuestions}
1181-
/>
1182-
)}
1173+
{/* Companies Tab */}
1174+
{activeTab === "companies" && (
1175+
<CompaniesTab
1176+
companyTips={companyTips}
1177+
toggleTips={toggleTips}
1178+
toggleQuestions={toggleQuestions}
1179+
showTips={showTips}
1180+
showQuestions={showQuestions}
1181+
/>
1182+
)}
11831183

1184-
{/* Practice Tab */}
1185-
{activeTab === "practice" && (
1186-
<PracticeTab mockInterviewQuestions={mockInterviewQuestions} />
1187-
)}
1188-
</div>
1184+
{/* Practice Tab */}
1185+
{activeTab === "practice" && (
1186+
<PracticeTab
1187+
mockInterviewQuestions={mockInterviewQuestions}
1188+
onTabChange={setActiveTab} // ✅ pass the function here
1189+
/>
1190+
)}
1191+
</div>
11891192

11901193
{/* Call to Action */}
11911194
<motion.section

0 commit comments

Comments
 (0)