Skip to content

Commit

Permalink
Moderation: expand content by default (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree authored Aug 30, 2023
1 parent 12c0e07 commit e77cc20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/Moderation/Moderation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class Moderation extends React.PureComponent {
renderAction(action) {
return (
<div className="box moderation-entry">
<UserAction action={action} />
<UserAction action={action} defaultExpanded />
<br />
<h4 className="box has-text-centered">
<Link
Expand Down
11 changes: 9 additions & 2 deletions app/components/UsersActions/UserAction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@ const getActionDescription = (t, action, viewingFrom) => {
}
}

const UserAction = ({ action, className, t, withoutUser, viewingFrom }) => {
const [isExpanded, setExpanded] = React.useState(false)
const UserAction = ({
action,
className,
t,
withoutUser,
viewingFrom,
defaultExpanded = false,
}) => {
const [isExpanded, setExpanded] = React.useState(defaultExpanded)
const { user, type, time } = action
const reputationChange = getReputationChange(viewingFrom, action)

Expand Down

0 comments on commit e77cc20

Please sign in to comment.