OpenSourceToggle comments
This commit is contained in:
parent
461c469289
commit
bc6b7f8481
1 changed files with 8 additions and 7 deletions
|
@ -12,25 +12,26 @@ const OpenSourceModeToggle: React.FC<OpenSourceModeToggleProps> = ({
|
|||
setOpenSourceMode,
|
||||
setSelectedOption
|
||||
}) => {
|
||||
// Handle toggle change event
|
||||
const handleToggleChange = () => {
|
||||
const newValue = !openSourceMode;
|
||||
setOpenSourceMode(newValue);
|
||||
const newValue = !openSourceMode; // Toggle the current state
|
||||
setOpenSourceMode(newValue); // Update the open source mode state
|
||||
|
||||
// Update radio selection based on the new openSourceMode value
|
||||
if (newValue) {
|
||||
setSelectedOption('FOSS'); // Set to FOSS if enabling open source mode
|
||||
} else {
|
||||
setSelectedOption('None'); // Or any other default value when disabling
|
||||
setSelectedOption('None'); // Set to a default value when disabling
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="settings-option">
|
||||
<div className="settings-option"> {/* Container for the toggle setting */}
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={openSourceMode}
|
||||
onChange={handleToggleChange}
|
||||
type="checkbox" // Checkbox for toggling open source mode
|
||||
checked={openSourceMode} // Check if the mode is currently enabled
|
||||
onChange={handleToggleChange} // Handle changes to the checkbox
|
||||
/>
|
||||
Enable Open Source Mode
|
||||
</label>
|
||||
|
|
Loading…
Reference in a new issue