Skip to content

Commit 624468d

Browse files
committed
fix button
1 parent 27671b7 commit 624468d

File tree

8 files changed

+43
-50
lines changed

8 files changed

+43
-50
lines changed

src/components/Conf/Button/index.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
import React from "react"
1+
import React, { ReactElement, ReactNode } from "react"
2+
import { clsx } from "clsx"
23

3-
interface Props {
4-
text: React.ReactNode
4+
interface ButtonProps {
5+
children: ReactNode
56
className?: string
67
href?: string
7-
target?: string
8-
onWhiteBg?: boolean
98
}
109

11-
const ButtonConf = ({ text, href, target, className, onWhiteBg }: Props) => {
10+
function ButtonConf({ href, className, children }: ButtonProps): ReactElement {
1211
return (
1312
<a
14-
className={
15-
`block cursor-pointer transition ease-in-out no-underline inline-flex text-center w-[fit-content] border-0 py-2 px-6 no-underline hover:no-underline focus:outline-none hover:drop-shadow-md hover:[transform:scale(1.05)] rounded text-sm sm:text-base font-medium whitespace-nowrap ${onWhiteBg ? "bg-[#B48EF1] text-white" : "bg-white text-black"
16-
} ${className ?? ""}`
17-
}
13+
className={clsx(
14+
"cursor-pointer transition ease-in-out no-underline inline-flex text-center w-[fit-content] border-0 py-2 px-6 no-underline hover:no-underline focus:outline-none hover:drop-shadow-md hover:[transform:scale(1.05)] rounded text-sm sm:text-base whitespace-nowrap",
15+
"bg-[--rhodamine] text-white",
16+
className
17+
)}
1818
href={href}
19-
target={target}
19+
{...(href?.startsWith("https://") && {
20+
target: "_blank",
21+
rel: "noreferrer",
22+
})}
2023
>
21-
{text}
24+
{children}
2225
</a>
2326
)
2427
}

src/components/Conf/Header/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ const HeaderConf = () => {
3434
</a>
3535
))}
3636
<ButtonConf
37-
text="Buy a Ticket!"
3837
href="https://cvent.me/4zbxz9"
39-
target="_blank"
4038
className="ml-auto max-sm:hidden"
41-
/>
39+
>
40+
Buy a Ticket!
41+
</ButtonConf>
4242
</div>
4343
</header>
4444
)

src/components/Conf/Pricing/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,9 @@ const PricingConf = () => {
7878
))}
7979
</div>
8080
<div className="my-8 flex justify-center">
81-
<ButtonConf
82-
text="Buy a Ticket!"
83-
href="https://cvent.me/4zbxz9"
84-
target="_blank"
85-
/>
81+
<ButtonConf href="https://cvent.me/4zbxz9">
82+
Buy a Ticket!
83+
</ButtonConf>
8684
</div>
8785
<div className="w-full">
8886
<div className="mx-auto flex flex-col items-center text-center">

src/components/Conf/Speakers/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ const SpeakersConf = () => {
8989
<div className="my-8">
9090
<ButtonConf
9191
className="mx-auto"
92-
text="Submit to Speak"
9392
href="/conf/speak/"
94-
/>
93+
>
94+
Submit to Speak
95+
</ButtonConf>
9596
</div>
9697
</div>
9798
</div>

src/pages/conf/faq.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -650,12 +650,9 @@ const faq: Array<{ id: string; title: string; contents: ReactNode }> = [
650650
<li>Application Deadline — Friday, July 21, 2023 11:59 PM PST</li>
651651
<li>Notifications — Week of August 7, 2023</li>
652652
</ul>
653-
<ButtonConf
654-
onWhiteBg
655-
text="Apply for a Scholarship"
656-
href="https://forms.gle/PwgWSTJ872Pce9XW6"
657-
target="_blank"
658-
/>
653+
<ButtonConf href="https://forms.gle/PwgWSTJ872Pce9XW6">
654+
Apply for a Scholarship
655+
</ButtonConf>
659656
</>
660657
),
661658
},

src/pages/conf/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export default () => {
3737
</div>
3838
</div>
3939
<div className="flex justify-center gap-4 flex-row">
40-
<ButtonConf text="Join as a Sponsor" href="/conf/sponsor/" />
41-
<ButtonConf text="Submit to Speak" href="/conf/speak/" />
40+
<ButtonConf href="/conf/sponsor/">Join as a Sponsor</ButtonConf>
41+
<ButtonConf href="/conf/speak/">Submit to Speak</ButtonConf>
4242
</div>
4343
</div>
4444
</div>

src/pages/conf/speak.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,9 @@ export default () => {
297297
</a>
298298
.
299299
</p>
300-
<ButtonConf
301-
onWhiteBg
302-
text="Submit a Proposal"
303-
href="https://sessionize.com/graphqlconf2023/"
304-
target="_blank"
305-
/>
300+
<ButtonConf href="https://sessionize.com/graphqlconf2023/">
301+
Submit a Proposal
302+
</ButtonConf>
306303
</section>
307304
<ul className="md:columns-2 max-lg:p-0 max-lg:m-0 list-none">
308305
{cfp.map(q => (

src/pages/conf/sponsor.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,25 @@ export default () => {
1313
<div className="container flex py-16 items-center justify-center flex-col">
1414
<div className="flex flex-col items-center w-full">
1515
<div className="sm:text-3xl text-2xl mb-8 text-white text-center leading-relaxed">
16-
<span className="block lg:inline">
17-
Sponsor GraphQLConf 2023
18-
</span>
16+
<span className="block lg:inline">Sponsor GraphQLConf 2023</span>
1917
</div>
2018
<div className="flex justify-center items-center gap-4 flex-col sm:flex-row">
21-
<ButtonConf
22-
text="Explore Sponsorship"
23-
target="_blank"
24-
href="https://events.linuxfoundation.org/wp-content/uploads/2023/03/sponsor_GraphQLConf_2023_032423.pdf"
25-
/>
26-
<ButtonConf
27-
text="Contact Us"
28-
target="_blank"
29-
href="mailto:graphqlconf@graphql.org?subject=Sponsorships"
30-
/>
19+
<ButtonConf href="https://events.linuxfoundation.org/wp-content/uploads/2023/03/sponsor_GraphQLConf_2023_032423.pdf">
20+
Explore Sponsorship
21+
</ButtonConf>
22+
<ButtonConf href="mailto:graphqlconf@graphql.org?subject=Sponsorships">
23+
Contact Us
24+
</ButtonConf>
3125
</div>
3226
</div>
3327
<div className="mx-auto max-w-prose mt-8">
3428
<div className="text-black h-full bg-gray-100 bg-opacity-75 p-8 rounded-lg overflow-hidden relative">
3529
<p>
3630
Contact us at{" "}
37-
<a className="font-medium" href="mailto:graphqlconf@graphql.org">
31+
<a
32+
className="font-medium"
33+
href="mailto:graphqlconf@graphql.org"
34+
>
3835
graphqlconf@graphql.org
3936
</a>{" "}
4037
to reserve your sponsorship, ask questions or talk about

0 commit comments

Comments
 (0)