-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: error handling, dark mode, consent bug fixes
- Loading branch information
Siddharth
committed
Oct 22, 2023
1 parent
52b4a31
commit e70c0f5
Showing
29 changed files
with
593 additions
and
317 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
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 |
---|---|---|
@@ -1,21 +1,37 @@ | ||
import React, { InputHTMLAttributes } from "react" | ||
import React, { InputHTMLAttributes } from "react"; | ||
|
||
interface InputProps extends InputHTMLAttributes<HTMLInputElement> { | ||
label?: string | ||
id: string | ||
label?: string; | ||
id: string; | ||
} | ||
|
||
const InputComponent: React.FC<InputProps> = ({ label, id, ...inputProps }) => { | ||
return ( | ||
<div className="mb-4"> | ||
{label ? ( | ||
<label htmlFor={id} className="block mb-2 text-sm font-medium text-gray-900"> | ||
<label | ||
htmlFor={id} | ||
className="block mb-2 text-sm font-medium text-[var(--inputColor)]" | ||
> | ||
{label} | ||
</label> | ||
) : null} | ||
<input {...inputProps} id={id} className="p-2 border rounded w-full" /> | ||
<input | ||
{...inputProps} | ||
id={id} | ||
className="p-2 | ||
border-2 | ||
border-solid | ||
border-gray-300 | ||
rounded-sm | ||
mb- | ||
w-full | ||
bg-[var(--inputBackground)] | ||
focus-within:border-blue-500 | ||
focus-within:bg-[var(--inputBackground)] " | ||
/> | ||
</div> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default InputComponent | ||
export default InputComponent; |
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,11 @@ | ||
"use client"; | ||
import React, { ReactNode } from "react"; | ||
import { ThemeProvider } from "next-themes"; | ||
|
||
interface Props { | ||
children: ReactNode; | ||
} | ||
|
||
export default function Theme({ children }: Props) { | ||
return <ThemeProvider defaultTheme="system">{children}</ThemeProvider>; | ||
} |
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,47 @@ | ||
import React, { SelectHTMLAttributes } from "react"; | ||
|
||
interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> { | ||
label?: string; | ||
id: string; | ||
options: string[]; | ||
} | ||
|
||
const SelectComponent: React.FC<SelectProps> = ({ | ||
label, | ||
id, | ||
options, | ||
...selectProps | ||
}) => { | ||
return ( | ||
<div className="mb-4"> | ||
{label ? ( | ||
<label | ||
htmlFor={id} | ||
className="block mb-2 text-sm font-medium text-[var(--inputColor)]" | ||
> | ||
{label} | ||
</label> | ||
) : null} | ||
<select | ||
{...selectProps} | ||
id={id} | ||
className="p-2 | ||
border-2 | ||
border-solid | ||
border-gray-300 | ||
rounded-sm | ||
w-full | ||
bg-[var(--inputBackground)] | ||
focus:border-blue-500 " | ||
> | ||
{options.map((option, index) => ( | ||
<option key={index} value={option}> | ||
{option} | ||
</option> | ||
))} | ||
</select> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SelectComponent; |
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
Oops, something went wrong.