Skip to content

Commit

Permalink
Merge pull request #132 from VampireChicken12/dev
Browse files Browse the repository at this point in the history
fix: importing old settings error
  • Loading branch information
VampireChicken12 authored Nov 30, 2023
2 parents 0a5570d + 55b20e7 commit 32cac8f
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 153 deletions.
6 changes: 2 additions & 4 deletions src/components/Inputs/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClassValue } from "clsx";
import type { ChangeEvent, Dispatch, SetStateAction } from "react";
import type { ChangeEvent } from "react";

import { useComponentVisible } from "@/hooks";
import { cn } from "@/src/utils/utilities";
Expand Down Expand Up @@ -28,11 +28,10 @@ export type SelectProps = {
onChange: (value: ChangeEvent<HTMLSelectElement>) => void;
options: SelectOption[];
selectedOption: string | undefined;
setSelectedOption: Dispatch<SetStateAction<string | undefined>>;
title: string;
};

const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChange, options, selectedOption, setSelectedOption }) => {
const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChange, options, selectedOption }) => {
const {
isComponentVisible: isSelectVisible,
ref: selectRef,
Expand All @@ -44,7 +43,6 @@ const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChang
};

const handleOptionSelect = (option: string) => {
setSelectedOption(option);
setIsSelectVisible(false);
onChange({ currentTarget: { value: option } } as ChangeEvent<HTMLSelectElement>);
};
Expand Down
Loading

0 comments on commit 32cac8f

Please sign in to comment.