-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
240 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,4 +107,4 @@ dist | |
client/build | ||
api/build | ||
package-lock.json | ||
prisma/src/ | ||
prisma/src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import React from "react"; | ||
import Image from "next/image"; | ||
|
||
import { Navbar, Nav, Badge } from "react-bootstrap"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faDiscord, faGithub } from "@fortawesome/free-brands-svg-icons"; | ||
import Link from "next/link"; | ||
|
||
import { signIn, signOut, useSession } from "next-auth/client"; | ||
import { faCheckCircle } from "@fortawesome/free-solid-svg-icons"; | ||
import styles from "./header.module.css"; | ||
|
||
const site_logo = "/assets/img/logo_animated.gif"; | ||
|
||
export default function Header() { | ||
const [session, loading] = useSession(); | ||
|
||
return ( | ||
<Navbar | ||
as="header" | ||
variant="dark" | ||
expand="lg" | ||
className={`${styles.header}`} | ||
> | ||
<Navbar.Toggle aria-controls="primary-navbar-nav" /> | ||
<Navbar.Brand> | ||
<Link href="/" passHref> | ||
<a> | ||
<img | ||
src={site_logo} | ||
className="d-inline-block align-top" | ||
alt="AutoMuteUs" | ||
width="50" | ||
height="50" | ||
/> | ||
</a> | ||
</Link> | ||
</Navbar.Brand> | ||
<Navbar.Collapse id="primary-navbar-nav"> | ||
<Nav className="mr-auto"> | ||
<Nav.Link href="https://discord.gg/vwWXs8Z" target="_blank"> | ||
Discord Support Server | ||
</Nav.Link> | ||
<Nav.Link href="https://github.com/denverquane/automuteus#commands"> | ||
Commands | ||
</Nav.Link> | ||
<Nav.Link href="https://youtu.be/kO4cqMKV2yI">Tutorials</Nav.Link> | ||
<Nav.Link | ||
href="https://github.com/denverquane/automuteus" | ||
target="_blank" | ||
> | ||
<FontAwesomeIcon icon={faGithub} size="lg" className="mr-2" /> | ||
GitHub | ||
</Nav.Link> | ||
</Nav> | ||
<hr className="d-lg-none border border-white" /> | ||
<Nav className="align-items-lg-center"> | ||
{loading && <Navbar.Text>Checking login...</Navbar.Text>} | ||
{!loading && !session && ( | ||
<Nav.Link onClick={() => signIn("discord")}> | ||
<FontAwesomeIcon icon={faDiscord} size="lg" className="mr-2" /> | ||
Sign In | ||
</Nav.Link> | ||
)} | ||
{!loading && session && ( | ||
<> | ||
{process.env.NODE_ENV === "development" && ( | ||
<> | ||
<Link href="/dashboard" passHref> | ||
<Nav.Link> | ||
Dashboard{" "} | ||
<Badge variant="danger" className="ml-1"> | ||
BETA | ||
</Badge> | ||
</Nav.Link> | ||
</Link> | ||
</> | ||
)} | ||
<Navbar.Text as="div" className="user-logged-in"> | ||
<img | ||
src={ | ||
session.user.image !== "" | ||
? session.user.image | ||
: "https://upload.wikimedia.org/wikipedia/commons/9/90/Discord-512.webp" | ||
} | ||
alt={session.user.name} | ||
className="user-image mr-2" | ||
/> | ||
<div className="user-details"> | ||
<div className="user-name"> | ||
{session.user.name} | ||
{session.user.verified && ( | ||
<FontAwesomeIcon className="ml-2" icon={faCheckCircle} /> | ||
)} | ||
</div> | ||
<small className="user-signout" onClick={signOut}> | ||
Sign Out | ||
</small> | ||
</div> | ||
</Navbar.Text> | ||
</> | ||
)} | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import Head from "next/head"; | ||
import { Container } from "react-bootstrap"; | ||
import { motion } from "framer-motion"; | ||
|
||
import Header from "./header"; | ||
import Footer from "./footer"; | ||
|
||
export default function Layout(props) { | ||
return ( | ||
<Container fluid className={`main_container ${props.className}`}> | ||
<Head> | ||
{/* HTML Meta Tags */} | ||
<title>AutoMuteUs</title> | ||
<meta | ||
name="description" | ||
content="AutoMuteUs is a Discord Bot that collects Among Us game data to automatically mute/unmute players during games!" | ||
/> | ||
<meta name="theme-color" content="#7289DA" /> | ||
|
||
{/* Google / Search Engine Tags */} | ||
<meta itemProp="name" content="AutoMuteUs" key="google:name" /> | ||
<meta | ||
itemProp="description" | ||
content="AutoMuteUs is a Discord Bot that collects Among Us game data to automatically mute/unmute players during games!" | ||
key="google:description" | ||
/> | ||
<meta | ||
itemProp="image" | ||
content={`https://automute.us/assets/img/logo_embed.png`} | ||
key="google:image" | ||
/> | ||
|
||
{/* Discord/Facebook Meta Tags */} | ||
<meta | ||
property="og:url" | ||
content="https://automute.us" | ||
key="og:url" | ||
/> | ||
<meta property="og:type" content="website" key="og:type" /> | ||
<meta property="og:title" content="AutoMuteUs" key="og:title" /> | ||
<meta | ||
property="og:description" | ||
content="AutoMuteUs is a Discord Bot that collects Among Us game data to automatically mute/unmute players during games!" | ||
key="og:description" | ||
/> | ||
<meta | ||
property="og:image" | ||
content={`https://automute.us/assets/img/logo_embed.png`} | ||
key="og:image" | ||
/> | ||
|
||
{/* Twitter Meta Tags */} | ||
<meta name="twitter:title" content="AutoMuteUs" /> | ||
<meta | ||
name="twitter:description" | ||
content="AutoMuteUs is a Discord Bot that collects Among Us game data to automatically mute/unmute players during games!" | ||
/> | ||
<meta | ||
name="twitter:image" | ||
content={`https://automute.us/assets/img/logo_embed.png`} | ||
/> | ||
</Head> | ||
|
||
<Header /> | ||
<motion.main | ||
exit={{ opacity: 0 }} | ||
animate={{ opacity: 1 }} | ||
initial={{ opacity: 0 }} | ||
id="main-content" | ||
className={`d-flex p-3 ${props.innerClassName}`} | ||
> | ||
{props.children} | ||
</motion.main> | ||
<Footer /> | ||
</Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,10 @@ const options = { | |
}, | ||
}), | ||
|
||
pages: { | ||
error: "/auth/error", | ||
}, | ||
|
||
session: { | ||
jwt: true, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default async function handler(req, res) { | ||
res.status(200).json([{ status: 200, message: "We are live!" }]); | ||
res.status(200).json([{ status: 200, message: "ok" }]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
import Head from "next/head"; | ||
|
||
import Layout from "../../components/layout"; | ||
import { Button } from "react-bootstrap"; | ||
import { faHome } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faDiscord } from "@fortawesome/free-brands-svg-icons"; | ||
import Link from "next/link"; | ||
import { signIn } from "next-auth/client"; | ||
|
||
export default class ErrorPage extends React.Component { | ||
render() { | ||
return ( | ||
<Layout | ||
className="theatric" | ||
innerClassName="justify-content-center align-items-center flex-column" | ||
effect={false} | ||
> | ||
<Head> | ||
<title>Authorization Error | AutoMuteUs</title> | ||
</Head> | ||
<h1>Sign-in Error or Cancellation</h1> | ||
<h5> | ||
Either try to | ||
<span | ||
onClick={() => | ||
signIn("discord", { callbackUrl: "/" }) | ||
} | ||
> | ||
<Button className="btn px-2 py-2 mx-3"> | ||
<FontAwesomeIcon icon={faDiscord} size="lg" className="mr-2" /> | ||
<span>Sign In</span> | ||
</Button> | ||
</span> | ||
again, or | ||
<Link href="/"> | ||
<Button className="btn px-2 py-2 mx-3"> | ||
<FontAwesomeIcon icon={faHome} size="lg" className="mr-2" /> | ||
<span>Go Home</span> | ||
</Button> | ||
</Link> | ||
</h5> | ||
</Layout> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters