-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef40736
commit 135c3aa
Showing
3 changed files
with
98 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,93 @@ | ||
"use client" | ||
import Programs from "@/comps/Programs"; | ||
'use client'; | ||
import Programs from '@/comps/Programs'; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
DialogFooter, | ||
DialogClose | ||
} from "@/components/ui/dialog" | ||
import { Button } from "@/components/ui/button"; | ||
import { Label } from "@/components/ui/label" | ||
import { Input } from "@/components/ui/input" | ||
import { CopyIcon } from "@radix-ui/react-icons" | ||
import { useEffect, useState } from "react"; | ||
|
||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
DialogFooter, | ||
DialogClose, | ||
} from '@/components/ui/dialog'; | ||
import { Button } from '@/components/ui/button'; | ||
import { Label } from '@/components/ui/label'; | ||
import { Input } from '@/components/ui/input'; | ||
import { CopyIcon } from '@radix-ui/react-icons'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
|
||
|
||
export default function program() { | ||
const [filterOption, setFilterOption] = useState<"" | "Yes" | "No">(""); // Explicitly define the type | ||
|
||
export default function programs() { | ||
const [filterOption, setFilterOption] = useState(""); | ||
|
||
const handleFilterChange = (newOption) => { | ||
setFilterOption(newOption); | ||
}; | ||
return ( | ||
const handleFilterChange = (newOption: "" | "Yes" | "No") => { | ||
// Only set the filter option if it's one of the allowed values | ||
if (newOption === "" || newOption === "Yes" || newOption === "No") { | ||
setFilterOption(newOption); | ||
} | ||
}; | ||
|
||
return ( | ||
<div> | ||
<section className="mx-4 "> | ||
<div className="container flex flex-col items-center gap-4 text-center"> | ||
<h1 className="tracking-tight font-semibold text-2xl sm:text-5xl md:text-6xl lg:text-5xl mb-4 dark:text-white"> | ||
Opensource Programs List | ||
</h1> | ||
<p className="max-w-[42rem] leading-normal dark:text-white text-muted-foreground sm:text-xl sm:leading-8"> | ||
Discover a curated collection of diverse open source programs. Filter based on stipend availability and find opportunities that match your interests and skills. | ||
|
||
</p> | ||
</div> | ||
<Filter onFilterChange={handleFilterChange} /> | ||
</section> | ||
<Programs filter_option={filterOption} /> | ||
<section className="mx-4 "> | ||
<div className="container flex flex-col items-center gap-4 text-center"> | ||
<h1 className="tracking-tight font-semibold text-2xl sm:text-5xl md:text-6xl lg:text-5xl mb-4 dark:text-white"> | ||
Opensource Programs List | ||
</h1> | ||
<p className="max-w-[42rem] leading-normal dark:text-white text-muted-foreground sm:text-xl sm:leading-8"> | ||
Discover a curated collection of diverse open source programs. Filter based on stipend availability and find opportunities that match your interests and skills. | ||
</p> | ||
</div> | ||
<Filter onFilterChange={handleFilterChange} /> | ||
</section> | ||
<Programs filter_option={filterOption} /> | ||
</div> | ||
); | ||
} | ||
function Filter({ onFilterChange }) { | ||
const [opt, setOpt] = useState(""); | ||
useEffect(() => { | ||
); | ||
} | ||
|
||
function Filter({ onFilterChange }: { onFilterChange: (newOption: "" | "Yes" | "No") => void }) { | ||
const [opt, setOpt] = useState<"" | "Yes" | "No">(""); // Explicitly define the type | ||
|
||
useEffect(() => { | ||
// Call the callback function whenever opt changes | ||
onFilterChange(opt); | ||
}, [opt, onFilterChange]); | ||
|
||
return ( | ||
<div className="dark:text-white dark:bg-[#09090B]"> | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Button variant="outline">Filters</Button> | ||
</DialogTrigger> | ||
<DialogContent className="sm:max-w-md"> | ||
<DialogHeader className="dark:text-white "> | ||
<DialogTitle className="dark:text-white ">Filters</DialogTitle> | ||
</DialogHeader> | ||
<div className="flex items-center space-x-2"> | ||
<DialogClose asChild> | ||
<Button size="sm" className="px-3" onClick={() => setOpt("Yes")}> | ||
<span className="sr-only">Copy</span> | ||
With stipend | ||
</Button> | ||
</DialogClose> | ||
|
||
|
||
|
||
<DialogClose asChild> | ||
}, [opt, onFilterChange]); | ||
|
||
<Button onClick={() => setOpt("No")} size="sm" className="px-3"> | ||
<span className="sr-only">Copy</span> | ||
No stipend | ||
</Button> | ||
</DialogClose> | ||
return ( | ||
<div className="dark:text-white dark:bg-[#09090B]"> | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Button variant="outline">Filters</Button> | ||
</DialogTrigger> | ||
<DialogContent className="sm:max-w-md"> | ||
<DialogHeader className="dark:text-white"> | ||
<DialogTitle className="dark:text-white">Filters</DialogTitle> | ||
</DialogHeader> | ||
<div className="flex items-center space-x-2"> | ||
<DialogClose asChild> | ||
<Button size="sm" className="px-3" onClick={() => setOpt("Yes")}> | ||
<span className="sr-only">Copy</span> | ||
With stipend | ||
</Button> | ||
</DialogClose> | ||
|
||
<DialogClose asChild> | ||
<Button size="sm" className="px-3" onClick={() => setOpt("")}> | ||
<span className="sr-only">Copy</span> | ||
Default | ||
</Button> | ||
</DialogClose> | ||
<DialogClose asChild> | ||
<Button onClick={() => setOpt("No")} size="sm" className="px-3"> | ||
<span className="sr-only">Copy</span> | ||
No stipend | ||
</Button> | ||
</DialogClose> | ||
|
||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
<DialogClose asChild> | ||
<Button size="sm" className="px-3" onClick={() => setOpt("")}> | ||
<span className="sr-only">Copy</span> | ||
Default | ||
</Button> | ||
</DialogClose> | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
</div> | ||
); | ||
} | ||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
// next.config.js | ||
|
||
module.exports = nextConfig | ||
module.exports = { | ||
eslint: { | ||
ignoreDuringBuilds: true, | ||
}, | ||
env: { | ||
NEXT_PUBLIC_AUTH_TOKEN: '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', | ||
}, | ||
typescript: { | ||
// !! WARN !! | ||
// Dangerously allow production builds to successfully complete even if | ||
// your project has type errors. | ||
// !! WARN !! | ||
ignoreBuildErrors: true, | ||
}, | ||
}; | ||
|