From d12c850df0bac716053f1e752f3bde28f0701bcf Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Thu, 3 Oct 2024 14:54:59 +0200 Subject: [PATCH] Modified | Change Account Settings --- app/components/settings/Settings.tsx | 15 ++++++--------- app/components/settings/TextSettings.tsx | 4 +++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/components/settings/Settings.tsx b/app/components/settings/Settings.tsx index 7b752d7..cde6e92 100644 --- a/app/components/settings/Settings.tsx +++ b/app/components/settings/Settings.tsx @@ -580,26 +580,23 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( - void; // The method to update the state type: 'text' | 'email' | 'password'; // The type of input field + placeholder?: string; // Optional placeholder text } -const TextSetting: React.FC = ({ label, value, setValue, type }) => { +const TextSetting: React.FC = ({ label, value, setValue, type, placeholder }) => { const handleTextChange = (e: React.ChangeEvent) => { const newText = e.target.value; // Get the new value from the input setValue(newText); // Update the state in the parent component @@ -20,6 +21,7 @@ const TextSetting: React.FC = ({ label, value, setValue, type type={type} // Use the type prop for the input value={value} // Set the current value onChange={handleTextChange} // Handle input changes + placeholder={placeholder} // Set the placeholder text /> );