Skip to content

Commit

Permalink
Merge dev into dash
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshirahh committed Feb 1, 2021
2 parents 1aa36b8 + 35d33e1 commit 1ffd72f
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ dist
client/build
api/build
package-lock.json
prisma/src/
prisma/src/
107 changes: 107 additions & 0 deletions components/header.js
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>
);
}
77 changes: 77 additions & 0 deletions components/layout.js
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>
);
}
4 changes: 4 additions & 0 deletions pages/api/auth/[...nextauth].js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ const options = {
},
}),

pages: {
error: "/auth/error",
},

session: {
jwt: true,
},
Expand Down
2 changes: 1 addition & 1 deletion pages/api/live.js
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" }]);
}
47 changes: 47 additions & 0 deletions pages/auth/error.js
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>
);
}
}
50 changes: 3 additions & 47 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from "react";
import Head from "next/head";
import Link from "next/link";

import { Button } from "react-bootstrap";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faDiscord } from "@fortawesome/free-brands-svg-icons";
import { faCamera, faGem } from "@fortawesome/free-solid-svg-icons";

import Layout from "../components/common/layout";
import * as util from "../components/utility/client";
import ServerStats from "../components/common/server-stats";
import Link from "next/link";

const amus_crewmate = "/assets/img/svg/amus_crewmate_robo.svg";
import * as util from "../components/utility/client";
export default class App extends React.Component {
render() {
return (
Expand All @@ -21,50 +21,6 @@ export default class App extends React.Component {
effectActive={true}
innerClassName="flex-column flex-lg-row align-items-center"
>
<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" />
<meta
itemProp="description"
content="AutoMuteUs is a Discord Bot that collects Among Us game data to automatically mute/unmute players during games!"
/>
<meta
itemProp="image"
content="http://automute.us/assets/img/logo_embed.png"
/>

{/* Discord/Facebook Meta Tags */}
<meta property="og:url" content="https://automute.us" />
<meta property="og:type" content="website" />
<meta property="og:title" content="AutoMuteUs" />
<meta
property="og:description"
content="AutoMuteUs is a Discord Bot that collects Among Us game data to automatically mute/unmute players during games!"
/>
<meta
property="og:image"
content="http://automute.us/assets/img/logo_embed.png"
/>

{/* 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="http://automute.us/assets/img/logo_embed.png"
/>
</Head>
<div id="home-text">
<h2 className="title">Use AutoMuteUs for hands free muting</h2>
<p className="subtitle">
Expand All @@ -87,7 +43,7 @@ export default class App extends React.Component {
Add to Discord
</Button>
<Button
href="https://github.com/denverquane/amonguscapture/releases/latest/download/AmongUsCapture.zip"
href="https://github.com/automuteus/capture-install#readme"
className="btn btn-primary btn-lg mb-2 mr-2 px-2 px-lg-5"
>
<FontAwesomeIcon icon={faCamera} size="lg" className="mr-2" />
Expand Down

0 comments on commit 1ffd72f

Please sign in to comment.