Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Mobile
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
169
Merge Requests
14
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Compare Revisions
6a631eba0c691dc8fbfd6a7c9297a32469d8205f...75a7a614a940a1c47effd6a5213994d9950e0197
Source
75a7a614a940a1c47effd6a5213994d9950e0197
...
Target
6a631eba0c691dc8fbfd6a7c9297a32469d8205f
Compare
Commits (2)
(feat) mature toggle comment poster
· 02de8cf2
Martin Santangelo
authored
3 days ago
02de8cf2
Merge branch 'feat/add-mature-toggle-comment-poster' into 'release/3.15.0'
· 75a7a614
Brian Hatchet
authored
58 minutes ago
Add mature toggle comment poster See merge request
!478
75a7a614
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
6 deletions
+37
-6
src/comments/CommentList.js
View file @
75a7a614
...
...
@@ -21,6 +21,7 @@ import { observer, inject } from 'mobx-react/native';
import
*
as
Progress
from
'
react-native-progress
'
;
import
Icon
from
'
react-native-vector-icons/Ionicons
'
;
import
IconMC
from
'
react-native-vector-icons/MaterialCommunityIcons
'
;
import
IconMd
from
'
react-native-vector-icons/MaterialIcons
'
;
import
ActionSheet
from
'
react-native-actionsheet
'
;
import
Comment
from
'
./Comment
'
;
...
...
@@ -337,7 +338,17 @@ class CommentList extends React.Component<PropsType, StateType> {
return
(
<
View
>
<
View
style
=
{[
CS
.
rowJustifyCenter
,
CS
.
margin
,
CS
.
padding
,
CS
.
backgroundWhite
,
CS
.
borderRadius12x
,
CS
.
borderGreyed
,
CS
.
borderHair
]}
testID
=
{
this
.
props
.
parent
?
'
CommentParentView
'
:
''
}
>
<
View
style
=
{[
CS
.
rowJustifyCenter
,
CS
.
margin
,
CS
.
padding
,
CS
.
backgroundWhite
,
CS
.
borderRadius12x
,
CS
.
borderGreyed
,
CS
.
borderHair
,
]}
testID
=
{
this
.
props
.
parent
?
'
CommentParentView
'
:
''
}
>
<
Image
source
=
{
avatarImg
}
style
=
{
CmpStyle
.
posterAvatar
}
/
>
<
TextInput
style
=
{[
CS
.
flexContainer
,
CS
.
marginLeft
,
inputStyle
,
{
paddingVertical
:
2
}]}
...
...
@@ -359,8 +370,22 @@ class CommentList extends React.Component<PropsType, StateType> {
(
comments
.
saving
||
attachment
.
checkingVideoLength
)
?
<
ActivityIndicator
size
=
{
'
large
'
}
/>
:
<
View
style
=
{[
CS
.
rowJustifyEnd
,
CS
.
centered
]}
>
<
TouchableOpacity
onPress
=
{
this
.
showAttachment
}
style
=
{
CS
.
paddingRight2x
}
><
Icon
name
=
"
md-attach
"
size
=
{
24
}
style
=
{
CS
.
paddingRight2x
}
/></
TouchableOpacity
>
<
TouchableOpacity
onPress
=
{
this
.
postComment
}
style
=
{
CS
.
paddingRight2x
}
testID
=
'
PostCommentButton
'
><
Icon
name
=
"
md-send
"
size
=
{
24
}
/></
TouchableOpacity
>
<
TouchableOpacity
onPress
=
{
this
.
showAttachment
}
style
=
{
CS
.
paddingRight2x
}
>
<
Icon
name
=
"
md-attach
"
size
=
{
24
}
style
=
{[
CS
.
paddingRight2x
,
CS
.
colorDarkGreyed
]}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{
comments
.
toggleMature
}
style
=
{
CS
.
paddingRight2x
}
>
<
IconMd
name
=
"
explicit
"
size
=
{
24
}
style
=
{[
CS
.
paddingRight2x
,
comments
.
mature
?
CS
.
colorDanger
:
CS
.
colorDarkGreyed
]}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{
this
.
postComment
}
style
=
{
CS
.
paddingRight2x
}
testID
=
"
PostCommentButton
"
>
<
Icon
name
=
"
md-send
"
size
=
{
24
}
style
=
{
CS
.
colorDarkGreyed
}
/
>
<
/TouchableOpacity
>
<
/View
>
}
<
/View
>
...
...
This diff is collapsed.
src/comments/CommentsStore.js
View file @
75a7a614
...
...
@@ -39,6 +39,7 @@ export default class CommentsStore {
@
observable
loaded
=
false
;
@
observable
saving
=
false
;
@
observable
text
=
''
;
@
observable
mature
=
0
;
@
observable
loadingPrevious
=
false
;
@
observable
loadingNext
=
false
;
...
...
@@ -71,6 +72,11 @@ export default class CommentsStore {
return
(
this
.
parent
&&
this
.
parent
.
child_path
)
?
this
.
parent
.
child_path
:
'
0:0:0
'
;
}
@
action
toggleMature
=
()
=>
{
this
.
mature
=
this
.
mature
?
0
:
1
;
};
/**
* Set the entity
* @param {object} entity
...
...
@@ -332,8 +338,9 @@ export default class CommentsStore {
const
comment
=
{
comment
:
this
.
text
,
parent_path
:
this
.
getParentPath
()
}
mature
:
this
.
mature
,
parent_path
:
this
.
getParentPath
(),
};
if
(
this
.
attachment
.
guid
)
{
comment
.
attachment_guid
=
this
.
attachment
.
guid
;
...
...
@@ -347,7 +354,6 @@ export default class CommentsStore {
Object
.
assign
(
comment
,
entity
.
getClientMetadata
());
try
{
const
data
=
await
postComment
(
this
.
guid
,
comment
);
this
.
pushComment
(
data
.
comment
);
...
...
This diff is collapsed.