-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: connect db with toolkit and fix errors
- Loading branch information
1 parent
f2abe5b
commit f44b827
Showing
10 changed files
with
154 additions
and
50 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,3 +1,4 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "next/typescript"] | ||
"extends": ["next/core-web-vitals", "next/typescript"], | ||
"rules": {"@next/next/no-img-element": "off"} | ||
} |
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,35 +1,29 @@ | ||
import { useToolkitForm } from "@/context/ToolkitFormContext"; | ||
import * as Icons from "@heroicons/react/24/outline"; | ||
// import * as Icons from "@heroicons/react/24/outline"; | ||
|
||
export default function AddImageUrl() { | ||
const { setFormState } = useToolkitForm(); | ||
const { formState, setFormState } = useToolkitForm(); | ||
|
||
const iconList = Object.entries(Icons).map(([name]) => name); | ||
|
||
const selectIcon = (iconName: string) => { | ||
setFormState((prev) => ({ | ||
const handleUrlChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
setFormState(prev => ({ | ||
...prev, | ||
imageUrl: iconName, | ||
imageUrl: e.target.value | ||
})); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<p className="text-white">Icon</p> | ||
<div className="grid grid-cols-4 gap-2 max-h-40 overflow-y-auto"> | ||
{iconList.map((iconName) => { | ||
const IconComponent = Icons[iconName as keyof typeof Icons]; | ||
return ( | ||
<button | ||
key={iconName} | ||
onClick={() => selectIcon(iconName)} | ||
className="p-2 hover:bg-twd-secondary-purple rounded" | ||
> | ||
<IconComponent className="h-6 w-6 text-white" /> | ||
</button> | ||
); | ||
})} | ||
</div> | ||
<label htmlFor="imageUrl" | ||
className="text-white" | ||
>Image URL</label> | ||
|
||
<input | ||
type="url" | ||
id="imageUrl" | ||
value={formState.imageUrl} | ||
onChange={handleUrlChange} | ||
className="w-full p-2 rounded bg-twd-background text-white border border-gray-700" | ||
/> | ||
</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
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