Body.js 659 Bytes
import React from "react";
import "./Body.css";
import {ChannelList} from "./Channel.js"
const qs= require('querystring');
const url = require('url')

const OAuthUrl = `https://id.twitch.tv/oauth2/authorize?response_type=code&approval_prompt=auto&redirect_uri=http://server.oss.jinsu.me:80/join&client_id=2d1gvcqyiyrk180qvnkec2fl23sv1o`;

function Body(){
    var urlQuery = url.parse(window.location.href).query;
    var param = qs.parse(urlQuery);

    return (
        <div className="body">
            {!param.authenticated && <a href={OAuthUrl} className="login__btn">Login</a> }
            <ChannelList />
        </div>
    );
}

export default Body;