Skip to content

Commit 67ed5f9

Browse files
authored
add conf/attendee page (graphql#1544)
1 parent 31deb85 commit 67ed5f9

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"develop": "gatsby develop",
88
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
99
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,md}\"",
10-
"start": "npm run develop",
10+
"start": "yarn develop",
1111
"serve": "gatsby serve",
1212
"clean": "gatsby clean",
1313
"lint": "eslint --ignore-path .gitignore .",
@@ -67,4 +67,4 @@
6767
"tailwindcss": "3.3.2",
6868
"typescript": "5.1.3"
6969
}
70-
}
70+
}

src/pages/conf/attendee.tsx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import React from "react"
2+
import LayoutConf from "../../components/Conf/Layout"
3+
import HeaderConf from "../../components/Conf/Header"
4+
// import ButtonConf from "../../components/Conf/Button"
5+
import clsx from "clsx"
6+
import { PageProps, HeadProps } from "gatsby"
7+
import SeoConf from "../../components/Conf/Seo"
8+
import { useLocation } from "@reach/router"
9+
10+
export default (_props: PageProps) => {
11+
const { href, search } = useLocation()
12+
// const text = "Nice! I got my @GraphQLConf ticket! Get yours too!"
13+
return (
14+
<LayoutConf>
15+
<HeaderConf />
16+
<div className="bg-white h-screen">
17+
<div className="prose lg:prose-lg mx-auto py-10 max-sm:px-4">
18+
<h1>Your ticket for GraphQLConf</h1>
19+
<section className="px-0 my-8">
20+
<div className="flex gap-4 flex-row flex-wrap">
21+
{/*<ButtonConf*/}
22+
{/* href={`https://twitter.com/intent/tweet?url=${href}&text=${text}`}*/}
23+
{/*>*/}
24+
{/* Share on X / Twitter*/}
25+
{/*</ButtonConf>*/}
26+
<button
27+
className={clsx(
28+
"cursor-pointer transition ease-in-out no-underline inline-flex text-center w-[fit-content] border-0 py-2 px-6 focus:outline-none hover:drop-shadow-md hover:[transform:scale(1.05)] rounded text-sm sm:text-base whitespace-nowrap",
29+
"bg-[--rhodamine] text-white font-medium"
30+
)}
31+
onClick={async () => {
32+
try {
33+
await navigator.clipboard.writeText(href)
34+
console.log("Content copied to clipboard")
35+
} catch (err) {
36+
console.error("Failed to copy:", err)
37+
}
38+
}}
39+
>
40+
Share URL
41+
</button>
42+
</div>
43+
</section>
44+
</div>
45+
<img
46+
src={`https://og-image.the-guild.dev/conf${search}`}
47+
className="block mx-auto"
48+
/>
49+
</div>
50+
</LayoutConf>
51+
)
52+
}
53+
54+
export function Head(_props: HeadProps) {
55+
const { search } = useLocation()
56+
return (
57+
<SeoConf
58+
title="My ticket"
59+
ogImage={{
60+
url: `https://og-image.the-guild.dev/conf${search}`,
61+
width: 1200,
62+
height: 600,
63+
}}
64+
/>
65+
)
66+
}

0 commit comments

Comments
 (0)