From a7f47ea0598915591305c0bc9cef987f4570bad2 Mon Sep 17 00:00:00 2001 From: srgooglo Date: Thu, 8 Sep 2022 19:05:28 +0200 Subject: [PATCH] remove `streams` page --- packages/app/src/pages/streams/index.jsx | 107 ---------------------- packages/app/src/pages/streams/index.less | 52 ----------- 2 files changed, 159 deletions(-) delete mode 100644 packages/app/src/pages/streams/index.jsx delete mode 100644 packages/app/src/pages/streams/index.less diff --git a/packages/app/src/pages/streams/index.jsx b/packages/app/src/pages/streams/index.jsx deleted file mode 100644 index 9471fef9..00000000 --- a/packages/app/src/pages/streams/index.jsx +++ /dev/null @@ -1,107 +0,0 @@ -import React from "react" -import * as antd from "antd" -import { Icons } from "components/Icons" -import { ActionsBar } from "components" - -import "./index.less" - -export default class Streams extends React.Component { - state = { - list: [], - } - - api = window.app.api.withEndpoints("main") - - componentDidMount = async () => { - await this.updateStreamsList() - } - - updateStreamsList = async () => { - let streams = await this.api.get.streams().catch(error => { - console.error(error) - antd.message.error(error) - - return false - }) - - if (streams && Array.isArray(streams)) { - // resolve user_id with user basic data - streams = streams.map(async (stream) => { - const userData = await this.api.get.user(undefined, { _id: stream.user_id }).catch((error) => { - console.error(error) - antd.message.error(error) - - return false - }) - - if (userData) { - stream.userData = userData - } - - return stream - }) - - streams = await Promise.all(streams) - } - - this.setState({ list: streams }) - } - - onClickItem = (item) => { - window.app.setLocation(`/live/${item}`) - } - - renderListItem = (stream) => { - return
this.onClickItem(stream.username)} - className="streaming-item" - > -
- {stream.userData.username} -
-
-
-

@{stream.userData.username}

-
-
- #{stream.id} -
-
-
- } - - render() { - return
- -
- } - onClick={this.updateStreamsList} - /> -
-
- } - onClick={() => window.app.setLocation("/streaming_control")} - > - Control Panel - -
-
- { - this.state.list.length > 0 ? -
- {this.state.list.map(this.renderListItem)} -
: -
-
- -
-
- } -
- } -} \ No newline at end of file diff --git a/packages/app/src/pages/streams/index.less b/packages/app/src/pages/streams/index.less deleted file mode 100644 index 7ec6150e..00000000 --- a/packages/app/src/pages/streams/index.less +++ /dev/null @@ -1,52 +0,0 @@ -.streams { - .streams-list { - display: flex; - flex-direction: column; - - .streaming-item { - cursor: pointer; - display: flex; - flex-direction: row; - - padding: 10px; - border-bottom: 1px solid #e6e6e6; - - .thumbnail { - width: 15vw; - height: 100px; - background-size: cover; - - img { - border-radius: 8px; - width: 100%; - height: 100%; - } - } - - .details { - display: flex; - flex-direction: column; - - .title { - display: inline-flex; - align-items: center; - - h1 { - font-size: 1.5em; - font-weight: bold; - margin-right: 10px; - margin-bottom: 0; - } - - span { - font-size: 0.8em; - } - } - } - } - - .streaming-item:hover { - background-color: var(--background-color-accent); - } - } -} \ No newline at end of file