diff --git a/packages/fakeyou.com/src/scss/site-refresh.scss b/packages/fakeyou.com/src/scss/site-refresh.scss index 72a540b011..2139cc2082 100644 --- a/packages/fakeyou.com/src/scss/site-refresh.scss +++ b/packages/fakeyou.com/src/scss/site-refresh.scss @@ -856,6 +856,56 @@ styles with important tags: wave { overflow: hidden !important; } + + .twitch-video-container { + border: 1px solid #ffffff12 !important; + border-radius: 0px; + overflow: hidden; + background-color: $panel !important; + min-height: 220px; + height: 100%; + box-shadow: 0 0 0 1px rgba(0 0 0 / 30%), 0 70px 65px rgb(0 0 0 / 10%), + 0 30px 30px rgb(0 0 0 / 8%), 0 15px 15px rgb(0 0 0 / 6%), + 0 10px 8px rgb(0 0 0 / 4%), 0 4px 4px rgb(0 0 0 / 2%), + 0 2px 2px rgb(0 0 0 / 1%) !important; + } + + .twitch-chat-container { + border: 1px solid #ffffff12 !important; + border-radius: 8px; + background-color: $panel !important; + min-height: 650px; + box-shadow: 0 0 0 1px rgba(0 0 0 / 30%), 0 70px 65px rgb(0 0 0 / 10%), + 0 30px 30px rgb(0 0 0 / 8%), 0 15px 15px rgb(0 0 0 / 6%), + 0 10px 8px rgb(0 0 0 / 4%), 0 4px 4px rgb(0 0 0 / 2%), + 0 2px 2px rgb(0 0 0 / 1%) !important; + } + + .channel-title { + font-size: 16px; + } + + .stream-title { + font-size: 14px; + } + + .channel-description { + font-size: 14px; + } + + .channel-image { + border: 2px solid $white; + min-width: 60px; + min-height: 60px; + height: 60px; + width: 60px; + object-fit: cover; + } + + .view-count { + font-size: 14px; + color: #fc6b68; + } } select { @@ -1056,5 +1106,11 @@ textarea { max-height: 300px; } } + + .twitch-video-container { + min-height: 391px; + height: 100%; + border-radius: 8px; + } } } diff --git a/packages/fakeyou.com/src/v2/view/pages/channels/ChannelsPage.tsx b/packages/fakeyou.com/src/v2/view/pages/channels/ChannelsPage.tsx index 9207764d06..836137f02d 100644 --- a/packages/fakeyou.com/src/v2/view/pages/channels/ChannelsPage.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/channels/ChannelsPage.tsx @@ -1,23 +1,91 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper"; -import {} from "@fortawesome/free-solid-svg-icons"; -import {} from "@fortawesome/free-brands-svg-icons"; import { motion } from "framer-motion"; import { container, item } from "../../../../data/animation"; import { usePrefixedDocumentTitle } from "../../../../common/UsePrefixedDocumentTitle"; -import { TwitchPlayerNonInteractive, TwitchChat } from "react-twitch-embed"; +import { TwitchPlayer, TwitchChat } from "react-twitch-embed"; +import axios from "axios"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faEye } from "@fortawesome/pro-solid-svg-icons"; interface Props { sessionWrapper: SessionWrapper; } +interface StreamInfo { + broadcaster_name: string; + title: string; +} + +interface ChannelInfo { + profile_image_url: string; + description: string; + login: string; +} + +interface ViewerCount { + viewer_count: number; +} + +let twitchApi = axios.create({ + headers: { + "Client-ID": "8s2gjp7ora3zswgjabz1svoi24ting", + Authorization: "Bearer 10uyyp7l6n21zlezht8vvv25uvenu3", + }, +}); + function ChannelsPage(props: Props) { usePrefixedDocumentTitle("Channels"); + const [stream, setStream] = useState({ + broadcaster_name: "", + title: "", + }); + + const [channel, setChannel] = useState({ + profile_image_url: "", + description: "", + login: "", + }); + + const [viewerCount, setViewerCount] = useState({ + viewer_count: 0, + }); + + useEffect(() => { + const fetchData = async () => { + const streamInfo = await twitchApi.get( + "https://api.twitch.tv/helix/channels?broadcaster_id=650154491" + ); + setStream(streamInfo.data.data[0]); + const channelInfo = await twitchApi.get( + "https://api.twitch.tv/helix/users?login=testytest512" + ); + setChannel(channelInfo.data.data[0]); + const viewerCountInfo = await twitchApi.get( + "https://api.twitch.tv/helix/streams?user_login=testytest512" + ); + setViewerCount(viewerCountInfo.data.data[0]); + }; + fetchData(); + }); + + let twitchChannelLink = "https://twitch.tv/" + channel.login; + + // if (viewerCount !== undefined) { + // console.log("helllooo"); + // } else { + // let viewerCountNumber = viewerCount.viewer_count.toString(); + // } + let viewCountNumber = "Offline"; + if (viewerCount !== undefined) { + viewCountNumber = viewerCount.viewer_count.toString(); + } + return ( -
-
+
+
{/*
@@ -27,18 +95,56 @@ function ChannelsPage(props: Props) { {/* Feed Content */} - +
+
+ + profile + + +
+

+ {stream.broadcaster_name} +

+

+ {stream.title} +

+
+
+
+

+ + {viewCountNumber} +

+
+
+
+

{channel.description}

+
{/* Side column */} -
- +
+
diff --git a/yarn.lock b/yarn.lock index ba580f1c99..83ee8e73d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3795,6 +3795,7 @@ __metadata: react-scripts: 5.0.0 react-select: ^5.7.0 react-share: ^4.4.1 + react-twitch-embed: ^3.0.1 react-wavesurfer.js: ^0.0.8 sass: ^1.57.1 typescript: ^3.7.5 @@ -3900,8 +3901,6 @@ __metadata: dependencies: craco: ^0.0.3 lerna: ^4.0.0 - react-select: ^5.7.0 - react-twitch-embed: ^3.0.1 yarn: ^1.22.19 languageName: unknown linkType: soft