mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
move browsers to each component
This commit is contained in:
parent
80379b54d0
commit
fe1096f308
@ -26,7 +26,6 @@ export { default as Login } from "./Login"
|
||||
export { default as Image } from "./Image"
|
||||
export { default as LoadMore } from "./LoadMore"
|
||||
export { default as EmbbededMediaPlayer } from "./EmbbededMediaPlayer"
|
||||
export { default as LivestreamsBrowser } from "./LivestreamsBrowser"
|
||||
export { default as HashtagTrendings } from "./HashtagTrendings"
|
||||
export { default as Searcher } from "./Searcher"
|
||||
export { default as UserPreview } from "./UserPreview"
|
||||
|
10
packages/app/src/pages/home/components/feed/index.jsx
Normal file
10
packages/app/src/pages/home/components/feed/index.jsx
Normal file
@ -0,0 +1,10 @@
|
||||
import React from "react"
|
||||
|
||||
import { PostCreator, PostsFeed } from "components"
|
||||
|
||||
export default () => {
|
||||
return <>
|
||||
<PostCreator />
|
||||
<PostsFeed />
|
||||
</>
|
||||
}
|
29
packages/app/src/components/LivestreamsBrowser/index.jsx → packages/app/src/pages/home/components/livestreams/index.jsx
Executable file → Normal file
29
packages/app/src/components/LivestreamsBrowser/index.jsx → packages/app/src/pages/home/components/livestreams/index.jsx
Executable file → Normal file
@ -4,7 +4,7 @@ import * as antd from "antd"
|
||||
import { UserPreview } from "components"
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import Livestream from "../../models/livestream"
|
||||
import Livestream from "../../../../models/livestream"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
@ -51,15 +51,19 @@ export default (props) => {
|
||||
console.error("Livestreams is not an array")
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
setList(livestreams)
|
||||
}
|
||||
}
|
||||
|
||||
const onClickItem = async (livestream) => {
|
||||
const onClickItem = (livestream) => {
|
||||
app.setLocation(`/live/${livestream.username}`)
|
||||
}
|
||||
|
||||
const onClickControlPanel = () => {
|
||||
app.setLocation("/live_control")
|
||||
}
|
||||
|
||||
const renderList = () => {
|
||||
if (list.length === 0) {
|
||||
return <antd.Result>
|
||||
@ -80,10 +84,21 @@ export default (props) => {
|
||||
|
||||
return <div className="livestreamsBrowser">
|
||||
<div className="header">
|
||||
<h1>
|
||||
<Icons.Tv />
|
||||
<span>Livestreams</span>
|
||||
</h1>
|
||||
<div className="title">
|
||||
<h1>
|
||||
<Icons.Tv />
|
||||
<span>Livestreams</span>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="panel">
|
||||
<antd.Button
|
||||
icon={<Icons.Settings />}
|
||||
onClick={onClickControlPanel}
|
||||
>
|
||||
Control Panel
|
||||
</antd.Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="livestream_list">
|
21
packages/app/src/components/LivestreamsBrowser/index.less → packages/app/src/pages/home/components/livestreams/index.less
Executable file → Normal file
21
packages/app/src/components/LivestreamsBrowser/index.less → packages/app/src/pages/home/components/livestreams/index.less
Executable file → Normal file
@ -7,8 +7,25 @@
|
||||
width: 100%;
|
||||
|
||||
.header {
|
||||
svg {
|
||||
font-size: 2.5rem;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
width: 100%;
|
||||
|
||||
.panel {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
svg {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
font-size: 2rem;
|
@ -0,0 +1,7 @@
|
||||
import React from "react"
|
||||
|
||||
import { PostsFeed } from "components"
|
||||
|
||||
export default () => {
|
||||
return <PostsFeed savedOnly />
|
||||
}
|
@ -4,7 +4,11 @@ import classnames from "classnames"
|
||||
|
||||
import { Icons, createIconRender } from "components/Icons"
|
||||
|
||||
import { PostCreator, PostsFeed, LivestreamsBrowser, HashtagTrendings } from "components"
|
||||
import { HashtagTrendings } from "components"
|
||||
|
||||
import FeedBrowser from "./components/feed"
|
||||
import LivestreamsBrowser from "./components/livestreams"
|
||||
import SavedPostsBrowser from "./components/savedPosts"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
@ -12,30 +16,17 @@ const Tabs = {
|
||||
"feed": {
|
||||
title: "Feed",
|
||||
icon: "Rss",
|
||||
component: (props) => {
|
||||
return <>
|
||||
<PostCreator />
|
||||
<PostsFeed />
|
||||
</>
|
||||
}
|
||||
component: FeedBrowser
|
||||
},
|
||||
"livestreams": {
|
||||
title: "Livestreams",
|
||||
icon: "Tv",
|
||||
component: (props) => {
|
||||
return <>
|
||||
<LivestreamsBrowser />
|
||||
</>
|
||||
}
|
||||
component: LivestreamsBrowser
|
||||
},
|
||||
"savedPosts": {
|
||||
title: "Saved posts",
|
||||
icon: "Bookmark",
|
||||
component: (props) => {
|
||||
return <>
|
||||
<PostsFeed savedOnly />
|
||||
</>
|
||||
}
|
||||
component: SavedPostsBrowser
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user