mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
rename explore
to global
tab
This commit is contained in:
parent
ff9ba15cde
commit
7a508d2ce2
@ -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>
|
||||
}
|
||||
}
|
@ -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
|
||||
/>
|
||||
}
|
||||
}
|
||||
|
22
packages/app/src/pages/posts/components/global/index.jsx
Executable file
22
packages/app/src/pages/posts/components/global/index.jsx
Executable 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
|
||||
/>
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
.postsExplore {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.postsExplore_header {
|
||||
font-size: 1.3rem;
|
Loading…
x
Reference in New Issue
Block a user