diff --git a/frontend/src/components/AppModal.jsx b/frontend/src/components/AppModal.jsx new file mode 100644 index 00000000..d2de9d74 --- /dev/null +++ b/frontend/src/components/AppModal.jsx @@ -0,0 +1,311 @@ +import React from 'react'; +import { + Dialog, + DialogTitle, + DialogContent, + IconButton, + Typography, + Box, + Button, + Stack, + Avatar, +} from '@mui/material'; + +import CloseIcon from '@mui/icons-material/Close'; +import EditIcon from '@mui/icons-material/Edit'; +import ForkRightIcon from '@mui/icons-material/ForkRight'; +import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import LaunchIcon from '@mui/icons-material/Launch'; +import CheckCircleIcon from '@mui/icons-material/CheckCircle'; +import { CloudDownloadOutlined } from '@mui/icons-material'; + +const AppModal = ({ open, onClose, data, userdata }) => { + + console.log("App data: ", data) + console.log("userdata: ", userdata) + + const isCloud = + window.location.host === "localhost:3002" || + window.location.host === "shuffler.io" || window.location.host === "localhost:3000" + ? true + : false; + + var newAppname = data?.name; + if (newAppname === undefined) { + newAppname = "Undefined"; + } else { + newAppname = newAppname.charAt(0).toUpperCase() + newAppname.substring(1); + newAppname = newAppname.replaceAll("_", " "); + } + + var canEditApp = userdata.admin === "true" || userdata.id === data?.owner || data?.owner === "" || (userdata.admin === "true" && userdata.active_org.id === data?.reference_org) || !data?.generated + + + return ( + + + + About Gmail + + + + + + + + + +
+ {data?.name} +
+
+ + {newAppname} + + { + isCloud && ( + + + + + + ) + } +
+ + {data?.categories ? data.categories.join(", ") : "Communication"} + +
+
+
+ + +
+
+ +
+
+ + 20 + + + Public Workflow + +
+
+ + {data?.actions?.length} + + + Actions + +
+
+
+ + + Google Collection + +
+ + Part of a collection + +
+
+ +
+
+ Connect Gmail to Jira +
+ + + + + + + + Email management + + +
+ +
+ +
+
+
+ ); +}; + +export default AppModal; \ No newline at end of file diff --git a/frontend/src/views/Apps2.jsx b/frontend/src/views/Apps2.jsx index 079d4b2e..01d9ad26 100644 --- a/frontend/src/views/Apps2.jsx +++ b/frontend/src/views/Apps2.jsx @@ -25,6 +25,7 @@ import { toast } from "react-toastify"; import algoliasearch from "algoliasearch/lite"; import { debounce } from "lodash"; import AppSelection from "../components/AppSelection.jsx"; +import AppModal from "../components/AppModal.jsx"; const searchClient = algoliasearch( @@ -33,7 +34,7 @@ const searchClient = algoliasearch( ); // AppCard Component -const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl, deactivatedIndexes, currTab }) => { +const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl, deactivatedIndexes, currTab, handleAppClick }) => { const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io" || window.location.host === "localhost:3000"; const appUrl = isCloud ? `/apps/${data.id}` : `https://shuffler.io/apps/${data.id}`; @@ -51,12 +52,12 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl, return ( - setMouseHoverIndex(index)} + setMouseHoverIndex(index)} onMouseOut={() => setMouseHoverIndex(-1)} > - {/* Deactivate button */} {currTab === 0 && !deactivatedIndexes.includes(index) && mouseHoverIndex === index && data.generated === true && ( -