rename explore to global tab

This commit is contained in:
SrGooglo 2023-03-15 19:23:39 +00:00
parent ff9ba15cde
commit 7a508d2ce2
4 changed files with 26 additions and 56 deletions

View File

@ -1,55 +0,0 @@
import React from "react"
import { Skeleton } from "antd"
import { Icons } from "components/Icons"
import { PostsList, Searcher } from "components"
import Post from "models/post"
import "./index.less"
export default class ExplorePosts extends React.Component {
state = {
focusedSearcher: false,
filledSearcher: false,
}
toggleFocusSearcher = (to) => {
to = to ?? !this.state.focusedSearcher
this.setState({
focusedSearcher: to
})
}
toggleState = (key, to) => {
to = to ?? !this.state[key]
this.setState({
[key]: to
})
}
render() {
return <div className="postsExplore">
<div className="postsExplore_header">
<Searcher
autoFocus={false}
onFocus={() => this.toggleState("focusedSearcher", true)}
onUnfocus={() => this.toggleState("focusedSearcher", false)}
onFilled={() => this.toggleState("filledSearcher", true)}
onEmpty={() => this.toggleState("filledSearcher", false)}
/>
</div>
{
this.state.focusedSearcher || this.state.filledSearcher ? null : <PostsList
loadFromModel={Post.getExplorePosts}
watchTimeline={[
"post.new",
"post.delete",
]}
/>
}
</div>
}
}

View File

@ -13,7 +13,7 @@ const emptyListRender = () => {
</h2>
<p>
Search for new people to follow on <a onClick={() => app.setLocation("/home/explore")}>explore</a> tab, to start view their posts.
Search for new people to follow on <a onClick={() => app.setLocation("/?type=global")}>global</a> tab, and start view their posts.
</p>
</div>
}
@ -21,12 +21,14 @@ const emptyListRender = () => {
export class Feed extends React.Component {
render() {
return <PostsList
ref={this.props.innerRef}
emptyListRender={emptyListRender}
loadFromModel={FeedModel.getPostsFeed}
watchTimeline={[
"feed.new",
"post.delete",
]}
realtime
/>
}
}

View File

@ -0,0 +1,22 @@
import React from "react"
import { PostsList } from "components"
import Post from "models/post"
import "./index.less"
export default class ExplorePosts extends React.Component {
render() {
return <PostsList
loadFromModel={Post.getExplorePosts}
watchTimeline={[
"post.new",
"post.delete",
"feed.new",
"feed.delete",
]}
realtime
/>
}
}

View File

@ -1,5 +1,6 @@
.postsExplore {
width: 100%;
height: 100%;
.postsExplore_header {
font-size: 1.3rem;