diff --git a/package.json b/package.json index 57da7dc..f8929ef 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-navigation-menu": "^1.1.4", + "@radix-ui/react-popover": "^1.0.7", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4967e2a..0e4c944 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ dependencies: '@radix-ui/react-navigation-menu': specifier: ^1.1.4 version: 1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-popover': + specifier: ^1.0.7 + version: 1.0.7(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-select': specifier: ^2.0.0 version: 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) @@ -692,6 +695,41 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false + /@radix-ui/react-popover@1.0.7(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.23.9 + '@radix-ui/primitive': 1.0.1 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.55)(react@18.2.0) + '@radix-ui/react-context': 1.0.1(@types/react@18.2.55)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.2.55)(react@18.2.0) + '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-id': 1.0.1(@types/react@18.2.55)(react@18.2.0) + '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.0.2(@types/react@18.2.55)(react@18.2.0) + '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.55)(react@18.2.0) + '@types/react': 18.2.55 + '@types/react-dom': 18.2.19 + aria-hidden: 1.2.3 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-remove-scroll: 2.5.5(@types/react@18.2.55)(react@18.2.0) + dev: false + /@radix-ui/react-popper@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==} peerDependencies: diff --git a/src/app/exhibitor/_components/CompanySubmissionPopover.tsx b/src/app/exhibitor/_components/CompanySubmissionPopover.tsx new file mode 100644 index 0000000..8aae295 --- /dev/null +++ b/src/app/exhibitor/_components/CompanySubmissionPopover.tsx @@ -0,0 +1,124 @@ +"use client" +import { Button } from "@/components/ui/button" +import * as Popover from "@radix-ui/react-popover" +import axios from "axios" +import { NavigationIcon, X } from "lucide-react" +import { useState } from "react" + +export function CompanySubmissionPopover() { + const [name, setName] = useState("") + const [email, setEmail] = useState("") + const [company, setCompany] = useState("") + const [question, setQuestion] = useState("") + + const sendMessage = () => { + const message = { + text: ` + *Name:* ${name} + *Email:* ${email} + *Company:* ${company} + *Question:* ${question} + ` + } + axios + .post("https://slack.com/api/chat.postMessage", message, { + headers: { + "Content-Type": "application/json", + Authorization: + "xoxe.xoxp-1-Mi0yLTY5MTAzOTUwMDgxMzAtNjk1OTQwNDEwOTAyOC03MDg4NjY5OTc2MDY1LTcwNzU4ODkyNTA0MzUtYmI3Y2UyNDFjZmVkNDlhMzkxNzcwYjIwMGNkNTY3NmVkODU1ZDBkYTlmYzUxMTIyYTk0MmNkZGNhNGU2MWFkMA" + } + }) + .then(response => { + console.log("Message sent successfully:", response.data) + // Reset form fields + setName("") + setEmail("") + setCompany("") + setQuestion("") + }) + .catch(error => { + console.error("Error sending message:", error) + }) + } + + return ( +
+ + + + + +
+
+

Contact

+
+ + setName(e.target.value)} + placeholder="Your name" + /> +
+
+ + setEmail(e.target.value)} + placeholder="Your email" + /> +
+
+ + setCompany(e.target.value)} + placeholder="Your company" + /> +
+
+ +