forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs COMMS-1844 Test Plan: - Go to the comments tab on A2 student view with a submission and submission comments - click on the comments tab - notice the comments that are shown and are accessible - navigate to the page with anynonmous peer review on - notice the avatar and name show up correctly Change-Id: I19b280e83b043ee170896c7f7b54ccc72e1442b9 Reviewed-on: https://gerrit.instructure.com/180321 Reviewed-by: Landon Gilbert-Bland <[email protected]> QA-Review: Landon Gilbert-Bland <[email protected]> Tested-by: Jenkins Product-Review: Steven Burnett <[email protected]>
- Loading branch information
Showing
6 changed files
with
102 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
app/jsx/assignments_2/student/components/Comments/CommentRow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (C) 2019 - present Instructure, Inc. | ||
* | ||
* This file is part of Canvas. | ||
* | ||
* Canvas is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU Affero General Public License as published by the Free | ||
* Software Foundation, version 3 of the License. | ||
* | ||
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY | ||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License along | ||
* with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
import I18n from 'i18n!assignments_2' | ||
import React from 'react' | ||
import {CommentShape} from '../../assignmentData' | ||
import Avatar from '@instructure/ui-elements/lib/components/Avatar' | ||
import Text from '@instructure/ui-elements/lib/components/Text' | ||
import FriendlyDatetime from '../../../../shared/FriendlyDatetime' | ||
|
||
function CommentRow(props) { | ||
const author = props.comment.author | ||
return ( | ||
<div className="comment-row-container"> | ||
<div className="comment-avatar-container"> | ||
<Avatar | ||
name={author ? author.shortName : I18n.t('Anonymous')} | ||
src={author ? author.avatarUrl : ''} | ||
margin="0 small 0 0" | ||
/> | ||
</div> | ||
<div className="comment-text-comment-container"> | ||
<Text weight="light" size="small"> | ||
{author ? author.shortName : I18n.t('Anonymous')}{' '} | ||
<FriendlyDatetime | ||
prefix={I18n.t('at')} | ||
format={I18n.t('#date.formats.full_with_weekday')} | ||
dateTime={props.comment.updatedAt} | ||
/> | ||
</Text> | ||
<Text>{props.comment.comment}</Text> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
CommentRow.propTypes = { | ||
comment: CommentShape.isRequired | ||
} | ||
|
||
export default React.memo(CommentRow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters