Fixed button inside button on sidebar
This commit is contained in:
parent
f0f5887452
commit
7d04a98f68
3 changed files with 29 additions and 13 deletions
|
|
@ -34,8 +34,8 @@ export function AuthProvider({ children }): React.ReactElement {
|
||||||
cookies.get("refresh_tkn_lflw")
|
cookies.get("refresh_tkn_lflw")
|
||||||
);
|
);
|
||||||
const [isAuthenticated, setIsAuthenticated] = useState<boolean>(
|
const [isAuthenticated, setIsAuthenticated] = useState<boolean>(
|
||||||
cookies.get("refresh_tkn_lflw") && cookies.get("access_tkn_lflw")
|
!!cookies.get("refresh_tkn_lflw") && !!cookies.get("access_tkn_lflw")
|
||||||
);
|
);
|
||||||
const [isAdmin, setIsAdmin] = useState<boolean>(false);
|
const [isAdmin, setIsAdmin] = useState<boolean>(false);
|
||||||
const [userData, setUserData] = useState<Users | null>(null);
|
const [userData, setUserData] = useState<Users | null>(null);
|
||||||
const [autoLogin, setAutoLogin] = useState<boolean>(false);
|
const [autoLogin, setAutoLogin] = useState<boolean>(false);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ const ExportModal = forwardRef(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseModal size="smaller-h-full" open={open} setOpen={setOpen}>
|
<BaseModal size="smaller-h-full" open={open} setOpen={setOpen}>
|
||||||
<BaseModal.Trigger>{props.children}</BaseModal.Trigger>
|
<BaseModal.Trigger asChild>{props.children}</BaseModal.Trigger>
|
||||||
<BaseModal.Header description={EXPORT_DIALOG_SUBTITLE}>
|
<BaseModal.Header description={EXPORT_DIALOG_SUBTITLE}>
|
||||||
<span className="pr-2">Export</span>
|
<span className="pr-2">Export</span>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { cloneDeep } from "lodash";
|
import { cloneDeep } from "lodash";
|
||||||
import { useContext, useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import ShadTooltip from "../../../../components/ShadTooltipComponent";
|
import ShadTooltip from "../../../../components/ShadTooltipComponent";
|
||||||
import IconComponent from "../../../../components/genericIconComponent";
|
import IconComponent from "../../../../components/genericIconComponent";
|
||||||
import { Input } from "../../../../components/ui/input";
|
import { Input } from "../../../../components/ui/input";
|
||||||
|
|
@ -9,7 +9,9 @@ import ExportModal from "../../../../modals/exportModal";
|
||||||
import ShareModal from "../../../../modals/shareModal";
|
import ShareModal from "../../../../modals/shareModal";
|
||||||
import useAlertStore from "../../../../stores/alertStore";
|
import useAlertStore from "../../../../stores/alertStore";
|
||||||
import useFlowStore from "../../../../stores/flowStore";
|
import useFlowStore from "../../../../stores/flowStore";
|
||||||
|
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
|
||||||
import { useStoreStore } from "../../../../stores/storeStore";
|
import { useStoreStore } from "../../../../stores/storeStore";
|
||||||
|
import { useTypesStore } from "../../../../stores/typesStore";
|
||||||
import { APIClassType, APIObjectType } from "../../../../types/api";
|
import { APIClassType, APIObjectType } from "../../../../types/api";
|
||||||
import {
|
import {
|
||||||
nodeColors,
|
nodeColors,
|
||||||
|
|
@ -23,8 +25,6 @@ import {
|
||||||
} from "../../../../utils/utils";
|
} from "../../../../utils/utils";
|
||||||
import DisclosureComponent from "../DisclosureComponent";
|
import DisclosureComponent from "../DisclosureComponent";
|
||||||
import SidebarDraggableComponent from "./sideBarDraggableComponent";
|
import SidebarDraggableComponent from "./sideBarDraggableComponent";
|
||||||
import { useTypesStore } from "../../../../stores/typesStore";
|
|
||||||
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
|
|
||||||
|
|
||||||
export default function ExtraSidebar(): JSX.Element {
|
export default function ExtraSidebar(): JSX.Element {
|
||||||
const data = useTypesStore((state) => state.data);
|
const data = useTypesStore((state) => state.data);
|
||||||
|
|
@ -229,11 +229,9 @@ export default function ExtraSidebar(): JSX.Element {
|
||||||
const ExportMemo = useMemo(
|
const ExportMemo = useMemo(
|
||||||
() => (
|
() => (
|
||||||
<ExportModal>
|
<ExportModal>
|
||||||
<ShadTooltip content="Export" side="top">
|
<button className={classNames("extra-side-bar-buttons")}>
|
||||||
<button className={classNames("extra-side-bar-buttons")}>
|
<IconComponent name="FileDown" className="side-bar-button-size" />
|
||||||
<IconComponent name="FileDown" className="side-bar-button-size" />
|
</button>
|
||||||
</button>
|
|
||||||
</ShadTooltip>
|
|
||||||
</ExportModal>
|
</ExportModal>
|
||||||
),
|
),
|
||||||
[]
|
[]
|
||||||
|
|
@ -274,7 +272,15 @@ export default function ExtraSidebar(): JSX.Element {
|
||||||
</button>
|
</button>
|
||||||
</ShadTooltip>
|
</ShadTooltip>
|
||||||
</div>
|
</div>
|
||||||
{(!hasApiKey || !validApiKey) && ExportMemo}
|
{(!hasApiKey || !validApiKey) && (
|
||||||
|
<ShadTooltip
|
||||||
|
content="Export"
|
||||||
|
side="top"
|
||||||
|
styleClasses="cursor-default"
|
||||||
|
>
|
||||||
|
<div className="side-bar-button">{ExportMemo}</div>
|
||||||
|
</ShadTooltip>
|
||||||
|
)}
|
||||||
<ShadTooltip content={"Code"} side="top">
|
<ShadTooltip content={"Code"} side="top">
|
||||||
<div className="side-bar-button">
|
<div className="side-bar-button">
|
||||||
{currentFlow && currentFlow.data && (
|
{currentFlow && currentFlow.data && (
|
||||||
|
|
@ -305,7 +311,17 @@ export default function ExtraSidebar(): JSX.Element {
|
||||||
(isPending ? "" : "button-disable")
|
(isPending ? "" : "button-disable")
|
||||||
}
|
}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
saveFlow({...currentFlow, data: {nodes, edges, viewport: reactFlowInstance?.getViewport()!} }, true);
|
saveFlow(
|
||||||
|
{
|
||||||
|
...currentFlow,
|
||||||
|
data: {
|
||||||
|
nodes,
|
||||||
|
edges,
|
||||||
|
viewport: reactFlowInstance?.getViewport()!,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue