feat: add my tasks list view
This commit is contained in:
@ -17,7 +17,7 @@ import {
|
||||
} from './Styles';
|
||||
|
||||
function getPopupOptions(options?: PopupOptions) {
|
||||
const popupOptions = {
|
||||
const popupOptions: PopupOptionsInternal = {
|
||||
borders: true,
|
||||
diamondColor: theme.colors.bg.secondary,
|
||||
targetPadding: '10px',
|
||||
@ -40,6 +40,9 @@ function getPopupOptions(options?: PopupOptions) {
|
||||
if (options.diamondColor) {
|
||||
popupOptions.diamondColor = options.diamondColor;
|
||||
}
|
||||
if (options.onClose) {
|
||||
popupOptions.onClose = options.onClose;
|
||||
}
|
||||
}
|
||||
return popupOptions;
|
||||
}
|
||||
@ -136,6 +139,7 @@ type PopupOptionsInternal = {
|
||||
targetPadding: string;
|
||||
diamondColor: string;
|
||||
showDiamond: boolean;
|
||||
onClose?: () => void;
|
||||
};
|
||||
|
||||
type PopupOptions = {
|
||||
@ -144,6 +148,7 @@ type PopupOptions = {
|
||||
width?: number | null;
|
||||
borders?: boolean | null;
|
||||
diamondColor?: string | null;
|
||||
onClose?: () => void;
|
||||
};
|
||||
const defaultState = {
|
||||
isOpen: false,
|
||||
@ -239,7 +244,12 @@ export const PopupProvider: React.FC = ({ children }) => {
|
||||
top={currentState.top}
|
||||
targetPadding={currentState.options.targetPadding}
|
||||
left={currentState.left}
|
||||
onClose={() => setState(defaultState)}
|
||||
onClose={() => {
|
||||
if (currentState.options && currentState.options.onClose) {
|
||||
currentState.options.onClose();
|
||||
}
|
||||
setState(defaultState);
|
||||
}}
|
||||
width={currentState.options.width}
|
||||
>
|
||||
{currentState.content}
|
||||
|
Reference in New Issue
Block a user