Skip to content

Commit

Permalink
Feat: hide Filter component #24
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Jun 27, 2024
1 parent af0d1da commit 13014c7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const SubMenuItems = ({ variables, readOnly }: Props) => {
const [visibleVariables, setVisibleVariables] = useState<TypedVariableModel[]>([]);

useEffect(() => {
setVisibleVariables(variables.filter((state) => state.hide !== VariableHide.hideVariable));
// render first(OptionDropdown) only
setVisibleVariables(variables.filter((state) => state.hide !== VariableHide.hideVariable).slice(0, 1));
}, [variables]);

if (visibleVariables.length === 0) {
Expand Down

0 comments on commit 13014c7

Please sign in to comment.