Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions __tests__/pages/discord/__snapshots__/connect.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`connect to Discord page should render page 1`] = `
<div>
<div
class="row mt-5"
>
<div
class="card shadow-sm col-sm-8 col-md-7 col-lg-6 col-xl-6 m-auto px-md-5 border-0"
>
<div
class="card-body text-center pt-5 pb-5"
>
<h1
class="card-title h2 font-weight-bold mb-5"
>
Connect to Discord
</h1>
<p
class="card-text"
/>
<div
class="mt-3"
>
<p>
Please

<a
class="button"
href="https://discord.com/api/oauth2/authorize?client_id=845470281283665970&redirect_uri=https%3A%2F%2Fc0d3.com%2Fapi%2Fauth%2Fcallback%2Fdiscord&response_type=code&scope=identify%20email%20guilds.join%20gdm.join"
>
connect your Discord account
</a>
, or create one if you don't already have one. Our students and mentors use Discord to communicate and help each other, give you feedback on your challenges, and sometimes do virtual hangouts.
</p>
<p>
If you don't want to connect to Discord, then you won't get any value out of creating an account on C0D3.com. Feel free to browse our lessons and study on your own!
</p>
<p>
Also, if you would like to share your reasons for not using Discord, we'd love to hear about it! Your thoughts will help us make more informed decisions about our community platform and if the reasons are compelling enough, may inspire us to switch to an alternative.
</p>
</div>
<button
class="btn btn-primary btn-lg btn-block mb-3"
href="https://discord.com/api/oauth2/authorize?client_id=845470281283665970&redirect_uri=https%3A%2F%2Fc0d3.com%2Fapi%2Fauth%2Fcallback%2Fdiscord&response_type=code&scope=identify%20email%20guilds.join%20gdm.join"
type="button"
>
Connect Now
</button>
<a
class=""
href="/curriculum"
>
No thanks, I'll study on my own.

</a>
</div>
</div>
</div>
</div>
`;
10 changes: 10 additions & 0 deletions __tests__/pages/discord/connect.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import ConnectToDiscordPage from '../../../pages/discord/connect'
import { render } from '@testing-library/react'

describe('connect to Discord page', () => {
it('should render page', () => {
const { container } = render(<ConnectToDiscordPage />)
expect(container).toMatchSnapshot()
})
})
58 changes: 58 additions & 0 deletions pages/discord/connect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react'
import { WithLayout } from '../../@types/page'
import { getLayout } from '../../components/Layout'
import Title from '../../components/Title'
import Card from '../../components/Card'
import NavLink from '../../components/NavLink'
import Link from 'next/link'

const discordConnectPage =
'https://discord.com/api/oauth2/authorize?client_id=845470281283665970&redirect_uri=https%3A%2F%2Fc0d3.com%2Fapi%2Fauth%2Fcallback%2Fdiscord&response_type=code&scope=identify%20email%20guilds.join%20gdm.join'

const ConnectToDiscordPage: React.FC & WithLayout = () => {
return (
<>
<Title title="Connect to Discord" />
<Card title="Connect to Discord">
<div className="mt-3">
<p>
Please{' '}
<a href={discordConnectPage} className="button">
connect your Discord account
</a>
, or create one if you don&apos;t already have one. Our students and
mentors use Discord to communicate and help each other, give you
feedback on your challenges, and sometimes do virtual hangouts.
</p>
<p>
If you don&apos;t want to connect to Discord, then you won&apos;t
get any value out of creating an account on C0D3.com. Feel free to
browse our lessons and study on your own!
</p>
<p>
Also, if you would like to share your reasons for not using Discord,
we&apos;d love to hear about it! Your thoughts will help us make
more informed decisions about our community platform and if the
reasons are compelling enough, may inspire us to switch to an
alternative.
</p>
</div>
<Link href={discordConnectPage} passHref>
<button
type="button"
className="btn btn-primary btn-lg btn-block mb-3"
>
Connect Now
</button>
</Link>
<NavLink path="/curriculum">
No thanks, I&apos;ll study on my own.{' '}
</NavLink>
</Card>
</>
)
}

ConnectToDiscordPage.getLayout = getLayout

export default ConnectToDiscordPage