+
diff --git a/src/ui/component/commentsList/index.js b/src/ui/component/commentsList/index.js
index 1cda71ebc..324fe767b 100644
--- a/src/ui/component/commentsList/index.js
+++ b/src/ui/component/commentsList/index.js
@@ -1,15 +1,15 @@
import { connect } from 'react-redux';
-import { makeSelectCommentsForUri, makeSelectClaimForUri, doCommentList } from 'lbry-redux';
+import { makeSelectCommentsForUri, doCommentList } from 'lbry-redux';
import CommentsList from './view';
const select = (state, props) => ({
comments: makeSelectCommentsForUri(props.uri)(state),
- claim: makeSelectClaimForUri(props.uri)(state),
});
const perform = dispatch => ({
- fetchList: uri => dispatch(doCommentList(uri)),
+ fetchComments: uri => dispatch(doCommentList(uri)),
});
+
export default connect(
select,
perform
diff --git a/src/ui/component/commentsList/view.jsx b/src/ui/component/commentsList/view.jsx
index 23f723681..bc4cfbaa7 100644
--- a/src/ui/component/commentsList/view.jsx
+++ b/src/ui/component/commentsList/view.jsx
@@ -1,86 +1,38 @@
// @flow
-import * as React from 'react';
-import relativeDate from 'tiny-relative-date';
+import React, { useEffect } from 'react';
+import Comment from 'component/comment';
-type CommentListProps = {
+type Props = {
comments: Array
,
- fetchList: string => void,
+ fetchComments: string => void,
uri: string,
- isLoading: boolean,
};
-type CommentProps = {
- commentId: string,
- claimId: string,
- author: string,
- message: string,
- parentId: number,
- timePosted: number,
-};
+function CommentList(props: Props) {
+ const { fetchComments, uri, comments } = props;
-class CommentList extends React.PureComponent {
- componentDidMount() {
- this.fetchComments(this.props);
- }
+ useEffect(() => {
+ fetchComments(uri);
+ }, [fetchComments, uri]);
- fetchComments = (props: CommentListProps) => {
- const { fetchList, uri } = props;
- fetchList(uri);
- };
-
- render() {
- const { comments } = this.props;
-
- if (!comments) {
- return null;
- }
-
- return (
-
-
- {comments.map(comment => {
- return (
-
- );
- })}
-
-
- );
- }
-}
-
-class Comment extends React.PureComponent {
- render() {
- return (
-
-
- {this.props.author && {this.props.author}}
- {!this.props.author && Anonymous}
-
-
-
-
- {this.props.message}
- {/* The following is for adding threaded replies, upvoting and downvoting */}
- {/* */}
- {/* */}
-
- {/* */}
- {/* */}
- {/* */}
- {/* */}
- {/*
*/}
-
- );
- }
+ return (
+
+ {comments &&
+ comments.map(comment => {
+ return (
+
+ );
+ })}
+
+ );
}
export default CommentList;
diff --git a/src/ui/component/common/form-components/form-field.jsx b/src/ui/component/common/form-components/form-field.jsx
index 17deb99ca..37a9e55e2 100644
--- a/src/ui/component/common/form-components/form-field.jsx
+++ b/src/ui/component/common/form-components/form-field.jsx
@@ -154,6 +154,7 @@ export class FormField extends React.PureComponent {
} else if (type === 'textarea') {
input = (
+
);
diff --git a/src/ui/component/fileViewer/view.jsx b/src/ui/component/fileViewer/view.jsx
index 58110f3a0..bb2402668 100644
--- a/src/ui/component/fileViewer/view.jsx
+++ b/src/ui/component/fileViewer/view.jsx
@@ -76,6 +76,8 @@ class FileViewer extends React.PureComponent {
}
this.handleAutoplay(this.props);
+ // Commented out because it would play/pause if you were typing in the comment field
+ // Need a way to check if you are typing
// window.addEventListener('keydown', this.handleKeyDown);
}
diff --git a/src/ui/component/selectChannel/view.jsx b/src/ui/component/selectChannel/view.jsx
index b0bd6e1b1..768bd5d97 100644
--- a/src/ui/component/selectChannel/view.jsx
+++ b/src/ui/component/selectChannel/view.jsx
@@ -157,7 +157,13 @@ class ChannelSection extends React.PureComponent {
) : (
-
+
{channels.map(({ name }) => (
diff --git a/src/ui/redux/actions/app.js b/src/ui/redux/actions/app.js
index a3b58135d..7be2c2f73 100644
--- a/src/ui/redux/actions/app.js
+++ b/src/ui/redux/actions/app.js
@@ -373,7 +373,7 @@ export function doChangeVolume(volume) {
});
};
}
-// HERE
+
export function doClickCommentButton() {
return {
type: ACTIONS.ADD_COMMENT,
diff --git a/src/ui/redux/reducers/app.js b/src/ui/redux/reducers/app.js
index a08a19e24..04f81e434 100644
--- a/src/ui/redux/reducers/app.js
+++ b/src/ui/redux/reducers/app.js
@@ -195,7 +195,6 @@ reducers[ACTIONS.CLEAR_UPGRADE_TIMER] = state =>
Object.assign({}, state, {
checkUpgradeTimer: undefined,
});
-// HERE
reducers[ACTIONS.ADD_COMMENT] = state =>
Object.assign({}, state, {
diff --git a/src/ui/scss/component/_card.scss b/src/ui/scss/component/_card.scss
index 65b523b87..e22e168d9 100644
--- a/src/ui/scss/component/_card.scss
+++ b/src/ui/scss/component/_card.scss
@@ -25,10 +25,6 @@
.card--section {
position: relative;
padding: var(--spacing-large);
-
- .card__content:not(:last-of-type) {
- margin-bottom: var(--spacing-large);
- }
}
.card--space-between {
@@ -100,6 +96,10 @@
// C O N T E N T
.card__content {
+ &:not(:last-of-type) {
+ margin-bottom: var(--spacing-medium);
+ }
+
p:not(:last-child) {
margin-bottom: var(--spacing-medium);
}
diff --git a/src/ui/scss/component/_comments.scss b/src/ui/scss/component/_comments.scss
index 7f7c65367..80f8f2ca8 100644
--- a/src/ui/scss/component/_comments.scss
+++ b/src/ui/scss/component/_comments.scss
@@ -1,16 +1,9 @@
+.comments {
+ margin-top: var(--spacing-large);
+}
+
.comment {
- padding-bottom: var(--spacing-vertical-large);
-
- &.reply {
- border-left: 3px solid var(--lbry-teal-5);
- padding-left: var(--spacing-vertical-large);
- position: relative;
- top: -1px;
- }
-
- &:not(:first-of-type) {
- padding-top: var(--spacing-vertical-large);
- }
+ padding: var(--spacing-medium) 0;
&:not(:last-of-type) {
border-bottom: 1px solid var(--lbry-gray-1);
@@ -21,44 +14,39 @@
}
}
-.comment__actions-wrap {
- align-items: center;
- display: flex;
- justify-content: space-between;
- width: 4.5rem;
-}
+// .comment__actions-wrap {
+// align-items: center;
+// display: flex;
+// justify-content: space-between;
+// width: 4.5rem;
+// }
-.comment__action {
- @include hide-text;
- width: 0; height: 0;
- transition: border-color 0.2s;
+// .comment__action {
+// @include hide-text;
+// width: 0;
+// height: 0;
+// transition: border-color 0.2s;
- &.downvote {
- border-top: 2rem solid var(--lbry-orange-3);
- border-right: 1rem solid transparent;
- border-left: 1rem solid transparent;
+// &.downvote {
+// border-top: 2rem solid var(--lbry-orange-3);
+// border-right: 1rem solid transparent;
+// border-left: 1rem solid transparent;
- &:hover {
- border-top-color: var(--lbry-yellow-3);
- }
- }
+// &:hover {
+// border-top-color: var(--lbry-yellow-3);
+// }
+// }
- &.upvote {
- border-right: 1rem solid transparent;
- border-bottom: 2rem solid var(--lbry-teal-4);
- border-left: 1rem solid transparent;
+// &.upvote {
+// border-right: 1rem solid transparent;
+// border-bottom: 2rem solid var(--lbry-teal-4);
+// border-left: 1rem solid transparent;
- &:hover {
- border-bottom-color: var(--lbry-green-2);
- }
- }
-}
-
-.comment__content {
- font-size: 1.15rem;
- padding-top: var(--spacing-vertical-medium);
- padding-bottom: var(--spacing-vertical-large);
-}
+// &:hover {
+// border-bottom-color: var(--lbry-green-2);
+// }
+// }
+// }
.comment__meta {
time {
diff --git a/src/ui/util/use-persisted-state.js b/src/ui/util/use-persisted-state.js
index 6e67db732..c0fb2a1a9 100644
--- a/src/ui/util/use-persisted-state.js
+++ b/src/ui/util/use-persisted-state.js
@@ -4,7 +4,12 @@ export default function usePersistedState(key, firstTimeDefault) {
// If no key is passed in, act as a normal `useState`
let defaultValue;
if (key) {
- defaultValue = localStorage.getItem(key);
+ const item = localStorage.getItem(key);
+ if (item === 'true') {
+ defaultValue = true;
+ } else if (item === 'false') {
+ defaultValue = false;
+ }
}
if (!defaultValue) {
diff --git a/static/locales/en.json b/static/locales/en.json
index d884dab65..ed603704b 100644
--- a/static/locales/en.json
+++ b/static/locales/en.json
@@ -311,6 +311,10 @@
"Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.": "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.",
"If you still have issues, your anti-virus software or firewall may be preventing startup.": "If you still have issues, your anti-virus software or firewall may be preventing startup.",
"Reach out to hello@lbry.com for help, or check out": "Reach out to hello@lbry.com for help, or check out",
- "Got it!": "Got it!"
-}
->>>>>>> comments cleanup
+ "Got it!": "Got it!",
+ "URI does not include name.": "URI does not include name.",
+ "Invalid claim ID %s.": "Invalid claim ID %s.",
+ "Comment": "Comment",
+ "Channel": "Channel",
+ "Comments": "Comments"
+}>>>>>>> comments cleanup