Refactor <Dropdown> into TypeScript (#34357)

Co-authored-by: Echo <ChaosExAnima@users.noreply.github.com>
This commit is contained in:
Eugen Rochko 2025-04-08 21:22:19 +02:00 committed by GitHub
parent b7c3235349
commit 22d33244ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 846 additions and 654 deletions

View file

@ -3,15 +3,15 @@ import { createReducer } from '@reduxjs/toolkit';
import { closeDropdownMenu, openDropdownMenu } from '../actions/dropdown_menu';
interface DropdownMenuState {
openId: string | null;
openId: number | null;
keyboard: boolean;
scrollKey: string | null;
scrollKey: string | undefined;
}
const initialState: DropdownMenuState = {
openId: null,
keyboard: false,
scrollKey: null,
scrollKey: undefined,
};
export const dropdownMenuReducer = createReducer(initialState, (builder) => {
@ -27,7 +27,7 @@ export const dropdownMenuReducer = createReducer(initialState, (builder) => {
.addCase(closeDropdownMenu, (state, { payload: { id } }) => {
if (state.openId === id) {
state.openId = null;
state.scrollKey = null;
state.scrollKey = undefined;
}
});
});