From c6dde10e4e713489b67bbeb3a2e345150012323e Mon Sep 17 00:00:00 2001
From: sowgro <tpoke.ferrari@gmail.com>
Date: Wed, 6 Nov 2024 18:08:30 -0500
Subject: Finish implementing setting system

---
 extension/src/RadioButtonGroup.tsx | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

(limited to 'extension/src/RadioButtonGroup.tsx')

diff --git a/extension/src/RadioButtonGroup.tsx b/extension/src/RadioButtonGroup.tsx
index 1e86e7e..12276dd 100644
--- a/extension/src/RadioButtonGroup.tsx
+++ b/extension/src/RadioButtonGroup.tsx
@@ -1,4 +1,4 @@
-import React, {ReactElement, ReactNode, useId, useState} from "react";
+import React, {ReactElement, useEffect, useId, useState} from "react";
 
 interface RadioProps {
     children: ReactElement<HTMLOptionElement>[],
@@ -8,7 +8,9 @@ interface RadioProps {
 
 function RadioButtonGroup(props: RadioProps) {
     const [selected, setSelected] = useState(props.defaultValue);
-    props.onChange && props.onChange(selected);
+    useEffect(() => {
+        props.onChange && props.onChange(selected);
+    }, [selected])
 
     return (
         <div className="radio-group">
@@ -28,18 +30,4 @@ function RadioButtonGroup(props: RadioProps) {
     )
 }
 
-export default RadioButtonGroup
-
-//     <h3>Sort</h3>
-//     <label>
-//         <input type="radio" name="sort"/>
-//         From bookmarks
-//     </label>
-//     <label>
-//         <input type="radio" name="sort"/>
-//         Alphabetical
-//     </label>
-//     <label>
-//         <input type="radio" name="sort"/>
-//         Frequency
-//     </label>
\ No newline at end of file
+export default RadioButtonGroup
\ No newline at end of file
-- 
cgit v1.2.3

