-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Auto show mode for transfer buttons (#2000)
Transfer buttons now show as per Ishtar Commander. They remember if they were open or minimised from the last use.
- Loading branch information
1 parent
d91c3d1
commit 2f76643
Showing
3 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { IStore } from "@/app/store/GGStore.ts"; | ||
import type { StateCreator } from "zustand"; | ||
|
||
export type SettingsSliceSetter = Parameters<StateCreator<IStore, [], [], SettingsSlice>>[0]; | ||
export type SettingsSliceGetter = Parameters<StateCreator<IStore, [], [], SettingsSlice>>[1]; | ||
|
||
enum ShowBottomSheetPreference { | ||
Auto = "AUTOMATIC", | ||
AlwaysShowing = "ALWAYS_SHOWING", | ||
AlwaysMinimized = "ALWAYS_MINIMIZED", | ||
} | ||
|
||
export enum ShowBottomSheet { | ||
show = "show", | ||
minimize = "minimize", | ||
} | ||
|
||
export interface SettingsSlice { | ||
showBottomSheetPreference: ShowBottomSheetPreference; | ||
showNextBottomSheet: ShowBottomSheet; | ||
setShowBottomSheet: (showBottomSheet: ShowBottomSheet) => void; | ||
} | ||
|
||
export const createSettingsSlice: StateCreator<IStore, [], [], SettingsSlice> = (set, get) => ({ | ||
showBottomSheetPreference: ShowBottomSheetPreference.Auto, | ||
showNextBottomSheet: ShowBottomSheet.show, | ||
setShowBottomSheet: (showBottomSheet: ShowBottomSheet) => { | ||
if (get().showBottomSheetPreference === ShowBottomSheetPreference.Auto) | ||
set({ showNextBottomSheet: showBottomSheet }); | ||
}, | ||
}); |