Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-8560: enforce consistent styling for add button, update "focus" state to al… #4158

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion source/frontend/src/components/common/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ export const StyledAddButton = styled(Button)`
&.btn.btn-primary:active {
background-color: ${props => props.theme.bcTokens.iconsColorSuccess};
}
&.btn.btn-primary:hover {
&.btn.btn-primary:hover,
&.btn.btn-primary:focus {
background-color: ${props => props.theme.css.pimsGreen80};
outline-color: ${props => props.theme.css.pimsGreen80};
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { Col, Row } from 'react-bootstrap';
import { FaFileExcel, FaPlus } from 'react-icons/fa';
import { useHistory } from 'react-router';
import { toast } from 'react-toastify';
import styled from 'styled-components';

import { Button } from '@/components/common/buttons/Button';
import { StyledIconButton } from '@/components/common/buttons/IconButton';
import { StyledAddButton } from '@/components/common/styles';
import TooltipWrapper from '@/components/common/TooltipWrapper';
import Claims from '@/constants/claims';
import { useApiAcquisitionFile } from '@/hooks/pims-api/useApiAcquisitionFile';
Expand Down Expand Up @@ -138,10 +137,4 @@ export const AcquisitionListView: React.FunctionComponent<
);
};

const StyledAddButton = styled(Button)`
&.btn.btn-primary {
background-color: ${props => props.theme.bcTokens.iconsColorSuccess};
}
`;

export default AcquisitionListView;
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import React, { useCallback, useEffect, useMemo } from 'react';
import { Col, Row } from 'react-bootstrap';
import { FaPlus } from 'react-icons/fa';
import { useHistory } from 'react-router';
import styled from 'styled-components';

import { Button } from '@/components/common/buttons/Button';
import { StyledAddButton } from '@/components/common/styles';
import { TableSort } from '@/components/Table/TableSort';
import { Roles } from '@/constants/roles';
import { useFinancialCodeRepository } from '@/hooks/repositories/useFinancialCodeRepository';
Expand Down Expand Up @@ -123,10 +122,4 @@ export const FinancialCodeListView: React.FC = () => {
);
};

const StyledAddButton = styled(Button)`
&.btn.btn-primary {
background-color: ${props => props.theme.bcTokens.iconsColorSuccess};
}
`;

export default FinancialCodeListView;
11 changes: 2 additions & 9 deletions source/frontend/src/features/leases/list/LeaseListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Col, Row } from 'react-bootstrap';
import { FaFileAlt, FaFileExcel, FaPlus } from 'react-icons/fa';
import { useHistory } from 'react-router';
import { toast } from 'react-toastify';
import styled from 'styled-components';

import { Button, StyledIconButton } from '@/components/common/buttons';
import { StyledIconButton } from '@/components/common/buttons';
import { StyledAddButton } from '@/components/common/styles';
import TooltipWrapper from '@/components/common/TooltipWrapper';
import Claims from '@/constants/claims';
import { useApiLeases } from '@/hooks/pims-api/useApiLeases';
Expand Down Expand Up @@ -125,11 +125,4 @@ export const LeaseListView: React.FunctionComponent<React.PropsWithChildren<unkn
);
};

const StyledAddButton = styled(Button)`
&.btn.btn-primary,
&.btn.btn-primary:active {
background-color: ${props => props.theme.bcTokens.iconsColorSuccess};
}
`;

export default LeaseListView;
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { Col, Row } from 'react-bootstrap';
import { FaPlus } from 'react-icons/fa';
import { useHistory } from 'react-router';
import { toast } from 'react-toastify';
import styled from 'styled-components';

import { Button } from '@/components/common/buttons/Button';
import { StyledAddButton } from '@/components/common/styles';
import Claims from '@/constants/claims';
import { useApiResearchFile } from '@/hooks/pims-api/useApiResearchFile';
import useKeycloakWrapper from '@/hooks/useKeycloakWrapper';
Expand Down Expand Up @@ -96,10 +95,4 @@ export const ResearchListView: React.FunctionComponent<React.PropsWithChildren<u
);
};

const StyledAddButton = styled(Button)`
&.btn.btn-primary {
background-color: ${props => props.theme.bcTokens.iconsColorSuccess};
}
`;

export default ResearchListView;
Loading