Skip to content

Commit

Permalink
fix: replace hardcoded colors with theme colors 3
Browse files Browse the repository at this point in the history
  • Loading branch information
SPageot committed Jun 7, 2022
1 parent bcc2378 commit 00b46a2
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/components/blocks/AuditItemModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import dayjs from 'dayjs';

import { Modal, modalTypeEnum, Body } from '..';
import { convertPascalCaseToSentenceCase } from '../../utils/stringUtils';
import theme from '../../theme';

const StyledContainer = styled('div')`
padding: 16px 21px;
Expand All @@ -27,7 +28,7 @@ const AuditItemModal = ({ onClose, auditItem }) => {
const intl = useIntl();
const change = auditItem.change && JSON.parse(auditItem.change);

const bodyColor = auditItem.type === 'INSERT' ? '#52C41A' : '#F5222D';
const bodyColor = auditItem.type === 'INSERT' ? '#52C41A' : theme.colors.default.status.error.primary;

return (
<>
Expand Down
6 changes: 3 additions & 3 deletions src/components/blocks/DateSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ const InputContainer = styled('div')`
${props => {
if (props.variant === DateVariantEnum.error) {
return css`
border: 1px solid #f5222d;
border: 1px solid ${props.theme.colors.default.status.error.primary};
:focus-within {
border: 1px solid #f5222d;
border: 1px solid ${props.theme.colors.default.status.error.primary};
box-shadow: 0px 0px 4px rgba(245, 34, 45, 0.5);
}
:hover {
border: 1px solid #f5222d;
border: 1px solid ${props.theme.colors.default.status.error.primary};
}
`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/ProjectDetailsStagingViewTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ProjectDetailsStagingViewTab = ({ entry }) => {
const getOriginalColorForKey = (entryProp, action) => {
if (entryProp) {
if (action === 'DELETE') {
return '#f5222d';
return theme.colors.default.status.error.primary;
}
if (action === 'INSERT') {
return '#52C41A';
Expand Down
4 changes: 2 additions & 2 deletions src/components/blocks/StagingDataGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ const StyledChangeCardTitle = styled('div')`
${props =>
props.displayInRed
? ` background-color: #ffebee;
border: 2px solid #f5222d;
border: 2px solid ${props.theme.colors.default.status.error.primary};
body {
color: #f5222d;
color: ${props.theme.colors.default.status.error.primary};
}`
: ` background-color: #ECF8E6;
border: 2px solid #52C41A;
Expand Down
4 changes: 2 additions & 2 deletions src/components/blocks/StagingDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const Tr = styled('tr')`
} else if (props.color === 'red') {
return `
background: #FFEBEE;
border: 1px solid #F5222D;
border: 1px solid ${props.theme.colors.default.status.error.primary}
p, span {
color: #F5222D !important;
color: ${props.theme.colors.default.status.error.primary} !important;
};
`;
} else if (props.color === 'gray') {
Expand Down
4 changes: 3 additions & 1 deletion src/components/blocks/TableDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ const StyledDetails = styled('div')`
align-items: center;
gap: 5px;
${props => props.isGreen && `body {color: #52C41A}`};
${props => props.isRed && `body {color: #f5222d}`};
${props =>
props.isRed &&
`body {color: ${props.theme.colors.default.status.error.primary}}`};
`;

const StyledValuesContainer = styled('div')`
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/UnitsDetailStagingViewTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const UnitsDetailStagingViewTab = ({ entry }) => {
const getOriginalColorForKey = (entryProp, action) => {
if (entryProp) {
if (action === 'DELETE') {
return '#f5222d';
return theme.colors.default.status.error.primary;
}
if (action === 'INSERT') {
return '#52C41A';
Expand Down
6 changes: 3 additions & 3 deletions src/components/blocks/YearSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ const InputContainer = styled('div')`
${props => {
if (props.variant === DateVariantEnum.error) {
return css`
border: 1px solid #f5222d;
border: 1px solid ${props.theme.colors.default.status.error.primary};
:focus-within {
border: 1px solid #f5222d;
border: 1px solid ${props.theme.colors.default.status.error.primary};
box-shadow: 0px 0px 4px rgba(245, 34, 45, 0.5);
}
:hover {
border: 1px solid #f5222d;
border: 1px solid ${props.theme.colors.default.status.error.primary};
}
`;
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/form/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const StyledSelect = styled('div')`
color: #262626;
box-sizing: border-box;
border: 0.0625rem solid #d9d9d9;
background: ${props => props.theme.colors.default.onButton}
background: ${props => props.theme.colors.default.onButton};
z-index: 5;
user-select: none;
align-items: center;
Expand Down Expand Up @@ -115,7 +115,7 @@ const StyledBasicMenu = styled(ScrollContainer)`
position: absolute;
padding: 0.25rem 0rem 0.25rem 0rem;
top: ${props => (props.top ? props.top + 10 + 'px' : '10px')};
background: ${props => props.theme.colors.default.onButton}
background: ${props => props.theme.colors.default.onButton};
box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05),
0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
border-radius: 0.125rem;
Expand All @@ -141,7 +141,7 @@ const StyledBasicMenuItem = styled('div')`
${props => {
if (props.isSelected) {
return `
background-color: #E6F7FF;
background-color: ${props.theme.colors.default.status.info.secondary};
font-style: normal;
font-weight: 600;
`;
Expand Down
6 changes: 3 additions & 3 deletions src/components/form/SelectOrganizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const StyledSelect = styled('div')`
color: #262626;
box-sizing: border-box;
border: 0.0625rem solid #d9d9d9;
background: ${props => props.theme.colors.default.onButton}
background: ${props => props.theme.colors.default.onButton};
z-index: 5;
user-select: none;
align-items: center;
Expand Down Expand Up @@ -95,7 +95,7 @@ const StyledBasicMenu = styled(ScrollContainer)`
position: absolute;
padding: 0.25rem 0rem 0.25rem 0rem;
top: ${props => (props.top ? props.top + 10 + 'px' : '10px')};
background: ${props => props.theme.colors.default.onButton}
background: ${props => props.theme.colors.default.onButton};
box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05),
0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
border-radius: 0.125rem;
Expand All @@ -121,7 +121,7 @@ const StyledBasicMenuItem = styled('div')`
${props => {
if (props.isSelected) {
return `
background-color: #E6F7FF;
background-color: ${props.theme.colors.default.status.info.secondary};
font-style: normal;
font-weight: 600;
`;
Expand Down
6 changes: 3 additions & 3 deletions src/components/form/SimpleSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const StyledSelect = styled('div')`
color: #262626;
box-sizing: border-box;
border: 0.0625rem solid #d9d9d9;
background: ${props => props.theme.colors.default.onButton}
background: ${props => props.theme.colors.default.onButton};
z-index: 5;
user-select: none;
align-items: center;
Expand Down Expand Up @@ -118,7 +118,7 @@ const StyledBasicMenu = styled(ScrollContainer)`
position: absolute;
padding: 0.25rem 0rem 0.25rem 0rem;
top: ${props => (props.top ? props.top + 10 + 'px' : '10px')};
background: ${props => props.theme.colors.default.onButton}
background: ${props => props.theme.colors.default.onButton};
box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05),
0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
border-radius: 0.125rem;
Expand All @@ -144,7 +144,7 @@ const StyledBasicMenuItem = styled('div')`
${props => {
if (props.isSelected) {
return `
background-color: #E6F7FF;
background-color: ${props.theme.colors.default.status.info.secondary};
font-style: normal;
font-weight: 600;
`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const BodyText = styled('div')`
max-width: calc(100% - 3rem);
width: calc(100% - 3rem);
margin: 1.5rem;
background-color: ${props => props.theme.colors.default.onButton}
background-color: ${props => props.theme.colors.default.onButton};
overflow: hidden;
box-sizing: border-box;
padding: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Audit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const StyledTable = styled('table')`
const StyledTh = styled('th')`
text-align: start;
padding: 17px;
background-color: #e6f7ff;
background-color: ${props => props.theme.colors.default.status.info.secondary};
position: sticky;
top: 0;
`;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Conflicts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const StyledTable = styled('table')`
const StyledTh = styled('th')`
text-align: start;
padding: 17px;
background-color: #e6f7ff;
background-color: ${props => props.theme.colors.default.info.secondary};
position: sticky;
top: 0;
`;
Expand Down

0 comments on commit 00b46a2

Please sign in to comment.