-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added colors to toolkits and wrappers
- Loading branch information
Showing
13 changed files
with
263 additions
and
39 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/outline"; | ||
import { useContext, useEffect, useState } from "react"; | ||
import { PopUpContext } from "../../contexts/popUpContext"; | ||
import CodeAreaModal from "../../modals/codeAreaModal"; | ||
import TextAreaModal from "../../modals/textAreaModal"; | ||
import { TextAreaComponentType } from "../../types/components"; | ||
import PromptAreaModal from "../../modals/promptModal"; | ||
|
||
export default function PromptAreaComponent({ value, onChange, disabled }:TextAreaComponentType) { | ||
const [myValue, setMyValue] = useState(value); | ||
const { openPopUp } = useContext(PopUpContext); | ||
useEffect(() => { | ||
if (disabled) { | ||
setMyValue(""); | ||
onChange(""); | ||
} | ||
}, [disabled, onChange]); | ||
return ( | ||
<div className={disabled ? "pointer-events-none cursor-not-allowed w-full" : " w-full"}> | ||
<div className="w-full flex items-center gap-3"> | ||
<span | ||
className={ | ||
"truncate block w-full text-gray-500 px-3 py-2 rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" + | ||
(disabled ? " bg-gray-200" : "") | ||
} | ||
> | ||
{myValue !== "" ? myValue : 'Text empty'} | ||
</span> | ||
<button onClick={()=>{openPopUp(<PromptAreaModal value={myValue} setValue={(t:string) => {setMyValue(t); onChange(t);}}/>)}}> | ||
<ArrowTopRightOnSquareIcon className="w-6 h-6 hover:text-blue-600" /> | ||
</button> | ||
</div> | ||
</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
Oops, something went wrong.