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,
|
setOpenSourceMode,
|
||||||
setSelectedOption
|
setSelectedOption
|
||||||
}) => {
|
}) => {
|
||||||
|
// Handle toggle change event
|
||||||
const handleToggleChange = () => {
|
const handleToggleChange = () => {
|
||||||
const newValue = !openSourceMode;
|
const newValue = !openSourceMode; // Toggle the current state
|
||||||
setOpenSourceMode(newValue);
|
setOpenSourceMode(newValue); // Update the open source mode state
|
||||||
|
|
||||||
// Update radio selection based on the new openSourceMode value
|
// Update radio selection based on the new openSourceMode value
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
setSelectedOption('FOSS'); // Set to FOSS if enabling open source mode
|
setSelectedOption('FOSS'); // Set to FOSS if enabling open source mode
|
||||||
} else {
|
} else {
|
||||||
setSelectedOption('None'); // Or any other default value when disabling
|
setSelectedOption('None'); // Set to a default value when disabling
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="settings-option">
|
<div className="settings-option"> {/* Container for the toggle setting */}
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox" // Checkbox for toggling open source mode
|
||||||
checked={openSourceMode}
|
checked={openSourceMode} // Check if the mode is currently enabled
|
||||||
onChange={handleToggleChange}
|
onChange={handleToggleChange} // Handle changes to the checkbox
|
||||||
/>
|
/>
|
||||||
Enable Open Source Mode
|
Enable Open Source Mode
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in a new issue