Compare commits
4 Commits
open-relea
...
sundas/INF
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8e1d10bd6 | ||
|
|
b0be519e13 | ||
|
|
f1a9922d29 | ||
|
|
009417bb57 |
@@ -8,13 +8,14 @@ import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
|
||||
import { Alert } from '@edx/paragon';
|
||||
import { Report } from '@edx/paragon/icons';
|
||||
|
||||
import { AvatarOutlineAndLabelColors } from '../../data/constants';
|
||||
import {
|
||||
selectModerationSettings, selectUserHasModerationPrivileges, selectUserIsGroupTa, selectUserIsStaff,
|
||||
} from '../data/selectors';
|
||||
import { commentShape } from '../post-comments/comments/comment/proptypes';
|
||||
import messages from '../post-comments/messages';
|
||||
import { postShape } from '../posts/post/proptypes';
|
||||
import AuthorLabel from './AuthorLabel';
|
||||
import AlertBar from './AlertBar';
|
||||
|
||||
function AlertBanner({
|
||||
intl,
|
||||
@@ -29,6 +30,8 @@ function AlertBanner({
|
||||
const canSeeLastEditOrClosedAlert = (userHasModerationPrivileges || userIsGroupTa
|
||||
|| userIsGlobalStaff || userIsContentAuthor
|
||||
);
|
||||
const editByLabelColor = AvatarOutlineAndLabelColors[content.editByLabel];
|
||||
const closedByLabelColor = AvatarOutlineAndLabelColors[content.closedByLabel];
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -40,40 +43,22 @@ function AlertBanner({
|
||||
{reasonCodesEnabled && canSeeLastEditOrClosedAlert && (
|
||||
<>
|
||||
{content.lastEdit?.reason && (
|
||||
<Alert variant="info" className="px-3 shadow-none mb-1 py-10px bg-light-200">
|
||||
<div className="d-flex align-items-center flex-wrap text-gray-700 font-style">
|
||||
{intl.formatMessage(messages.editedBy)}
|
||||
<span className="ml-1 mr-3">
|
||||
<AuthorLabel author={content.lastEdit.editorUsername} linkToProfile postOrComment />
|
||||
</span>
|
||||
<span
|
||||
className="mx-1.5 font-size-8 font-style text-light-700"
|
||||
style={{ lineHeight: '15px' }}
|
||||
>
|
||||
{intl.formatMessage(messages.fullStop)}
|
||||
</span>
|
||||
{intl.formatMessage(messages.reason)}: {content.lastEdit.reason}
|
||||
</div>
|
||||
</Alert>
|
||||
<AlertBar
|
||||
message={messages.editedBy}
|
||||
author={content.lastEdit.editorUsername}
|
||||
authorLabel={content.editByLabel}
|
||||
labelColor={editByLabelColor && `text-${editByLabelColor}`}
|
||||
reason={content.lastEdit.reason}
|
||||
/>
|
||||
)}
|
||||
{content.closed && (
|
||||
<Alert variant="info" className="px-3 shadow-none mb-1 py-10px bg-light-200">
|
||||
<div className="d-flex align-items-center flex-wrap text-gray-700 font-style">
|
||||
{intl.formatMessage(messages.closedBy)}
|
||||
<span className="ml-1 ">
|
||||
<AuthorLabel author={content.closedBy} linkToProfile postOrComment />
|
||||
</span>
|
||||
<span
|
||||
className="mx-1.5 font-size-8 font-style text-light-700"
|
||||
style={{ lineHeight: '15px' }}
|
||||
>
|
||||
{intl.formatMessage(messages.fullStop)}
|
||||
</span>
|
||||
|
||||
{content.closeReason && (`${intl.formatMessage(messages.reason)}: ${content.closeReason}`)}
|
||||
|
||||
</div>
|
||||
</Alert>
|
||||
<AlertBar
|
||||
message={messages.closedBy}
|
||||
author={content.closedBy}
|
||||
authorLabel={content.closedByLabel}
|
||||
labelColor={closedByLabelColor && `text-${closedByLabelColor}`}
|
||||
reason={content.closeReason}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
60
src/discussions/common/AlertBar.jsx
Normal file
60
src/discussions/common/AlertBar.jsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
|
||||
import { Alert } from '@edx/paragon';
|
||||
|
||||
import messages from '../post-comments/messages';
|
||||
import AuthorLabel from './AuthorLabel';
|
||||
|
||||
function AlertBar({
|
||||
intl,
|
||||
message,
|
||||
author,
|
||||
authorLabel,
|
||||
labelColor,
|
||||
reason,
|
||||
}) {
|
||||
return (
|
||||
<Alert variant="info" className="px-3 shadow-none mb-1 py-10px bg-light-200">
|
||||
<div className="d-flex align-items-center flex-wrap text-gray-700 font-style">
|
||||
{intl.formatMessage(message)}
|
||||
<span className="ml-1">
|
||||
<AuthorLabel
|
||||
author={author}
|
||||
authorLabel={authorLabel}
|
||||
labelColor={labelColor}
|
||||
linkToProfile
|
||||
postOrComment
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
className="mr-1.5 font-size-8 font-style text-light-700"
|
||||
style={{ lineHeight: '15px' }}
|
||||
>
|
||||
{intl.formatMessage(messages.fullStop)}
|
||||
</span>
|
||||
{reason && (`${intl.formatMessage(messages.reason)}: ${reason}`)}
|
||||
</div>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
AlertBar.propTypes = {
|
||||
intl: intlShape.isRequired,
|
||||
message: PropTypes.string,
|
||||
author: PropTypes.string,
|
||||
authorLabel: PropTypes.string,
|
||||
labelColor: PropTypes.string,
|
||||
reason: PropTypes.string,
|
||||
};
|
||||
|
||||
AlertBar.defaultProps = {
|
||||
message: '',
|
||||
author: '',
|
||||
authorLabel: '',
|
||||
labelColor: '',
|
||||
reason: '',
|
||||
};
|
||||
|
||||
export default injectIntl(AlertBar);
|
||||
@@ -315,6 +315,8 @@ header {
|
||||
#courseTabsNavigation {
|
||||
font-size: 18px;
|
||||
font-family: Inter, Helvetica Neue, Arial, sans-serif;
|
||||
z-index: 3;
|
||||
background-color: #fff;
|
||||
|
||||
.container-xl {
|
||||
padding-left: 31px;
|
||||
@@ -336,7 +338,7 @@ header {
|
||||
|
||||
.header-action-bar {
|
||||
background-color: #fff;
|
||||
z-index: 2;
|
||||
z-index: 3;
|
||||
box-shadow: 0px 2px 4px rgb(0 0 0 / 15%), 0px 2px 8px rgb(0 0 0 / 15%);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@@ -414,7 +416,7 @@ header {
|
||||
max-width: fit-content;
|
||||
margin-left: auto;
|
||||
margin-top: -2.063rem;
|
||||
z-index: 1;
|
||||
z-index: 2;
|
||||
right: 32px;
|
||||
}
|
||||
|
||||
@@ -518,3 +520,13 @@ header {
|
||||
font-size: 18px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.usabilla_live_button_container{
|
||||
right: 0px !important;
|
||||
}
|
||||
|
||||
.learning-header{
|
||||
z-index: 4;
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user