This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
e17592e
commit fa7962d
Showing
16 changed files
with
396 additions
and
97 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
TWITCH_CLIENT_ID: "my-twitch-client-id" | ||
TWITCH_CLIENT_SECRET: "my-twitch-client-secret" | ||
NEXT_PUBLIC_APP_NAME: "my-app-name" | ||
NEXT_PUBLIC_APP_DESCRIPTION: "my-app-description" | ||
NEXT_PUBLIC_TWITTER_HANDLE: "my-twitter-handle" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Typecheck | ||
run: npm run typecheck | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
- name: Print Environment Variable | ||
run: echo $MY_ENV_VAR |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,26 @@ | ||
export default function Footer() { | ||
const copyrightYear = new Date().getFullYear(); | ||
return ( | ||
<> | ||
<footer className=" text-gray-700 dark:text-white"> | ||
<div className="container mx-auto flex flex-col items-center px-5 py-5 sm:flex-row"> | ||
<p className="text-center text-gray-500 md:text-right"> | ||
© {copyrightYear} | ||
<a | ||
href="https://www.mrdemonwolf.com" | ||
className="ml-1 text-gray-200 dark:text-gray-400" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
MrDemonWolf, Inc. | ||
</a> | ||
</p> | ||
<span className="mt-4 inline-flex justify-center text-sm sm:ml-auto sm:mt-0 sm:justify-start"> | ||
this site is not affiliated with Twitch™ or any of it’s | ||
partners. | ||
</span> | ||
</div> | ||
</footer> | ||
</> | ||
); | ||
} |
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,15 @@ | ||
export default function Home() { | ||
return <>Please Login</>; | ||
type Props = { | ||
message: string; | ||
}; | ||
|
||
export default function Hero(props: Props) { | ||
return ( | ||
<div className="m-10 mx-auto max-w-md overflow-hidden rounded-lg bg-white shadow-lg dark:bg-gray-700"> | ||
<div className="flex items-center bg-gray-100 px-6 py-3 dark:bg-gray-600"> | ||
<h1 className="text-primary-500 text-2xl font-semibold dark:text-white"> | ||
{props.message} | ||
</h1> | ||
</div> | ||
</div> | ||
); | ||
} |
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,40 +1,114 @@ | ||
import { useSession } from "next-auth/react"; | ||
import DefaultLayout from "~/components/layout/default"; | ||
import Hero from "~/components/Hero"; | ||
import { api } from "~/utils/api"; | ||
import Image from "next/image"; | ||
|
||
import dayjs from "dayjs"; | ||
import { | ||
WrenchIcon, | ||
CheckBadgeIcon, | ||
HeartIcon, | ||
CalendarDaysIcon, | ||
IdentificationIcon, | ||
EnvelopeIcon, | ||
} from "@heroicons/react/24/solid"; | ||
|
||
type Props = { | ||
landingPage: true; | ||
id: string; | ||
display_name: string; | ||
type: string; | ||
broadcaster_type: string; | ||
description: string; | ||
profile_image_url: string; | ||
offline_image_url: string; | ||
email: string; | ||
created_at: string; | ||
}; | ||
|
||
export default function Home(props: Props) { | ||
const { data: sessionData } = useSession(); | ||
if (!sessionData) return null; | ||
const { data: twitch, isLoading: postLoading } = api.twitch.getUser.useQuery({ | ||
accessToken: sessionData.accessToken, | ||
}); | ||
|
||
export default function InfoPanel(props: Props) { | ||
return ( | ||
<> | ||
<DefaultLayout>{twitch?.data[0]}</DefaultLayout> | ||
<div className="m-10 mx-auto max-w-md overflow-hidden rounded-lg bg-white shadow-lg dark:bg-gray-700"> | ||
<Image | ||
src={props.profile_image_url} | ||
className="h-56 w-full object-cover object-center" | ||
alt="avatar" | ||
width={1920} | ||
height={1080} | ||
/> | ||
<div className="flex items-center bg-gray-100 px-6 py-3 dark:bg-gray-600"> | ||
<h1 className="text-primary-500 text-2xl font-semibold dark:text-white"> | ||
{props.display_name} | ||
</h1> | ||
{props.type === "staff" && ( | ||
<> | ||
<WrenchIcon | ||
width={24} | ||
height={24} | ||
title="Twitch Staff" | ||
className="text-primary-500 dark:text-secondary-400 ml-2 text-3xl" | ||
/> | ||
</> | ||
)} | ||
{props.broadcaster_type === "partner" && ( | ||
<> | ||
<CheckBadgeIcon | ||
width={28} | ||
height={28} | ||
title="Twitch Partner or Verified" | ||
className="text-primary-500 dark:text-secondary-400 ml-2 text-3xl" | ||
/> | ||
</> | ||
)} | ||
{props.broadcaster_type === "affiliate" && ( | ||
<> | ||
<HeartIcon | ||
width={28} | ||
height={28} | ||
title="Twitch Partner or Verified" | ||
className="text-primary-500 dark:text-secondary-400 ml-2 text-3xl" | ||
/> | ||
</> | ||
)} | ||
</div> | ||
<div className="px-6 py-4"> | ||
{props.description && ( | ||
<> | ||
<p className="mb-4 py-2 text-xl text-gray-700 dark:text-white"> | ||
{props.description} | ||
</p> | ||
</> | ||
)} | ||
<div className="mt-4 flex items-center text-gray-700 dark:text-white"> | ||
<CalendarDaysIcon | ||
width={24} | ||
height={24} | ||
className="text-primary-500 dark:text-secondary-400" | ||
/> | ||
|
||
<h2 className="px-2 text-sm"> | ||
{dayjs(props.created_at).format("MMMM D, YYYY")} | ||
</h2> | ||
</div> | ||
<div className="mt-4 flex items-center text-gray-700 dark:text-white"> | ||
<IdentificationIcon | ||
width={24} | ||
height={24} | ||
className="text-primary-500 dark:text-secondary-400" | ||
/> | ||
<h2 className="px-2 text-sm">{props.id}</h2> | ||
</div> | ||
{props.email && ( | ||
<> | ||
<div className="mt-4 flex items-center text-gray-700 dark:text-white"> | ||
<EnvelopeIcon | ||
width={24} | ||
height={24} | ||
className="text-primary-500 dark:text-secondary-400" | ||
/> | ||
<h2 className="px-2 text-sm">{props.email}</h2> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
// export default function Home() { | ||
// // get token from session and pass it to the server | ||
// const { data: sessionData } = useSession(); | ||
// if (!sessionData) return <Hero />; | ||
|
||
// const { data: twitch, isLoading: postLoading } = api.twitch.getUser.useQuery({ | ||
// accessToken: sessionData.accessToken, | ||
// }); | ||
|
||
// if (postLoading) return <>Loading...</>; | ||
|
||
// return ( | ||
// <> | ||
// <DefaultLayout>{twitch?.data[0]?.display_name}</DefaultLayout> | ||
// </> | ||
// ); | ||
// } |
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
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
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
Oops, something went wrong.