New source found from dndbeyond.com
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { isEqual } from "lodash";
|
||||
import { createContext, FC, useContext, useEffect, useState } from "react";
|
||||
import {
|
||||
createContext,
|
||||
FC,
|
||||
PropsWithChildren,
|
||||
useContext,
|
||||
useEffect,
|
||||
useState,
|
||||
} from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
import {
|
||||
@@ -39,6 +46,7 @@ export interface PaneInfo {
|
||||
) => void;
|
||||
paneHistoryPrevious: () => void;
|
||||
paneHistoryNext: () => void;
|
||||
resetActivePane: () => void;
|
||||
}
|
||||
|
||||
export interface SidebarContextType {
|
||||
@@ -48,7 +56,7 @@ export interface SidebarContextType {
|
||||
|
||||
export const SidebarContext = createContext<SidebarContextType>(null!);
|
||||
|
||||
export const SidebarProvider: FC = ({ children }) => {
|
||||
export const SidebarProvider: FC<PropsWithChildren> = ({ children }) => {
|
||||
const isMobile = useSelector(appEnvSelectors.getIsMobile);
|
||||
const sheetDimensions = useSelector(appEnvSelectors.getDimensions);
|
||||
|
||||
@@ -64,6 +72,8 @@ export const SidebarProvider: FC = ({ children }) => {
|
||||
|
||||
const width: number = 340;
|
||||
|
||||
const resetActivePane = () => setActivePane(null);
|
||||
|
||||
//Create a new pane history
|
||||
const paneHistoryStart = (
|
||||
type: PaneComponentEnum,
|
||||
@@ -161,6 +171,7 @@ export const SidebarProvider: FC = ({ children }) => {
|
||||
paneHistoryPush,
|
||||
paneHistoryPrevious,
|
||||
paneHistoryNext,
|
||||
resetActivePane,
|
||||
},
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user