Skip to content

Commit

Permalink
PSP-10034: Fixing Font sizes, spaces and icons and icons alignment (#…
Browse files Browse the repository at this point in the history
…4660)

* PSP-10034 fix

* Changing style.ts

* Snapshots update

* Changing icons positions and missing icons updates

* snapshots update

---------

Co-authored-by: Alejandro Sanchez <[email protected]>
  • Loading branch information
stairaku and asanchezr authored Feb 18, 2025
1 parent 1bb5f6c commit e141176
Show file tree
Hide file tree
Showing 124 changed files with 2,857 additions and 2,817 deletions.
3 changes: 1 addition & 2 deletions source/frontend/src/components/common/Section/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Section: React.FC<
{exists(header) && (
<StyledSectionHeader isStyledHeader={isStyledHeader}>
<Row className="no-gutters">
<Col className="align-items-end">{header}</Col>
<Col className="align-content-end">{header}</Col>
{isCollapsable && (
<Col xs="auto" className="pl-2 d-flex align-items-end">
{isCollapsed && (
Expand Down Expand Up @@ -80,7 +80,6 @@ export const StyledSectionHeader = styled.h2<{ isStyledHeader?: boolean }>`
color: ${props => props.theme.css.headerTextColor};
border-bottom: 0.2rem ${props => props.theme.css.headerBorderColor} solid;
margin-bottom: 2.4rem;
font-size: 2.6rem;
`;

const StyledFormSection = styled.div<{ noPadding?: boolean }>`
Expand Down
19 changes: 7 additions & 12 deletions source/frontend/src/components/common/form/FormTitleBar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Col, Row } from 'react-bootstrap';
import { FaWindowClose } from 'react-icons/fa';
import styled from 'styled-components';

import { CloseIcon, Underline } from '@/components/common/styles';
import * as BaseStyles from '@/components/common/styles';
import TooltipWrapper from '@/components/common/TooltipWrapper';

Expand Down Expand Up @@ -44,21 +44,16 @@ export const FormTitleBar: React.FC<IFormTitleBarProps> = ({
);
};

const Underline = styled.div`
width: 100%;
border-bottom: solid 0.5rem ${props => props.theme.bcTokens.surfaceColorBackgroundDarkBlue};
`;

const CloseIcon = styled(FaWindowClose)`
color: ${props => props.theme.bcTokens.typographyColorSecondary};
font-size: 30px;
cursor: pointer;
`;

// override default H1 styling for the title bar
const TitleBarH1 = styled(BaseStyles.H1)`
&& {
border-bottom: none;
margin-bottom: 0.2rem;
}
svg {
width: 2.8rem;
height: 2.8rem;
margin-right: 0;
}
`;
8 changes: 3 additions & 5 deletions source/frontend/src/components/common/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const FlexBox = styled.div<IFlexBoxProps>`
export const H1 = styled.h1`
color: ${props => props.theme.bcTokens.typographyColorSecondary};
font-family: 'BCSans-Bold';
font-size: 3.2rem;
font-size: 2.8rem;
border-bottom: solid 0.5rem ${props => props.theme.css.headerBorderColor};
width: 100%;
text-align: left;
Expand All @@ -87,7 +87,7 @@ export const H1 = styled.h1`
export const H2 = styled.h2`
color: ${props => props.theme.css.headerTextColor};
font-family: 'BCSans-Bold';
font-size: 2.6rem;
font-size: 2.2rem;
border-bottom: solid 0.2rem ${props => props.theme.css.headerBorderColor};
width: 100%;
text-align: left;
Expand Down Expand Up @@ -143,9 +143,7 @@ export const StyledSectionParagraph = styled.p`
text-decoration: none;
`;

export const TrayHeader = styled.div`
font-size: 2rem;
font-weight: bold;
export const TrayHeader = styled(H1)`
padding: 1rem;
background-color: ${props => props.theme.bcTokens.surfaceColorPrimaryButtonDefault};
color: white;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const SideTrayLayout: React.FC<React.PropsWithChildren<ISideTrayLayoutPro
<Col>
<Styled.TrayHeader className="mr-auto">
<>
<span className="mr-2">{icon}</span>
<div className="mr-2 mb-1">{icon}</div>
{title}
</>
</Styled.TrayHeader>
Expand Down
2 changes: 2 additions & 0 deletions source/frontend/src/components/layout/SideNavBar/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import styled from 'styled-components';
import { H1 } from '@/components/common/styles';

export const TrayHeader = styled(H1)`
display: flex;
align-items: end;
border-bottom: 0;
margin-bottom: 0.2rem;
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ exports[`FilterContentForm component > renders as expected 1`] = `
color: var(--theme-blue-100);
border-bottom: 0.2rem var(--theme-blue-90) solid;
margin-bottom: 2.4rem;
font-size: 2.6rem;
}
.c3 {
Expand Down Expand Up @@ -336,7 +335,7 @@ exports[`FilterContentForm component > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Show Ownership
</div>
Expand Down Expand Up @@ -621,7 +620,7 @@ exports[`FilterContentForm component > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Project
</div>
Expand Down Expand Up @@ -733,7 +732,7 @@ exports[`FilterContentForm component > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Tenure
</div>
Expand Down Expand Up @@ -1123,7 +1122,7 @@ exports[`FilterContentForm component > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Lease / Licence
</div>
Expand Down Expand Up @@ -1695,7 +1694,7 @@ exports[`FilterContentForm component > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Anomaly
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,8 @@ const FlexDiv = styled.div`
justify-content: space-between;
align-items: center;
margin-bottom: 0.25rem;
svg {
vertical-align: baseline;
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ exports[`AccessRequestPage > renders correctly 1`] = `
.c1 {
color: #474543;
font-family: 'BCSans-Bold';
font-size: 3.2rem;
font-size: 2.8rem;
border-bottom: solid 0.5rem var(--theme-blue-90);
width: 100%;
text-align: left;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ const ManageAccessRequestsPage = () => {
return (
<StyledContainer>
<CommonStyled.H1>
<AdminIcon title="Admin Tools icon" width="2.6rem" height="2.6rem" fill="currentColor" />
<AdminIcon
title="Admin Tools icon"
width="2.6rem"
height="2.6rem"
fill="currentColor"
style={{ verticalAlign: 'baseline' }}
/>
<span className="ml-2">PIMS User Access Requests</span>
</CommonStyled.H1>
<AccessRequestFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ exports[`Manage access requests > Snapshot matches 1`] = `
.c2 {
color: #474543;
font-family: 'BCSans-Bold';
font-size: 3.2rem;
font-size: 2.8rem;
border-bottom: solid 0.5rem var(--theme-blue-90);
width: 100%;
text-align: left;
Expand Down Expand Up @@ -274,6 +274,7 @@ exports[`Manage access requests > Snapshot matches 1`] = `
<svg
fill="currentColor"
height="2.6rem"
style="vertical-align: baseline;"
title="Admin Tools icon"
viewBox="0 0 24 24"
width="2.6rem"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ export const DocumentTemplateManagementView: React.FunctionComponent<
<PaddedScrollable>
<LoadingBackdrop show={props.isLoading} />
<CommonStyled.H1>
<AdminIcon title="Admin Tools icon" width="2.6rem" height="2.6rem" fill="currentColor" />
<AdminIcon
title="Admin Tools icon"
width="2.6rem"
height="2.6rem"
fill="currentColor"
style={{ verticalAlign: 'baseline' }}
/>
<span className="ml-2">PIMS Document Template Management</span>
</CommonStyled.H1>
<Section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`DocumentTemplateManagementContainer component > matches snapshot 1`] =
.c3 {
color: #474543;
font-family: 'BCSans-Bold';
font-size: 3.2rem;
font-size: 2.8rem;
border-bottom: solid 0.5rem var(--theme-blue-90);
width: 100%;
text-align: left;
Expand Down Expand Up @@ -67,6 +67,7 @@ exports[`DocumentTemplateManagementContainer component > matches snapshot 1`] =
<svg
fill="currentColor"
height="2.6rem"
style="vertical-align: baseline;"
title="Admin Tools icon"
viewBox="0 0 24 24"
width="2.6rem"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ exports[`Edit user page > EditUserPage renders 1`] = `
.c1 {
color: #474543;
font-family: 'BCSans-Bold';
font-size: 3.2rem;
font-size: 2.8rem;
border-bottom: solid 0.5rem var(--theme-blue-90);
width: 100%;
text-align: left;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,8 @@ const FlexDiv = styled.div`
justify-content: space-between;
align-items: center;
margin-bottom: 0.25rem;
svg {
vertical-align: baseline;
}
`;
8 changes: 7 additions & 1 deletion source/frontend/src/features/admin/users/ManageUsersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ export const ManageUsersPage = () => {
return (
<StyledPage fluid className="users-management-page">
<CommonStyled.H1>
<AdminIcon title="Admin Tools icon" width="2.6rem" height="2.6rem" fill="currentColor" />
<AdminIcon
title="Admin Tools icon"
width="2.6rem"
height="2.6rem"
fill="currentColor"
style={{ verticalAlign: 'baseline' }}
/>
<span className="ml-2">User Management</span>
</CommonStyled.H1>
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ exports[`Manage Users Component > Snapshot matches 1`] = `
.c2 {
color: #474543;
font-family: 'BCSans-Bold';
font-size: 3.2rem;
font-size: 2.8rem;
border-bottom: solid 0.5rem var(--theme-blue-90);
width: 100%;
text-align: left;
Expand Down Expand Up @@ -403,6 +403,7 @@ exports[`Manage Users Component > Snapshot matches 1`] = `
<svg
fill="currentColor"
height="2.6rem"
style="vertical-align: baseline;"
title="Admin Tools icon"
viewBox="0 0 24 24"
width="2.6rem"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getIn } from 'formik';
import React from 'react';
import { MdContactMail } from 'react-icons/md';
import { useHistory, useLocation, useRouteMatch } from 'react-router-dom';
import styled from 'styled-components';

import ContactIcon from '@/assets/images/contact-icon.svg?react';
import { FormTitleBar } from '@/components/common/form/FormTitleBar';
import { ContactTypeSelector, HalfWidthLayout } from '@/features/contacts';
import { ContactTypes } from '@/features/contacts/interfaces';
Expand Down Expand Up @@ -32,7 +32,7 @@ export const CreateContactContainer: React.FunctionComponent<
<FormTitleBar
showCloseButton
title="Add Contact"
icon={<MdContactMail className="mr-2 mb-2" size={28} />}
icon={<ContactIcon className="mr-2 mb-2" fill="currentColor" />}
onClose={onClose}
/>
<StyledFormWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ exports[`CreateOrganizationForm > renders as expected 1`] = `
color: var(--theme-blue-100);
border-bottom: 0.2rem var(--theme-blue-90) solid;
margin-bottom: 2.4rem;
font-size: 2.6rem;
}
.c3 {
Expand Down Expand Up @@ -343,7 +342,7 @@ exports[`CreateOrganizationForm > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Contact Details
</div>
Expand Down Expand Up @@ -451,7 +450,7 @@ exports[`CreateOrganizationForm > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
<div
class="d-flex align-items-center"
Expand Down Expand Up @@ -763,7 +762,7 @@ exports[`CreateOrganizationForm > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Mailing Address
</div>
Expand Down Expand Up @@ -1020,7 +1019,7 @@ exports[`CreateOrganizationForm > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Property Address
</div>
Expand Down Expand Up @@ -1277,7 +1276,7 @@ exports[`CreateOrganizationForm > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Billing Address
</div>
Expand Down Expand Up @@ -1534,7 +1533,7 @@ exports[`CreateOrganizationForm > renders as expected 1`] = `
class="no-gutters row"
>
<div
class="align-items-end col"
class="align-content-end col"
>
Comments
</div>
Expand Down
Loading

0 comments on commit e141176

Please sign in to comment.