Skip to content

Commit

Permalink
add tag configuration and another widget to mobile (#2072)
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak authored Sep 1, 2023
1 parent 1bf75ea commit 8bfebe7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ import './CommentCountBadge.scss'
export default class CommentCountBadge extends Component {
render() {
return (
<div className={classNames("comment-count-badge", this.props.className)}>
<span className={classNames("badge is-badge-outlined",
<div className={classNames("badge is-badge-outlined",
{"is-empty": this.props.comments.length === 0})}
data-badge={this.props.comments.length}>
<SvgSymbol viewBox='0 0 20 20' sym="chat-icon" />
</span>
</div>
</div>
)
}
}
Expand Down
17 changes: 15 additions & 2 deletions src/components/TaskPane/MobileTaskDetails/MobileTaskDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import TaskInstructions from '../TaskInstructions/TaskInstructions'
import TaskTrackControls from '../TaskTrackControls/TaskTrackControls'
import TaskRandomnessControl
from '../TaskRandomnessControl/TaskRandomnessControl'
import AsCooperativeWork from '../../../interactions/Task/AsCooperativeWork'
import { TaskCompletionWidget, TagDiffWidget, TaskHistoryWidget } from '../../Widgets/widget_registry'
import ChallengeShareControls
from '../ChallengeShareControls/ChallengeShareControls'
import MarkdownContent from '../../MarkdownContent/MarkdownContent'
Expand Down Expand Up @@ -61,8 +63,19 @@ export default class MobileTaskDetails extends Component {
}, {
name: "edit",
icon: "evaluate-icon",
component: () => null,
}, {
component: props => (
console.log(props.task),
<TaskCompletionWidget {...props} />
)
}, {
name: "tags",
icon: "pencil-icon",
component: props => (
AsCooperativeWork(this.props.task).isTagType() ?
<TagDiffWidget {...props} /> :
<TaskHistoryWidget {...props} />
)
}, {
name: "comments",
icon: props => <CommentCountBadge comments={_get(props, 'task.comments')} />,
component: props => (
Expand Down

0 comments on commit 8bfebe7

Please sign in to comment.