Skip to content

Commit

Permalink
feat: 422/updated account theming (#3791)
Browse files Browse the repository at this point in the history
* fix: rough draft refactoring

* fix: wip seeds card

* fix: wip account updates

* fix: account card styling

* fix: wip status item styling

* fix: edit screen adjustments

* fix: css matched app view

* fix: testing fixes

* fix: getById chnage

* fix: add plural copy fix

* fix: json update

* fix: remove tailwind

* fix: font weight touches

* fix: mantain translations

* fix: reorganizing files

* fix: svg updates

* fix: current pswd translations

* fix: unused css

* fix: width needed

* fix: css and heading updates

* fix: account card updates

* fix: partial new icon approach

* fix: final tweaks

* fix: no border figma matching
  • Loading branch information
ColinBuyck authored Jan 29, 2024
1 parent 3ea47ed commit 99847f0
Show file tree
Hide file tree
Showing 12 changed files with 477 additions and 317 deletions.
4 changes: 4 additions & 0 deletions shared-helpers/src/locales/general.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"account.accountSettings": "Account Settings",
"account.accountSettingsSubtitle": "Account Settings, email and password",
"account.accountSettingsUpdate": "Update account settings",
"account.application.confirmation": "Confirmation",
"account.application.error": "Error",
"account.application.noAccessError": "You are unauthorized to view this application",
"account.application.noApplicationError": "No application with that ID exists",
"account.application.return": "Return to applications",
"account.application.iconTitle": "application with checkmarks",
"account.createAccount": "Create Account",
"account.errorFetchingApplications": "Error fetching applications",
"account.haveAnAccount": "Already have an account?",
"account.myApplications": "My Applications",
"account.viewApplications": "View applications",
"account.myApplicationsSubtitle": "See lottery dates and listings for properties for which you've applied",
"account.noApplications": "It looks like you haven't applied to any listings yet.",
"account.settings.alerts.currentPassword": "Invalid current password. Please try again.",
Expand All @@ -28,6 +31,7 @@
"account.settings.placeholders.month": "MM",
"account.settings.placeholders.year": "YYYY",
"account.settings.update": "Update",
"account.settings.iconTitle": "generic user",
"application.ada.hearing": "For Hearing Impairments",
"application.ada.label": "ADA Accessible Units",
"application.ada.mobility": "For Mobility Impairments",
Expand Down
2 changes: 1 addition & 1 deletion sites/public/cypress/e2e/pages/my-applications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe("My applications page", function () {
cy.visit("/sign-in")
cy.signIn()
cy.url().should("include", "/account/dashboard")
cy.getByTestId("account-dashboard-applications").click()
cy.getByID("account-dashboard-applications").click()
cy.location("pathname").should("include", "/account/applications")
cy.signOut()
})
Expand Down
24 changes: 24 additions & 0 deletions sites/public/src/components/account/AccountCard.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.account-card {
--card-header-padding-inline-desktop: var(--seeds-s12);
--card-header-padding-inline-mobile: var(--seeds-s4);
--card-content-padding-inline-mobile: var(--seeds-s4);
--card-border-width: 0rem;
width: 100%;
@media (max-width: theme("screens.sm")) {
--card-spacing-lg: var(--seeds-s6);
--card-border-radius: 0rem;
}
}

.acccount-card-icon {
margin-bottom: var(--seeds-s3);
}

.account-card-heading-group {
--subheading-margin: var(--seeds-s3);
--heading-margin: var(--seeds-s3);
}

.account-card-heading {
margin-top: var(--seeds-s3);
}
49 changes: 49 additions & 0 deletions sites/public/src/components/account/AccountCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Heading, HeadingGroup, Icon } from "@bloom-housing/ui-seeds"
import Card from "@bloom-housing/ui-seeds/src/blocks/Card"
import React from "react"
import styles from "./AccountCard.module.scss"
import { CustomIconMap, CustomIconType } from "../shared/CustomIconMap"

interface AccountCardProps {
iconSymbol: CustomIconType
title: string
subtitle?: string
children: React.ReactElement
id?: string
divider?: "flush" | "inset"
headingPriority?: 1 | 2 | 3 | 4 | 5 | 6
className?: string
}

