mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 18:50:49 +08:00
fix(ProviderNav): remove unused provider icons and clean up code
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
import { ReactNode, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
||||
import {
|
||||
ReactNode,
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useLayoutEffect,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { useLocation, type Location } from 'react-router-dom';
|
||||
import gsap from 'gsap';
|
||||
import './PageTransition.scss';
|
||||
@@ -31,6 +39,16 @@ type TransitionDirection = 'forward' | 'backward';
|
||||
|
||||
type TransitionVariant = 'vertical' | 'ios';
|
||||
|
||||
type PageTransitionLayerContextValue = {
|
||||
status: LayerStatus;
|
||||
};
|
||||
|
||||
const PageTransitionLayerContext = createContext<PageTransitionLayerContextValue | null>(null);
|
||||
|
||||
export function usePageTransitionLayer() {
|
||||
return useContext(PageTransitionLayerContext);
|
||||
}
|
||||
|
||||
export function PageTransition({
|
||||
render,
|
||||
getRouteOrder,
|
||||
@@ -363,7 +381,9 @@ export function PageTransition({
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{render(layer.location)}
|
||||
<PageTransitionLayerContext.Provider value={{ status: layer.status }}>
|
||||
{render(layer.location)}
|
||||
</PageTransitionLayerContext.Provider>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user