added plot and cards to dashboard. added navbar to the left.

This commit is contained in:
Giulio De Pasquale 2020-12-18 19:00:26 +00:00
parent eeb959bda1
commit 565af21955

View File

@ -4,7 +4,10 @@ import {CurrencyPair, FirstConnectMessage, NewEventMessage, NewTickMessage, Posi
import {socket} from "../index"; import {socket} from "../index";
import {symbolToPair} from "../utils"; import {symbolToPair} from "../utils";
import {Helmet} from "react-helmet"; import {Helmet} from "react-helmet";
import {Navbar, Sidebar} from "./Navbars"; import {Navbar} from "./Navbars";
import {SidebarCard} from "./HCard";
import {ClockIcon, DollarIcon} from "./Icons";
import RPlot from "./RPlot";
type AppState = { type AppState = {
current_price: number, current_price: number,
@ -79,238 +82,31 @@ class App extends Component<{}, AppState> {
<title> Rustico <title> Rustico
- {String(this.state.active_pair.base) + "/" + String(this.state.active_pair.quote)} {String(this.state.current_price)} </title> - {String(this.state.active_pair.base) + "/" + String(this.state.active_pair.quote)} {String(this.state.current_price)} </title>
</Helmet> </Helmet>
<div className="h-screen w-full flex overflow-hidden select-none"> <div className="bg-gray-800">
<Navbar/> <div className="h-screen max-w-screen-2xl flex mx-auto">
<main <Navbar/>
className="my-1 pt-2 pb-2 px-10 flex-1 bg-gray-200 dark:bg-black rounded-l-lg* <main
transition duration-500 ease-in-out overflow-y-auto"> className="my-1 pt-2 pb-2 px-10 flex-1 bg-gray-200 dark:bg-black rounded-l-lg*
</main> transition duration-500 ease-in-out overflow-y-auto flex flex-col">
{/* <main*/} <div className="flex justify-center text-2xl my-4">
{/* className="my-1 pt-2 pb-2 px-10 flex-1 bg-gray-200 dark:bg-black rounded-l-lg*/} <SidebarCard logo={<DollarIcon width={10} height={10}/>} title={""}
{/*transition duration-500 ease-in-out overflow-y-auto">*/} content={"$" + this.state.current_price.toFixed(2).toString()}/>
{/* <div className="flex">*/} <SidebarCard logo={<ClockIcon width={10} height={10}/>} title={""}
{/* <div*/} content={this.state.current_tick.toString()}/>
{/* className="mr-6 w-1/2 mt-8 py-2 flex-shrink-0 flex flex-col bg-white*/} </div>
{/* dark:bg-gray-600 rounded-lg">*/}
{/* /!* Card list container *!/*/}
{/* <h3*/}
{/* className="flex items-center pt-1 pb-1 px-8 text-lg font-semibold*/}
{/* capitalize dark:text-gray-300">*/}
{/* /!*Header*!/*/}
{/* <span>nearby jobs</span>*/}
{/* <button className="ml-2">*/}
{/* <svg className="h-5 w-5 fill-current" viewBox="0 0 256 512">*/}
{/* <path*/}
{/* d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9*/}
{/* 0l-22.6-22.6c-9.4-9.4-9.4-24.6*/}
{/* 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6*/}
{/* 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136*/}
{/* 136c9.5 9.4 9.5 24.6.1 34z"></path>*/}
{/* </svg>*/}
{/* </button>*/}
{/* </h3>*/}
{/* <div>*/} <div className="flex flex-col flex-grow mx-3 my-8 shadow-md hover:shadow-lg">
{/* <!-- List -->*/} <div
className="py-2 flex-grow bg-white dark:bg-gray-600 rounded-lg">
<RPlot/>
</div>
</div>
{/* <ul className="pt-1 pb-2 px-3 overflow-y-auto">*/} <footer className="flex rounded-lg justify-center bg-gray-600 mt-4 border-t text-gray-300">
<span className="my-1 mx-1">Made with by the Peperone in a scantinato</span>
{/* <li className="mt-2">*/} </footer>
</main>
{/* <a*/} </div>
{/* className="p-5 flex flex-col justify-between*/}
{/* bg-gray-100 dark:bg-gray-200 rounded-lg"*/}
{/* href="/">*/}
{/* <div*/}
{/* className="flex items-center justify-between*/}
{/* font-semibold capitalize dark:text-gray-700">*/}
{/* <!-- Top section -->*/}
{/* <span>english lesson</span>*/}
{/* <div className="flex items-center">*/}
{/* <svg*/}
{/* className="h-5 w-5 fill-current mr-1*/}
{/* text-gray-600"*/}
{/* viewBox="0 0 24 24">*/}
{/* <path*/}
{/* d="M14 12l-4-4v3H2v2h8v3m12-4a10*/}
{/* 10 0 01-19.54 3h2.13a8 8 0*/}
{/* 100-6H2.46A10 10 0 0122 12z"></path>*/}
{/* </svg>*/}
{/* <span>4.2 mi</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* <p*/}
{/* className="text-sm font-medium leading-snug*/}
{/* text-gray-600 my-3">*/}
{/* <!-- Middle section -->*/}
{/* Lorem ipsum, dolor sit amet consectetur*/}
{/* adipisicing elit. Explicabo assumenda porro*/}
{/* sapiente, cum nobis tempore delectus*/}
{/* consectetur ullam reprehenderit quis ducimus,*/}
{/* iusto dolor nam corporis id perspiciatis*/}
{/* consequuntur saepe excepturi.*/}
{/* </p>*/}
{/* <div className="flex justify-between">*/}
{/* <!-- Bottom section -->*/}
{/* <div className="flex">*/}
{/* <img*/}
{/* className="h-6 w-6 rounded-full mr-3"*/}
{/* src="https://i.pinimg.com/originals/b7/06/0b/b7060b60f6ee1beeedf7d648dabd89a1.jpg"*/}
{/* alt=""/>*/}
{/* <span>*/}
{/* <span*/}
{/* className="text-blue-500*/}
{/* font-semibold">*/}
{/* Regina C.*/}
{/* </span>*/}
{/* via HeyTutor*/}
{/* </span>*/}
{/* </div>*/}
{/* <p*/}
{/* className="text-sm font-medium leading-snug*/}
{/* text-gray-600">*/}
{/* 14 hours ago*/}
{/* </p>*/}
{/* </div>*/}
{/* </a>*/}
{/* </li>*/}
{/* <li className="mt-2">*/}
{/* <a*/}
{/* className="p-5 flex flex-col justify-between*/}
{/* bg-gray-100 dark:bg-gray-200 rounded-lg"*/}
{/* href="/">*/}
{/* <div*/}
{/* className="flex items-center justify-between*/}
{/* font-semibold capitalize dark:text-gray-700">*/}
{/* <!-- Top section -->*/}
{/* <span>english lesson</span>*/}
{/* <div className="flex items-center">*/}
{/* <svg*/}
{/* className="h-5 w-5 fill-current mr-1*/}
{/* text-gray-600"*/}
{/* viewBox="0 0 24 24">*/}
{/* <path*/}
{/* d="M14 12l-4-4v3H2v2h8v3m12-4a10*/}
{/* 10 0 01-19.54 3h2.13a8 8 0*/}
{/* 100-6H2.46A10 10 0 0122 12z"></path>*/}
{/* </svg>*/}
{/* <span>4.2 mi</span>*/}
{/* </div>*/}
{/* </div>*/}
{/* <p*/}
{/* className="text-sm font-medium leading-snug*/}
{/* text-gray-600 my-3">*/}
{/* <!-- Middle section -->*/}
{/* Lorem ipsum, dolor sit amet consectetur*/}
{/* adipisicing elit. Explicabo assumenda porro*/}
{/* sapiente, cum nobis tempore delectus*/}
{/* consectetur ullam reprehenderit quis ducimus,*/}
{/* iusto dolor nam corporis id perspiciatis*/}
{/* consequuntur saepe excepturi.*/}
{/* </p>*/}
{/* <div className="flex justify-between">*/}
{/* <!-- Bottom section -->*/}
{/* <div className="flex">*/}
{/* <img*/}
{/* className="h-6 w-6 rounded-full mr-3"*/}
{/* src="https://i.pinimg.com/originals/b7/06/0b/b7060b60f6ee1beeedf7d648dabd89a1.jpg"*/}
{/* alt="Issue"/>*/}
{/* <span>*/}
{/* <span*/}
{/* className="text-blue-500*/}
{/* font-semibold">*/}
{/* Regina C.*/}
{/* </span>*/}
{/* via HeyTutor*/}
{/* </span>*/}
{/* </div>*/}
{/* <p*/}
{/* className="text-sm font-medium leading-snug*/}
{/* text-gray-600">*/}
{/* 14 hours ago*/}
{/* </p>*/}
{/* </div>*/}
{/* </a>*/}
{/* </li>*/}
{/* </ul>*/}
{/* <a*/}
{/* href="/"*/}
{/* className="flex justify-center capitalize text-blue-500*/}
{/* dark:text-blue-200">*/}
{/* <span>see all</span>*/}
{/* </a>*/}
{/* </div>*/}
{/* </div>*/}
{/* <div*/}
{/* className="mr-6 w-1/2 mt-8 py-2 flex-shrink-0 flex flex-col*/}
{/* bg-purple-300 rounded-lg text-white">*/}
{/* <h3*/}
{/* className="flex items-center pt-1 pb-1 px-8 text-lg font-bold*/}
{/* capitalize">*/}
{/* <!-- Header -->*/}
{/* <span>scheduled lessons</span>*/}
{/* <button className="ml-2">*/}
{/* <svg className="h-5 w-5 fill-current" viewBox="0 0 256 512">*/}
{/* <path*/}
{/* d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9*/}
{/* 0l-22.6-22.6c-9.4-9.4-9.4-24.6*/}
{/* 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6*/}
{/* 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136*/}
{/* 136c9.5 9.4 9.5 24.6.1 34z"></path>*/}
{/* </svg>*/}
{/* </button>*/}
{/* </h3>*/}
{/* <div className="flex flex-col items-center mt-12">*/}
{/* <img*/}
{/* src="https://cdni.iconscout.com/illustration/premium/thumb/empty-state-2130362-1800926.png"*/}
{/* alt=" empty schedule"/>*/}
{/* <span className="font-bold mt-8">Your schedule is empty</span>*/}
{/* <span className="text-purple-500">*/}
{/* Make your first appointment*/}
{/* </span>*/}
{/* <button className="mt-8 bg-purple-800 rounded-lg py-2 px-4">*/}
{/* Find a Job*/}
{/* </button>*/}
{/* </div>*/}
{/* </div>*/}
{/* </div>*/}
{/* </main>*/}
<Sidebar price={this.state.current_price} tick={this.state.current_tick}
positions={this.state.positions}/>
</div> </div>
</> </>
) )