Skip to content

Commit cfb0922

Browse files
authored
Merge pull request #369 from karannfr/prod
fix: changed request url in faq from hyperlink to modal trigger, faq styling
2 parents 4a9adf7 + d452bcc commit cfb0922

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

src/components/screens/Faq.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React from "react";
44
import Link from 'next/link';
5-
5+
import RequestModal from "../ui/RequestModal";
66
import { useState } from "react";
77

88
function Faq() {
@@ -29,9 +29,8 @@ const faqs = [
2929
Click the {" "}
3030
<Link
3131
href="https://papers.codechefvit.com/upload"
32-
target="_blank"
3332
rel="noopener noreferrer"
34-
className="dark:text-blue-400 text-red-500 underline"
33+
className="text-[#562EE7] dark:text-[#A47DE5] underline"
3534
>
3635
Upload
3736
</Link>
@@ -51,7 +50,7 @@ const faqs = [
5150
href="mailto:codechefvit@gmail.com"
5251
target="_blank"
5352
rel="noopener noreferrer"
54-
className="dark:text-blue-400 text-red-500 underline"
53+
className="text-[#562EE7] dark:text-[#A47DE5] underline"
5554
>
5655
codechefvit@gmail.com
5756
</Link>
@@ -64,15 +63,9 @@ const faqs = [
6463
answer:
6564
<>
6665
If the paper you&apos;re looking for isn’t available, you can{" "}
67-
<Link
68-
href="https://papers.codechefvit.com/request"
69-
target="_blank"
70-
rel="noopener noreferrer"
71-
className="dark:text-blue-400 text-red-500 underline"
72-
>
73-
submit a request
74-
</Link>
75-
.
66+
<span>
67+
<RequestModal section="faq"/>
68+
</span>
7669
</>,
7770
},
7871
{
@@ -108,7 +101,7 @@ const faqs = [
108101
<h2
109102
className={`w-full text-sm font-semibold leading-snug transition-colors sm:text-base md:text-lg ${
110103
faqActive === index
111-
? "text-[#A47DE5]"
104+
? "text-[#562EE7] dark:text-[#A47DE5] "
112105
: "text-black dark:text-white"
113106
}`}
114107
>
@@ -117,7 +110,7 @@ const faqs = [
117110
<button
118111
className={`flex h-6 w-8 shrink-0 items-center justify-center rounded-full text-base font-bold transition-all duration-200 sm:h-7 sm:w-9 sm:text-lg ${
119112
faqActive === index
120-
? "bg-[#A47DE5] text-white"
113+
? "bg-[#562EE7] dark:bg-[#A47DE5] text-white"
121114
: "bg-black text-white"
122115
}`}
123116
>

src/components/ui/RequestModal.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Course = {
3333
title?: string | null;
3434
};
3535

36-
const RequestModal = () => {
36+
const RequestModal = ({section = "navbar"} : {section? : string}) => {
3737
const [open, setOpen] = useState(false);
3838
const [subjects, setSubjects] = useState<string[]>([]);
3939
const [searchText, setSearchText] = useState("");
@@ -115,14 +115,20 @@ const RequestModal = () => {
115115
}, [searchText, fuse, selectedSubject]);
116116

117117
return (
118-
<Dialog open={open} onOpenChange={(isOpen) => {
118+
<Dialog
119+
open={open} onOpenChange={(isOpen) => {
119120
setOpen(isOpen);
120121
if (isOpen) resetModal();
121122
}}>
123+
{section === "navbar" ?
122124
<DialogTrigger className='flex items-center gap-2'>
123125
<ArrowUpRight className="h-4 w-4"/>
124126
<span className="font-medium">Request Paper</span>
125-
</DialogTrigger>
127+
</DialogTrigger> :
128+
<DialogTrigger className='underline text-[#562EE7] dark:text-[#A47DE5] '>
129+
<span className="font-medium">request a paper.</span>
130+
</DialogTrigger>
131+
}
126132
<DialogContent className='bg-[#F3F5FF] dark:bg-[#070114] border-[#3A3745] items-start'>
127133
<DialogHeader>
128134
<DialogTitle>Request Papers</DialogTitle>

0 commit comments

Comments
 (0)