Skip to content

Commit 06673e1

Browse files
committed
fix: questions not submitting & repo path changes
1 parent 92f0d94 commit 06673e1

File tree

20 files changed

+60
-53
lines changed

20 files changed

+60
-53
lines changed

next.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ const nextConfig = {
6262
destination: '/features/coding-challenges',
6363
permanent: true,
6464
},
65+
{
66+
source: '/questions',
67+
destination: '/coding-challenges',
68+
permanent: true,
69+
},
6570
];
6671
},
6772
async headers() {

src/actions/answers/answer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ const updateStudyPathProgress = async ({
468468

469469
if (hasOverviewData) {
470470
// get all the question slugs from the overview data (if it exists)
471-
questionSlugs = Object.values(studyPath.overviewData as any).flatMap(
472-
(section: any) => section.questionSlugs
471+
questionSlugs = Object.values(studyPath.overviewData || {}).flatMap(
472+
(section: any) => section.questionSlugs || []
473473
);
474474
} else {
475475
// otherwise, this is a legacy study path and we can just use the questionSlugs

src/app/(app)/(default_layout)/(questions)/coding-challenges/custom/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default async function CustomQuestionsPage({
3434
filters={filters}
3535
customQuestions
3636
showSubmissions={false}
37-
paginationUrl="/questions/custom"
37+
paginationUrl="/coding-challenges/custom"
3838
/>
3939
</div>
4040
<QuestionPageSidebar />

src/app/(app)/(default_layout)/(questions)/coding-challenges/page.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default async function QuestionsDashboard({
6767
const jsonLd: WebPageJsonLd = {
6868
'@context': 'https://schema.org',
6969
'@type': 'WebPage',
70-
url: `${getBaseUrl()}/questions`,
70+
url: `${getBaseUrl()}/coding-challenges`,
7171
headline: 'Coding Challenges | TechBlitz',
7272
description:
7373
'Explore a diverse set of coding challenges across various topics to enhance your knowledge.',
@@ -79,7 +79,7 @@ export default async function QuestionsDashboard({
7979
{
8080
'@type': 'ListItem',
8181
position: 1,
82-
name: 'Questions',
82+
name: 'Coding Challenges',
8383
item: getBaseUrl() + '/coding-challenges',
8484
},
8585
],
@@ -93,7 +93,7 @@ export default async function QuestionsDashboard({
9393
datePublished: new Date().toISOString(),
9494
mainEntityOfPage: {
9595
'@type': 'WebPage',
96-
'@id': `${getBaseUrl()}/questions`,
96+
'@id': `${getBaseUrl()}/coding-challenges`,
9797
},
9898
keywords:
9999
'learn to code for free, beginner-friendly coding lessons, interactive coding challenges, daily programming practice, personalized coding roadmap, improve coding skills, best platform to learn coding, AI-assisted coding, learn javascript',
@@ -138,7 +138,7 @@ export default async function QuestionsDashboard({
138138
currentPage={filters.page || 1}
139139
filters={filters}
140140
customQuestions={false}
141-
paginationUrl="/questions"
141+
paginationUrl="/coding-challenges"
142142
postsPerPage={filters.postsPerPage || 15}
143143
/>
144144
</Suspense>

src/app/(app)/(default_layout)/(roadmaps)/roadmaps/page.tsx

+16-24
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,11 @@ import { getUserMissionRecords } from '@/utils/data/missions/get-user-mission-re
1818

1919
export async function generateMetadata() {
2020
return createMetadata({
21-
title: 'Coding Roadmaps | TechBlitz',
21+
title: 'Learning Paths | TechBlitz',
2222
description:
23-
'A collection of coding questions, ranging from Javascript, React, Node, Web Development. Aimed to enhance your coding skills in each domain.',
24-
keywords: [
25-
'javascript coding questions',
26-
'react coding questions',
27-
'web development coding questions',
28-
'coding challenges',
29-
'coding tutorials',
30-
'coding practice',
31-
'coding practice questions',
32-
],
23+
'A collection of learning paths, ranging from Javascript, React, Node, Web Development. Created to help you learn and grow your skills in different areas of programming.',
3324
image: {
34-
text: 'Coding Roadmaps | TechBlitz',
25+
text: 'Learning Paths | TechBlitz',
3526
bgColor: '#000',
3627
textColor: '#fff',
3728
},
@@ -41,25 +32,26 @@ export async function generateMetadata() {
4132

4233
const heroDescription = (
4334
<div className="flex flex-col gap-y-4 z-20 relative font-inter max-w-3xl">
44-
<p className="text-sm md:text-base text-gray-400">
45-
Explore our curated lists of coding questions, ranging from Javascript, React, Node, Web
46-
Development. Perfect for your daily coding practice.
35+
<p className="text-sm md:text-base text-gray-400 font-onest">
36+
Explore our library of programming learning paths, consisting of many different topics on the
37+
web. Set your own goals and work your way through the challenges at your own pace, and get 1%
38+
better every day.
4739
</p>
4840
<div className="flex flex-col gap-y-2">
49-
<p className="text-gray-400">Can't find what you're looking for?</p>
50-
<div className="flex items-center gap-x-2">
51-
<Button href="/questions" variant="secondary">
52-
View all questions
41+
<p className="text-gray-400 font-onest">Can't find what you're looking for?</p>
42+
<div className="flex items-center gap-x-2 pt-1">
43+
<Button href="/coding-challenges" variant="secondary">
44+
View all challenges
5345
</Button>
5446
<Suspense
5547
fallback={
56-
<Button variant="default" className="w-full">
48+
<Button variant="ghost" className="w-full">
5749
Your next recommended question
58-
<ArrowRightIcon className="w-4 h-4" />
50+
<ArrowRightIcon className="size-4" />
5951
</Button>
6052
}
6153
>
62-
<ContinueJourney text="Your next recommended question" variant="default" />
54+
<ContinueJourney text="Your next recommended question" variant="ghost" />
6355
</Suspense>
6456
</div>
6557
</div>
@@ -72,7 +64,7 @@ export default async function ExploreQuestionsPage() {
7264
'@context': 'https://schema.org',
7365
'@type': 'WebPage',
7466
url: `${getBaseUrl()}/roadmaps`,
75-
headline: 'Coding Roadmaps | TechBlitz',
67+
headline: 'Learning Paths | TechBlitz',
7668
description:
7769
'Curated lists of coding questions, ranging from Javascript, React, Node, Web Development. Perfect for your daily coding practice.',
7870
image:
@@ -135,7 +127,7 @@ export default async function ExploreQuestionsPage() {
135127
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
136128
/>
137129
<div className="flex flex-col gap-y-12 max-w-7xl mx-auto">
138-
<Hero heading="Coding Roadmaps" subheading={heroDescription} container={true} />
130+
<Hero heading="Library" subheading={heroDescription} container={true} />
139131
<div className="lg:container flex flex-col lg:flex-row mt-5 gap-16">
140132
<div className="w-full lg:w-[70%] flex flex-col gap-12">
141133
{Object.entries(studyPathsByCategory).map(([category, paths]) => (

src/app/(marketing)/(landing-pages)/daily-coding-challenges-for-beginners/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const faqs = [
6464
<>
6565
We update our coding question suite with new challenges every day. Ensuring you can learn
6666
essential coding skills faster than ever. You can view the question suite{' '}
67-
<Link href="/questions" className="text-accent">
67+
<Link href="/coding-challenges" className="text-accent">
6868
here
6969
</Link>
7070
.

src/app/(marketing)/blog/posts/introducing-techblitz.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Our constantly expanding library covers everything from fundamental JavaScript c
128128
</div>
129129

130130
<div className="mt-4">
131-
Preview our question library <a href="/questions" target="_blank" className="text-accent">here</a> - no login required!
131+
Preview our question library <a href="/coding-challenges" target="_blank" className="text-accent">here</a> - no login required!
132132
</div>
133133

134134
<br />

src/app/sitemap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
131131
// APP ROUTES ACCESSIBLE TO ALL USERS
132132

133133
{
134-
url: `${baseUrl}/questions`,
134+
url: `${baseUrl}/coding-challenges`,
135135
lastModified: new Date(),
136136
},
137137
{

src/components/app/navigation/continue-journey-button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getSuggestions } from '@/utils/data/questions/get-suggestions';
44

55
export default async function ContinueJourney(opts: {
66
text?: string;
7-
variant?: 'accent' | 'secondary' | 'default';
7+
variant?: 'accent' | 'secondary' | 'default' | 'ghost';
88
}) {
99
const suggestions = await getSuggestions({
1010
limit: 1,

src/components/app/navigation/question-navigation.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function QuestionNavigation(opts: {
5656
// Check if we're using overviewData
5757
if ('overviewData' in studyPath && studyPath.overviewData) {
5858
// Get all question slugs from the overviewData structure
59-
const allSlugs = Object.values(studyPath.overviewData as any)
59+
const allSlugs = Object.values(studyPath.overviewData || {})
6060
.flatMap((section: any) => section.questionSlugs || [])
6161
.filter(Boolean);
6262

src/components/app/navigation/sidebar.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function AppSidebar({ user, profile, suggestion }: AppSidebarProps) {
100100
animatable: true,
101101
},
102102
{
103-
title: 'Learn',
103+
title: 'Library',
104104
url: '/roadmaps',
105105
icon: Blog3,
106106
animatable: true,
@@ -152,8 +152,8 @@ export function AppSidebar({ user, profile, suggestion }: AppSidebarProps) {
152152
animatable: true,
153153
},
154154
{
155-
title: 'Learn',
156-
tooltip: 'Learn',
155+
title: 'Library',
156+
tooltip: 'Library',
157157
url: '/roadmaps',
158158
icon: Blog3,
159159
animatable: true,

src/components/app/questions/layout/questions-list.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default async function QuestionsList({
3535
Upgrade to Premium to access custom questions.
3636
</p>
3737
<div className="flex gap-x-2">
38-
<Button href="/questions">Back to all questions</Button>
38+
<Button href="/coding-challenges">Back to all challenges</Button>
3939
<Button href={getUpgradeUrl()} variant="secondary">
4040
Upgrade
4141
</Button>

src/components/app/questions/single/layout/page-header.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ export default function QuestionPageHeader({
3838
return (
3939
<div className="grid grid-cols-12 items-center justify-between pt-2 px-3 relative">
4040
<div className="col-span-2 lg:col-span-4 flex items-center justify-start">
41-
<RouterBack href="/questions" className="px-0 block md:hidden">
41+
<RouterBack href="/coding-challenges" className="px-0 block md:hidden">
4242
<HomeIcon width="16" height="16" />
4343
</RouterBack>
4444
<TooltipProvider delayDuration={0} skipDelayDuration={100}>
4545
<Tooltip>
4646
<TooltipTrigger asChild>
47-
<RouterBack href="/questions" className="px-0 hidden md:block">
47+
<RouterBack href="/coding-challenges" className="px-0 hidden md:block">
4848
<LogoSmall size={32} />
4949
</RouterBack>
5050
</TooltipTrigger>

src/components/app/roadmaps/create-roadmap-button.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ export default function CreateRoadmapButton({
110110
</div>
111111
) : (
112112
<div className="text-sm text-muted-foreground flex flex-col gap-y-5">
113-
<Button variant="default" href="/questions">
114-
Go to questions
113+
<Button variant="default" href="/coding-challenges">
114+
Go to challenges
115115
</Button>
116116
<div className="flex flex-col gap-y-2">
117117
<Progress value={progress} className="h-2 mb-2" />

src/components/app/study-paths/list.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export default function StudyPathsList({
5454

5555
if (studyPath.overviewData) {
5656
// Extract slugs from overviewData sections
57-
allQuestionSlugs = Object.values(studyPath.overviewData)
58-
.flatMap((section: any) => section.questionSlugs)
57+
allQuestionSlugs = Object.values(studyPath.overviewData || {})
58+
.flatMap((section: any) => section.questionSlugs || [])
5959
.filter(Boolean);
6060
} else {
6161
// Use regular questionSlugs
@@ -92,6 +92,8 @@ export default function StudyPathsList({
9292
<div className={cn('relative z-10 justify-self-center grid', className)}>
9393
{sortedQuestions.map((question, index) => {
9494
const offsetValue = getOffset(index);
95+
// Find the question's index in the allQuestionSlugs array
96+
9597
return (
9698
<div key={question.slug} className="mb-8 flex justify-center">
9799
<QuestionCardClient questionData={question} offset={offsetValue}>

src/components/marketing/features/leaderboard/leaderboard-features-left.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ export default async function LeaderboardFeaturesLeft() {
4646
Challenge your friends and see who is the best. You can even create your own challenges
4747
and see who is the best.
4848
</p>
49-
<Button variant="secondary" href="/questions" className="w-fit flex items-center gap-1">
49+
<Button
50+
variant="secondary"
51+
href="/coding-challenges"
52+
className="w-fit flex items-center gap-1"
53+
>
5054
Try it out
5155
<ChevronRight className="size-3 ml-1" />
5256
</Button>

src/components/marketing/global/navigation/mobile-menu.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const menuItems: MenuItem[] = [
4646
label: 'Learn',
4747
href: '/roadmaps',
4848
children: [
49-
{ label: 'JavaScript', href: '/questions?tag=javascript' },
50-
{ label: 'React', href: '/questions?tag=react' },
49+
{ label: 'JavaScript', href: '/coding-challenges?tag=javascript' },
50+
{ label: 'React', href: '/coding-challenges?tag=react' },
5151
{ label: 'Roadmaps', href: '/roadmaps' },
5252
],
5353
},

src/components/marketing/global/navigation/navigation-items.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ export function NavigationMenuItems() {
133133
<NavigationMenuContent>
134134
<ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
135135
<ListItem
136-
href="/questions?tag=javascript"
136+
href="/coding-challenges?tag=javascript"
137137
title="JavaScript"
138138
icon={<JavascriptIcon className="size-4" />}
139139
>
140140
Learn JavaScript with our easy-to-understand coding questions.
141141
</ListItem>
142142
<ListItem
143-
href="/questions?tag=react"
143+
href="/coding-challenges?tag=react"
144144
title="React"
145145
icon={<ReactIcon className="size-4" />}
146146
>

src/components/marketing/homepage/personalized/left.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ export default function PersonalizedLeft() {
2424
Stuck on a problem? Ask your very own AI coding assistant. Giving you the ultimate
2525
learning experience no matter what challenge you are facing.
2626
</p>
27-
<Button variant="default" href="/questions" className="w-fit flex items-center gap-1">
27+
<Button
28+
variant="default"
29+
href="/coding-challenges"
30+
className="w-fit flex items-center gap-1"
31+
>
2832
Try it out
2933
<ChevronRight className="size-3 ml-1" />
3034
</Button>

src/hooks/use-study-path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const useStudyPathQuestions = (studyPathSlug: string) => {
3737
try {
3838
if (studyPath.overviewData) {
3939
// If we have overviewData, extract questionSlugs from each section
40-
questionSlugs = Object.values(studyPath.overviewData)
40+
questionSlugs = Object.values(studyPath.overviewData || {})
4141
.flatMap((section: any) => section.questionSlugs || [])
4242
.filter(Boolean);
4343
} else {

0 commit comments

Comments
 (0)