const AccountCard = (props: AccountCardProps) => {
const classNames = [styles["account-card"]]
if (props.className) classNames.push(props.className)

const customIcon = CustomIconMap[props.iconSymbol]

return (
<Card spacing="lg" className={classNames.join(" ")}>
<Card.Header divider={props?.divider}>
<Icon size="2xl" className={styles["account-card-icon"]}>
{customIcon}
</Icon>
{props.subtitle ? (
<HeadingGroup
size="2xl"
heading={props.title}
subheading={props.subtitle}
className={styles["account-card-heading-group"]}
headingPriority={props.headingPriority}
/>
) : (
<Heading size="2xl" className={styles["account-card-heading"]}>
{props.title}
</Heading>
)}
</Card.Header>
{props.children}
</Card>
)
}

export { AccountCard as default, AccountCard }
148 changes: 54 additions & 94 deletions sites/public/src/components/account/StatusItem.module.scss
Original file line number Diff line number Diff line change
@@ -1,132 +1,92 @@
.status-item {
@apply relative;
@apply text-gray-800;
@apply border-b;
@apply border-solid;
@apply border-gray-450;
@apply bg-primary-lighter;

&:last-of-type {
@apply border-b-0;
}
}

.status-item__inner {
@apply p-4;
position: relative;
padding: var(--seeds-s4);
background-color: var(--seeds-color-primary-lighter);
color: var(--seeds-gray-800);
border-bottom-width: 0.0625rem;
border-style: solid;
border-color: var(--seeds-color-gray-450);
}

