Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
Signed-off-by: Mayursinh Sarvaiya <[email protected]>
  • Loading branch information
Marvin9 committed Dec 16, 2024
1 parent 77905f3 commit 75a56be
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion ui/src/features/auth/protected-route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { transport, transportWithAuth } from '@ui/config/transport';
import { PromotionDirectivesRegistryContextProvider } from '@ui/features/promotion-directives/registry/context/registry-context-provider';
import { getPublicConfig } from '@ui/gen/service/v1alpha1/service-KargoService_connectquery';

import { ModalContextProvider } from '../common/modal/modal-context';
import { ModalContextProvider } from '../common/modal/modal-context-provider';

import { useAuthContext } from './context/use-auth-context';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,8 @@ import { delay } from '@ui/utils/delay';

import { Portal } from '../portal';

export interface ModalComponentProps {
hide: () => void;
visible: boolean;
}

export type ModalComponent = React.FC<ModalComponentProps>;

type ModalItem = {
component: ModalComponent;
visible: boolean;
};

interface ModalContextValue {
show: (key: string, element: ModalComponent) => void;
hide: (key: string) => void;
}
import { ModalComponent, ModalContext, ModalItem } from './modal-context';

export const ModalContext = React.createContext<ModalContextValue | null>(null);
interface ModalProviderProps {
children: React.ReactNode;
container: HTMLElement | null;
Expand Down
20 changes: 20 additions & 0 deletions ui/src/features/common/modal/modal-context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';

export type ModalItem = {
component: ModalComponent;
visible: boolean;
};

export interface ModalContextValue {
show: (key: string, element: ModalComponent) => void;
hide: (key: string) => void;
}

export const ModalContext = React.createContext<ModalContextValue | null>(null);

export interface ModalComponentProps {
hide: () => void;
visible: boolean;
}

export type ModalComponent = React.FC<ModalComponentProps>;

0 comments on commit 75a56be

Please sign in to comment.