Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hive
condenser
Commits
c6c73f3e
Commit
c6c73f3e
authored
Sep 24, 2021
by
Quoc Huy Nguyen Dinh
Browse files
Merge branch 'develop' into '144-fix-storybook'
# Conflicts: # src/app/components/pages/PostsIndexLayout.jsx
parents
4a55d1b8
c662e4d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/components/pages/PostsIndex.jsx
View file @
c6c73f3e
...
...
@@ -242,7 +242,10 @@ module.exports = {
const
order
=
account_name
?
route
.
category
:
route
.
order
||
'
trending
'
;
const
hive
=
ifHive
(
category
);
const
community
=
state
.
global
.
getIn
([
'
community
'
,
hive
],
null
);
let
community
=
state
.
global
.
getIn
([
'
community
'
,
hive
],
null
);
if
(
typeof
community
===
'
string
'
)
{
community
=
null
;
}
const
enableAds
=
ownProps
.
gptEnabled
&&
!
GptUtils
.
HasBannedTags
([
category
],
state
.
app
.
getIn
([
'
googleAds
'
,
'
gptBannedTags
'
]));
...
...
src/app/components/pages/PostsIndexLayout.jsx
View file @
c6c73f3e
...
...
@@ -13,13 +13,19 @@ import CommunityPane from 'app/components/elements/CommunityPane';
import
CommunityPaneMobile
from
'
app/components/elements/CommunityPaneMobile
'
;
import
Topics
from
'
./Topics
'
;
class
PostsIndexLayout
extends
React
.
Component
{
static
propTypes
=
{
username
:
PropTypes
.
string
,
blogmode
:
PropTypes
.
bool
,
topics
:
PropTypes
.
object
,
};
const
propTypes
=
{
username
:
PropTypes
.
string
,
blogmode
:
PropTypes
.
bool
,
topics
:
PropTypes
.
object
,
};
const
defaultProps
=
{
username
:
''
,
blogmode
:
true
,
topics
:
{},
};
class
PostsIndexLayout
extends
React
.
Component
{
componentWillMount
()
{
const
{
subscriptions
,
getSubscriptions
,
username
}
=
this
.
props
;
if
(
!
subscriptions
&&
username
)
getSubscriptions
(
username
);
...
...
@@ -27,13 +33,13 @@ class PostsIndexLayout extends React.Component {
componentDidUpdate
(
prevProps
)
{
const
{
subscriptions
,
getSubscriptions
,
username
}
=
this
.
props
;
if
(
!
subscriptions
&&
username
&&
username
!=
prevProps
.
username
)
getSubscriptions
(
username
);
if
(
!
subscriptions
&&
username
&&
username
!=
=
prevProps
.
username
)
getSubscriptions
(
username
);
}
render
()
{
const
{
topics
,
subscriptions
,
enableAds
,
community
,
username
,
blogmode
,
isBrowser
,
children
}
=
this
.
props
;
topics
,
subscriptions
,
enableAds
,
community
,
username
,
blogmode
,
isBrowser
,
children
}
=
this
.
props
;
return
(
<
div
className
=
{
'
PostsIndex row
'
+
(
blogmode
?
'
layout-block
'
:
'
layout-list
'
)
}
>
...
...
@@ -77,13 +83,21 @@ class PostsIndexLayout extends React.Component {
}
}
PostsIndexLayout
.
propTypes
=
propTypes
;
PostsIndexLayout
.
defaultProps
=
defaultProps
;
export
default
connect
(
(
state
,
props
)
=>
{
const
username
=
state
.
user
.
getIn
([
'
current
'
,
'
username
'
])
||
state
.
offchain
.
get
(
'
account
'
);
let
community
=
state
.
global
.
getIn
([
'
community
'
,
props
.
category
],
null
);
if
(
typeof
community
===
'
string
'
)
{
community
=
null
;
}
return
{
blogmode
:
props
.
blogmode
,
enableAds
:
props
.
enableAds
,
community
:
state
.
global
.
getIn
([
'
community
'
,
props
.
category
],
null
)
,
community
,
subscriptions
:
state
.
global
.
getIn
([
'
subscriptions
'
,
username
],
null
),
topics
:
state
.
global
.
getIn
([
'
topics
'
],
List
()),
isBrowser
:
process
.
env
.
BROWSER
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment