Skip to content

Commit

Permalink
global: add general color class names
Browse files Browse the repository at this point in the history
  • Loading branch information
jennur authored and kpsherva committed Jul 8, 2022
1 parent 4d17e19 commit 99d188c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/Access/ProtectionButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class ProtectionButtonsComponent extends Component {
render() {
const { active, disabled } = this.props;

const publicColor = active ? { color: 'green' } : {};
const restrictedColor = !active ? { color: 'red' } : {};
const publicColor = active ? 'positive' : '';
const restrictedColor = !active ? 'negative' : '';

return (
<Button.Group widths="2">
<Button
{...publicColor}
className={publicColor}
data-testid="protection-buttons-component-public"
disabled={disabled}
onClick={this.handlePublicButtonClick}
Expand All @@ -46,7 +46,7 @@ class ProtectionButtonsComponent extends Component {
{i18next.t('Public')}
</Button>
<Button
{...restrictedColor}
className={restrictedColor}
data-testid="protection-buttons-component-restricted"
active={!active}
onClick={this.handleRestrictionButtonClick}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/DeleteButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ export class DeleteButtonComponent extends Component {
} else {
actionLbl = DISCARD_CHANGES_LBL;
}
const color = { color: isPublished ? 'yellow' : 'red' };
const color = isPublished ? 'warning' : 'negative' ;
const capitalizedActionLbl = toCapitalCase(actionLbl);

return (
<>
<Button
disabled={!draftExists || isSubmitting}
onClick={this.openConfirmModal}
{...color}
className={color}
icon
loading={isSubmitting && actionState === DRAFT_DELETE_STARTED}
labelPosition="left"
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/DepositStatus/DepositStatusBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const STATUSES = {
),
},
[DepositStatus.EXPIRED]: {
color: 'light orange',
color: 'expired',
title: i18next.t('Expired'),
message: i18next.t(
'The request to submit this upload to the community has expired.'
Expand All @@ -38,21 +38,21 @@ const STATUSES = {
message: i18next.t('Your upload is published.'),
},
[DepositStatus.DRAFT_WITH_REVIEW]: {
color: 'light grey',
color: 'neutral',
title: i18next.t('Draft'),
message: i18next.t(
'Once your upload is complete, you can submit it for review to the community curators.'
),
},
[DepositStatus.DRAFT]: {
color: 'light grey',
color: 'neutral',
title: i18next.t('Draft'),
message: i18next.t(
'Once your upload is complete, you can publish or submit it for review to the community curators.'
),
},
[DepositStatus.NEW_VERSION_DRAFT]: {
color: 'light grey',
color: 'neutral',
title: i18next.t('New version draft'),
message: i18next.t('Once your upload is complete, you can publish it.'),
},
Expand Down
6 changes: 2 additions & 4 deletions src/lib/components/FileUploader/FileUploaderArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ const FileTableRow = ({
<Table.Cell className="file-upload-pending" data-label={i18next.t('Progress')} width={2}>
{!file.uploadState?.isPending && (
<Progress
className="file-upload-progress"
className="file-upload-progress primary"
percent={file.progressPercentage}
error={file.uploadState.isFailed}
size="medium"
color="blue"
progress
autoSuccess
active
Expand All @@ -146,9 +145,8 @@ const FileTableRow = ({
) : (
<Icon
link
className="action"
className="action primary"
name="trash alternate outline"
color="blue"
disabled={isDeleting}
onClick={() => handleDelete(file)}
aria-label={i18next.t("Delete file")}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/FileUploader/FileUploaderToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const FileUploaderToolbar = ({
</List.Item>
<List.Item>
<Popup
trigger={<Icon name="question circle outline" color="grey" />}
trigger={<Icon name="question circle outline" className="neutral" />}
content={i18next.t('Disable files for this record')}
position="top center"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Identifiers/PIDField.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ReservePIDBtn extends Component {
<Field>
{({ form: formik }) => (
<Form.Button
color="green"
className="positive"
size="mini"
loading={loading}
disabled={disabled || loading}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/NewVersionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const NewVersionButton = ({ onError, record, disabled, ...uiProps }) => {
trigger={
<Button
type="button"
color="green"
positive
size="mini"
onClick={handleClick}
loading={loading}
Expand Down

0 comments on commit 99d188c

Please sign in to comment.