forked from rupali-codes/LinksHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:rupali-codes/LinksHub
- Loading branch information
Showing
43 changed files
with
862 additions
and
785 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import { SVGProps } from "react"; | ||
const SearchIcon = ({ ...rest }: SVGProps<SVGSVGElement>) => { | ||
return ( | ||
<svg | ||
aria-hidden="true" | ||
fill="currentColor" | ||
viewBox="0 0 20 20" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...rest} | ||
> | ||
<path | ||
fillRule="evenodd" | ||
d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" | ||
clipRule="evenodd" | ||
></path> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default SearchIcon; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 +1,24 @@ | ||
import { Spinner } from "./Spinner" | ||
import useLoader from "hooks/useLoader"; | ||
import { ReactNode } from "react"; | ||
import { Spinner } from "./Spinner"; | ||
|
||
export const Preloader = ({backgroundColor, spinnerColor, spinnerSize}:{backgroundColor: string, spinnerColor:string, spinnerSize: number}) => { | ||
return ( | ||
<div className={`loader ${backgroundColor} fixed top-0 left-0 w-full h-screen flex justify-center items-center`}> | ||
<Spinner | ||
spinnerColor={spinnerColor} | ||
spinnerSize={spinnerSize} | ||
/> | ||
</div> | ||
) | ||
} | ||
export const Preloader = ({ | ||
backgroundColor, | ||
children, | ||
...rest | ||
}: { | ||
children: JSX.Element; | ||
backgroundColor: string; | ||
color: string; | ||
size: number; | ||
}): JSX.Element => { | ||
const { loader } = useLoader(); | ||
if (!loader) return children; | ||
return ( | ||
<div | ||
className={`loader ${backgroundColor} fixed top-0 left-0 w-full h-screen flex justify-center items-center`} | ||
> | ||
<Spinner {...rest} /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
import Gridloader from "react-spinners/GridLoader" | ||
|
||
export const Spinner = ({spinnerColor, spinnerSize}:{spinnerColor:string, spinnerSize:number}) => { | ||
import Gridloader from "react-spinners/GridLoader"; | ||
import { LengthType } from "react-spinners/helpers/props"; | ||
|
||
export const Spinner = (props: { color: string; size: LengthType }) => { | ||
return ( | ||
<Gridloader | ||
color= {spinnerColor} | ||
size={spinnerSize} | ||
aria-label="Loading Spinner" | ||
data-testid="loader" | ||
/> | ||
<Gridloader {...props} aria-label="Loading Spinner" data-testid="loader" /> | ||
); | ||
}; |
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
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,23 +1,29 @@ | ||
import { useState, useEffect } from "react"; | ||
import { useTheme } from "next-themes"; | ||
|
||
import { HiSun, HiMoon } from "react-icons/hi"; | ||
import { HiSun, HiMoon } from "react-icons/hi"; | ||
|
||
export function ThemeToggler() { | ||
const { resolvedTheme, setTheme } = useTheme(); | ||
const [mounted, setMounted] = useState(false); | ||
const { resolvedTheme, setTheme } = useTheme(); | ||
const [mounted, setMounted] = useState(false); | ||
|
||
useEffect(() => { setMounted(true) }, []); | ||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
if (!mounted) return <></>; | ||
if (!mounted) return <></>; | ||
|
||
return ( | ||
<button | ||
onClick={() => { | ||
setTheme(resolvedTheme === "dark" ? "light" : "dark"); | ||
}} | ||
> | ||
{resolvedTheme === "dark" ? <HiSun className='text-white hover:text-violet-500' size={'1.5rem'} /> : <HiMoon className='hover:text-violet-500' size={'1.5rem'}/>} | ||
</button> | ||
); | ||
} | ||
return ( | ||
<button | ||
onClick={() => { | ||
setTheme(resolvedTheme === "dark" ? "light" : "dark"); | ||
}} | ||
> | ||
{resolvedTheme === "dark" ? ( | ||
<HiSun className="text-white hover:text-violet-500" size={"1.5rem"} /> | ||
) : ( | ||
<HiMoon className="hover:text-violet-500" size={"1.5rem"} /> | ||
)} | ||
</button> | ||
); | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#Database instructions | ||
|
||
<ul> | ||
<li> | ||
A newly created category and subcategiry should be added to the data file | ||
</li> | ||
<li>A category has it's own folder</li> | ||
<li> | ||
A subcategory is contained in a category folder | ||
</li> | ||
|
||
<li> | ||
When a new category is added ensure to create a folder for it | ||
</li> | ||
<li> | ||
When a new subcategory is added ensure to create a json file for it and place in its respective category | ||
</li> | ||
<li> | ||
Add your resources to the subcategory json file of your choice | ||
</li> | ||
<li> | ||
Export the newly created json file on the index file | ||
</li> | ||
|
||
</ul> |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"id": "66", | ||
"name": "Express Validator", | ||
"description": "Express validator is a set of express.js middlewares that wraps validator.js validator and sanitizer functions.", | ||
"url": "https://express-validator.github.io/docs/", | ||
"category": "backend", | ||
"subcategory": "validation" | ||
} | ||
] |
Oops, something went wrong.