diff --git a/package-lock.json b/package-lock.json index 5fa99c1e..2f2cf6c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@gliff-ai/curate": "^7.6.2", "@gliff-ai/etebase": "^0.44.0", "@gliff-ai/manage": "^8.0.0", - "@gliff-ai/style": "^16.2.1", + "@gliff-ai/style": "^16.3.1", "@gliff-ai/upload": "^1.3.0", "@material-ui/types": "^5.1.0", "@mui/icons-material": "^5.8.4", @@ -2155,9 +2155,9 @@ "integrity": "sha512-3l1S4fzDBR+uXkSl8PBKxj3zG4Rjgqolu/fRGoZyAqcgkDZ0AO66fi+gLDBherKuIKzJ+X7e4s1/oYzh7B4keg==" }, "node_modules/@gliff-ai/style": { - "version": "16.2.1", - "resolved": "https://registry.npmjs.org/@gliff-ai/style/-/style-16.2.1.tgz", - "integrity": "sha512-oCfi7M6JQ7qnKhI6PMtJfNtaZtQJEu/HD4TPt/q77s3HjMulBcLpFnaz02hPTpqwwtS1/aYv1LdMbKL5B6NaxQ==", + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/@gliff-ai/style/-/style-16.3.1.tgz", + "integrity": "sha512-1gN18JpUs1d50EKK2XHj/rlg/U8Vs0BG2VHZkW57U/ZLQ6I5JPdp84ipORyeXM5ldOjrbqBvuqAyVSAes4wXGg==", "dependencies": { "react-inlinesvg": "^2.3.0" }, @@ -15520,9 +15520,9 @@ "integrity": "sha512-3l1S4fzDBR+uXkSl8PBKxj3zG4Rjgqolu/fRGoZyAqcgkDZ0AO66fi+gLDBherKuIKzJ+X7e4s1/oYzh7B4keg==" }, "@gliff-ai/style": { - "version": "16.2.1", - "resolved": "https://registry.npmjs.org/@gliff-ai/style/-/style-16.2.1.tgz", - "integrity": "sha512-oCfi7M6JQ7qnKhI6PMtJfNtaZtQJEu/HD4TPt/q77s3HjMulBcLpFnaz02hPTpqwwtS1/aYv1LdMbKL5B6NaxQ==", + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/@gliff-ai/style/-/style-16.3.1.tgz", + "integrity": "sha512-1gN18JpUs1d50EKK2XHj/rlg/U8Vs0BG2VHZkW57U/ZLQ6I5JPdp84ipORyeXM5ldOjrbqBvuqAyVSAes4wXGg==", "requires": { "react-inlinesvg": "^2.3.0" } diff --git a/package.json b/package.json index 3905f841..0e8f77de 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@gliff-ai/curate": "^7.6.2", "@gliff-ai/etebase": "^0.44.0", "@gliff-ai/manage": "^8.0.0", - "@gliff-ai/style": "^16.2.1", + "@gliff-ai/style": "^16.3.1", "@gliff-ai/upload": "^1.3.0", "@material-ui/types": "^5.1.0", "@mui/icons-material": "^5.8.4", diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index 3dadeabb..86022202 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -15,8 +15,8 @@ import { Typography, } from "@gliff-ai/style"; import { imgSrc } from "@/imgSrc"; - import { useAuth } from "@/hooks/use-auth"; +import { getInitialsFromFullname } from "@/helpers"; import { ProductsNavbar, ProductNavbarData } from "@/components"; const documentButton = { @@ -147,10 +147,8 @@ export const NavBar = (props: Props): ReactElement | null => { useEffect(() => { if (!auth?.userProfile?.name) return; - const initials = auth?.userProfile?.name - .split(" ") - .map((l) => l[0].toUpperCase()) - .join(""); + + const initials = getInitialsFromFullname(auth?.userProfile?.name); setUserInitials(initials); }, [auth]); diff --git a/src/components/index.ts b/src/components/index.ts index 3fef5d07..60b9bad2 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -10,5 +10,6 @@ export { export { GliffCard } from "./GliffCard"; export { CookieConsent } from "./CookieConsent"; +export { ZooDialog } from "./zoo/ZooDialog"; export { ProductsNavbar } from "./ProductsNavbar"; export type { ProductNavbarData } from "./ProductsNavbar"; diff --git a/src/components/zoo/PluginsZooCard.tsx b/src/components/zoo/PluginsZooCard.tsx new file mode 100644 index 00000000..4584ea52 --- /dev/null +++ b/src/components/zoo/PluginsZooCard.tsx @@ -0,0 +1,147 @@ +import { ReactElement, useMemo } from "react"; +import { Plugin } from "@gliff-ai/manage"; +import { Divider, icons, MuiCard, Box, theme, Button } from "@gliff-ai/style"; +import { DialogActions } from "@mui/material"; +import SVG from "react-inlinesvg"; + +const InconText = ({ + icon, + text, + marginLeft = null, +}: { + icon: string; + text: string; + marginLeft?: string | null; +}) => ( +
+ + {text} +
+); + +InconText.defaultProps = { marginLeft: null }; + +interface Props { + data: Plugin; + isOpen: boolean; + openCard: () => void; + closeCard: () => void; + activatePlugin: (plugin: Plugin) => Promise; +} + +export const PluginsZooCard = ({ + data, + isOpen, + openCard, + closeCard, + activatePlugin, +}: Props): ReactElement => { + const scale = useMemo((): number => Number(isOpen) + 1, [isOpen]); + + return ( + +
+ +
+

Plugin: {data.name}

+ + {data?.author} + +
+
+ {!isOpen && ( + + {data.description} + + )} + + + + + + {isOpen && ( + {data.description} + )} + + +