.status-item__header {
@apply pb-2;

@screen md {
@apply flex;
@apply mb-4;
@apply justify-between;
@apply border-b;
@apply border-solid;
@apply border-gray-450;
display: flex;
padding-bottom: var(--seeds-s4);
justify-content: space-between;
border-bottom-width: 0.0625rem;
border-style: solid;
border-color: var(--seeds-color-gray-450);
margin-bottom: var(seeds-s4);
@media (max-width: theme("screens.md")) {
padding-bottom: var(--seeds-s2);
display: block;
}
}

.status-item__title {
@apply text-xl;
@apply font-alt-sans;
@apply tracking-wider;
@apply mb-0;
@apply uppercase;
font-size: var(--seeds-font-size-lg);
margin-bottom: 0;
}

.status-item__due {
@screen md {
@apply text-right;
@apply self-center;
text-align: right;
align-self: center;
font-size: var(--seeds-font-size-sm);
@media (max-width: theme("screens.md")) {
text-align: left;
padding-top: var(--seeds-s2_5);
}
}

.status-item__content {
@screen md {
@apply flex;
@apply justify-between;
display: flex;
justify-content: space-between;
padding-top: var(--seeds-s4);
@media (max-width: theme("screens.md")) {
display: grid;
}
}

.status-confirmation__number {
@apply pt-4;
}

.status-item__details {
@apply text-center;
@screen md {
@apply text-left;
}
padding-top: var(--seeds-s4);
}

.status-item__action {
@apply text-center;
@apply pt-4;
@apply mb-4;
padding-top: 0;
text-align: right;

@screen md {
@apply pt-0;
@apply text-right;
@media (max-width: theme("screens.md")) {
text-align: center;
padding-top: var(seeds-s4);
margin-bottom: var(--seeds-s4);
}
}

.status-item__footer {
@apply text-center;

@screen md {
@apply flex;
@apply justify-between;
@apply text-left;
@apply gap-4;
}
}

.status-item__links {
@apply pb-4;

@screen md {
@apply pb-0;
}
}

.status-item__meta {
@apply mt-4;

@screen md {
@apply text-right;
@apply mt-0;
display: flex;
gap: var(--seeds-s4);
flex-direction: row;
justify-content: flex-start;
padding-top: var(--seeds-s4);
width: fit-content;
@media (max-width: theme("screens.md")) {
flex-direction: column;
}
}

.status-item__status {
@apply pb-4;
}

.status-item__label {
@apply relative;
}

.status-item__date {
@apply text-xs;
}

.status-item__address {
@apply mb-4;
padding-block: 0;
font-size: var(--seeds-font-size-sm);
@media (max-width: theme("screens.md")) {
padding-block: var(--seeds-s4);
}
}

.status-item__confirm-text {
@apply text-sm;
@apply mb-4;
font-size: var(--seeds-font-size-sm);
margin-bottom: var(--seeds-s4);
}

.status-item__confirm-number {
@apply text-xl;
}

.status-item__address {
@screen md {
@apply text-left;
}
font-size: var(--seeds-font-size-lg);
padding-top: var(--seeds-s2);
}
59 changes: 30 additions & 29 deletions sites/public/src/components/account/StatusItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react"
import { t } from "@bloom-housing/ui-components"
import { Button, Link } from "@bloom-housing/ui-seeds"
import { Button, Card, Tag } from "@bloom-housing/ui-seeds"
import styles from "./StatusItem.module.scss"
import accountStyles from "../../pages/account/account.module.scss"

interface StatusItemProps {
applicationDueDate?: string
Expand All @@ -11,7 +12,7 @@ interface StatusItemProps {
listingName: string
listingURL: string
strings?: {
applicationDeadline?: string
applicationsDeadline?: string
edited?: string
seeListing?: string
status?: string
Expand All @@ -23,20 +24,22 @@ interface StatusItemProps {

const StatusItem = (props: StatusItemProps) => {
return (
<article className={styles["status-item"]}>
<div className={styles["status-item__inner"]}>
<Card.Section
className={`${accountStyles["account-card-section"]} ${accountStyles["application-card-section"]}`}
>
<article className={styles["status-item"]}>
<header className={styles["status-item__header"]}>
<h3 className={styles["status-item__title"]}>{props.listingName}</h3>
{props.applicationDueDate && (
<p className={styles["status-item__due"]}>
{props.strings?.applicationDeadline ?? t("listings.applicationDeadline")}:{" "}
{props.applicationDueDate}
</p>
)}
<p className={styles["status-item__status"]}>
{props.strings?.status ?? t("application.status")}:{" "}
<Tag variant="primary">
{props.strings?.submittedStatus ?? t("application.statuses.submitted")}
</Tag>
</p>
</header>

<section className={styles["status-item__content"]}>
<div className={styles["status-item__details"]}>
<div>
{props.confirmationNumber && (
<>
<span className={styles["status-item__confirm-text"]}>
Expand All @@ -51,31 +54,29 @@ const StatusItem = (props: StatusItemProps) => {
</div>

<div className={styles["status-item__action"]}>
<p className={styles["status-item__status"]}>
<span className={styles["status-item__label"]}>
{props.strings?.status ?? t("application.status")}:{" "}
{props.strings?.submittedStatus ?? t("application.statuses.submitted")}
</span>
</p>
<Button href={props.applicationURL} size="sm">
{props.strings?.viewApplication ?? t("application.viewApplication")}
</Button>
{props.applicationDueDate && (
<p className={styles["status-item__due"]}>
{props.strings?.applicationsDeadline ?? t("listings.applicationDeadline")}:{" "}
{props.applicationDueDate}
</p>
)}
</div>
</section>

<footer className={styles["status-item__footer"]}>
<div className={styles["status-item_links"]}>
<Link href={props.listingURL}>{props.strings?.seeListing ?? t("t.seeListing")}</Link>
<div>
<Button href={props.applicationURL} variant="primary-outlined" size="sm">
{props.strings?.viewApplication ?? t("application.viewApplication")}
</Button>
</div>

<div className={styles["status-item__meta"]}>
<p className={styles["status-item__date"]}>
{props.strings?.edited ?? t("application.edited")}: {props.applicationUpdatedAt}
</p>
<div>
<Button href={props.listingURL} variant="primary-outlined" size="sm">
{props.strings?.seeListing ?? t("t.seeListing")}
</Button>
</div>
</footer>
</div>
</article>
</article>
</Card.Section>
)
}

Expand Down
Loading

0 comments on commit 99847f0

Please sign in to comment.