From b43a09d6d86a75ebaf6ff89473364975870cd132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=98=81?= <77565980+abyss-s@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:23:08 +0900 Subject: [PATCH] refactor: Prevent Unrecognized DOM Prop Warning for showAbove in ModelSelect --- gui/src/components/modelSelection/ModelSelect.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/src/components/modelSelection/ModelSelect.tsx b/gui/src/components/modelSelection/ModelSelect.tsx index 8ce270663..464bdd505 100644 --- a/gui/src/components/modelSelection/ModelSelect.tsx +++ b/gui/src/components/modelSelection/ModelSelect.tsx @@ -61,7 +61,7 @@ const StyledListboxButton = styled(Listbox.Button)` } `; -const StyledListboxOptions = styled(Listbox.Options)<{ showAbove: boolean }>` +const StyledListboxOptions = styled(Listbox.Options)<{ $showabove: boolean }>` margin-top: 4px; position: absolute; list-style: none; @@ -81,7 +81,7 @@ const StyledListboxOptions = styled(Listbox.Options)<{ showAbove: boolean }>` scrollbar-width: none; - ${(props) => (props.showAbove ? "bottom: 100%;" : "top: 100%;")} + ${(props) => (props.$showabove ? "bottom: 100%;" : "top: 100%;")} `; const StyledListboxOption = styled(Listbox.Option)<{ isDisabled?: boolean }>` @@ -220,7 +220,7 @@ function ModelSelect() { (state: RootState) => state.state.config.models, ); const ideMessenger = useContext(IdeMessengerContext); - const [showAbove, setShowAbove] = useState(false); + const [$showabove, set$showabove] = useState(false); const buttonRef = useRef(null); const [options, setOptions] = useState([]); const [sortedOptions, setSortedOptions] = useState([]); @@ -281,7 +281,7 @@ function ModelSelect() { const spaceAbove = rect.top; const dropdownHeight = MAX_HEIGHT_PX; - setShowAbove(spaceBelow < dropdownHeight && spaceAbove > spaceBelow); + set$showabove(spaceBelow < dropdownHeight && spaceAbove > spaceBelow); } function onClickAddModel(e) { @@ -330,7 +330,7 @@ function ModelSelect() {