doc: extra data from CreatePost and update the UI/UX
This commit is contained in:
1 parent
a432ea2f92
commit
ff7891c5ab
1 file changed
+42
-2
@@ -1,7 +1,47 @@
|
||||
import React from "react";
|
||||
|
||||
const FormField = () => {
|
||||
return <div>FormField</div>;
|
||||
const FormField = ({
|
||||
labelName,
|
||||
type,
|
||||
name,
|
||||
placeholder,
|
||||
value,
|
||||
handleChange,
|
||||
isSurpriseMe,
|
||||
handleSurpriseMe,
|
||||
}) => {
|
||||
return (
|
||||
<div>
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
<label
|
||||
htmlFor={name}
|
||||
className="block text-sm font-medium text-gray-900"
|
||||
>
|
||||
{labelName}
|
||||
</label>
|
||||
{isSurpriseMe && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleSurpriseMe}
|
||||
className="font-semibold text-xs bg-[#ECECF1] py-1 px-2 rounded-[5px] text-black"
|
||||
>
|
||||
Surprise Me
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<input
|
||||
type={type}
|
||||
id={name}
|
||||
name={name}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={handleChange}
|
||||
required
|
||||
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-[#4649FF] focus:border-[#4649FF] outline-none block w-full p-3"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default FormField;
|
||||
Reference in new issue
Block a user