Skip to content

Commit

Permalink
fix comment area display (#7716)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessopb authored Nov 4, 2022
1 parent 35769de commit d3900e3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 34 deletions.
25 changes: 0 additions & 25 deletions ui/component/commentCreate/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,31 +363,6 @@ export function CommentCreate(props: Props) {
.catch(() => {});
}, [canReceiveFiatTip, claim.claim_id, claim.name, claim.signing_channel, stickerSelector]);

// LIVESTREAM ONLY - REMOVE
// Handle keyboard shortcut comment creation
// React.useEffect(() => {
// function altEnterListener(e: SyntheticKeyboardEvent<*>) {
// const inputRef = formFieldRef && formFieldRef.current && formFieldRef.current.input;
//
// if (inputRef && inputRef.current === document.activeElement) {
// // $FlowFixMe
// const isTyping = e.target.attributes['term'];
//
// if (((isLivestream && !isTyping) || e.ctrlKey || e.metaKey) && e.keyCode === KEYCODES.ENTER) {
// e.preventDefault();
// buttonRef.current.click();
// }
// }
// }
//
// window.addEventListener('keydown', altEnterListener);
//
// // removes the listener so it doesn't cause problems elsewhere in the app
// return () => {
// window.removeEventListener('keydown', altEnterListener);
// };
// }, [isLivestream]);

// **************************************************************************
// Render
// **************************************************************************
Expand Down
15 changes: 8 additions & 7 deletions ui/component/commentsList/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ const CommentActionButtons = (actionButtonsProps: ActionButtonsProps) => {
const sortButtonProps = { activeSort: sort, changeSort };

return (
<>
<div className={'comment__actions-row'}>
{totalComments > 1 && ENABLE_COMMENT_REACTIONS && (
<span className="comment__sort">
<div className="comment__sort-group">
<SortButton {...sortButtonProps} label={__('Best')} icon={ICONS.BEST} sortOption={SORT_BY.POPULARITY} />
<SortButton
{...sortButtonProps}
Expand All @@ -377,11 +377,9 @@ const CommentActionButtons = (actionButtonsProps: ActionButtonsProps) => {
sortOption={SORT_BY.CONTROVERSY}
/>
<SortButton {...sortButtonProps} label={__('New')} icon={ICONS.NEW} sortOption={SORT_BY.NEWEST} />
</span>
</div>
)}
<div className="button_refresh">
<Button button="alt" icon={ICONS.REFRESH} title={__('Refresh')} onClick={() => setPage(0)} />
</div>

{allServers.length >= 2 && (
<div className="button__selected-server">
<FormField
Expand All @@ -408,7 +406,10 @@ const CommentActionButtons = (actionButtonsProps: ActionButtonsProps) => {
</FormField>
</div>
)}
</>
<div className="button_refresh">
<Button button="alt" icon={ICONS.REFRESH} title={__('Refresh')} onClick={() => setPage(0)} />
</div>
</div>
);
};

Expand Down
2 changes: 1 addition & 1 deletion ui/component/fileThumbnail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const select = (state, props) => {
if (claimUriBeingPlayed) {
const claim = makeSelectClaimForUri(props.uri)(state);
const claimBeingPlayed = makeSelectClaimForUri(claimUriBeingPlayed)(state);
isBeingPlayed = claim.claim_id === claimBeingPlayed.claim_id;
isBeingPlayed = claim && claim.claim_id === claimBeingPlayed.claim_id;
}

return {
Expand Down
2 changes: 1 addition & 1 deletion ui/scss/component/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@

@media (max-width: $breakpoint-small) {
font-size: var(--font-small);

border-bottom: none;
.button--link {
font-size: var(--font-xsmall);
margin: 0px;
Expand Down
6 changes: 6 additions & 0 deletions ui/scss/component/_comments.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ $thumbnailWidthSmall: 1rem;
}
}

.comment__actions-row {
display: flex;
flex-direction: row;
justify-content: flex-end;
}

.comment {
width: 100%;
display: flex;
Expand Down

0 comments on commit d3900e3

Please sign in to comment.