@bloom-housing/ui-components 4.2.2-alpha.18 → 4.2.2-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.2.2-alpha.20](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.2.2-alpha.19...@bloom-housing/ui-components@4.2.2-alpha.20) (2022-04-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * ux updates for new listing card design ([#2687](https://github.com/bloom-housing/bloom/issues/2687)) ([c8814ae](https://github.com/bloom-housing/bloom/commit/c8814ae57b62fa6f932017bb70d47663b09fca1a))
12
+
13
+
14
+
15
+
16
+
17
+ ## [4.2.2-alpha.19](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.2.2-alpha.18...@bloom-housing/ui-components@4.2.2-alpha.19) (2022-04-28)
18
+
19
+ **Note:** Version bump only for package @bloom-housing/ui-components
20
+
21
+
22
+
23
+
24
+
6
25
  ## [4.2.2-alpha.18](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.2.2-alpha.17...@bloom-housing/ui-components@4.2.2-alpha.18) (2022-04-28)
7
26
 
8
27
  **Note:** Version bump only for package @bloom-housing/ui-components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloom-housing/ui-components",
3
- "version": "4.2.2-alpha.18",
3
+ "version": "4.2.2-alpha.20",
4
4
  "author": "Sean Albert <sean.albert@exygy.com>",
5
5
  "description": "Shared user interface components for Bloom affordable housing system",
6
6
  "homepage": "https://github.com/bloom-housing/bloom/tree/master/shared/ui-components",
@@ -102,5 +102,5 @@
102
102
  "tailwindcss": "2.2.10",
103
103
  "typesafe-actions": "^5.1.0"
104
104
  },
105
- "gitHead": "666ab8967e19eb9d024ab8a8af1274100221c71f"
105
+ "gitHead": "f1aaac0be6d151f1971cbb19e4128976ecec1b6f"
106
106
  }
@@ -145,7 +145,8 @@ h1.title {
145
145
  @apply font-semibold;
146
146
  @apply text-blue-700;
147
147
  @apply text-3xl;
148
- @apply mb-1;
148
+ @apply mb-3;
149
+ @apply leading-tight;
149
150
  }
150
151
 
151
152
  .card-subheader {
@@ -1,49 +1,56 @@
1
1
  import * as React from "react"
2
- import { t } from "../../helpers/translator"
3
2
 
4
3
  export interface AdditionalFeesProps {
5
- depositMin?: string
6
- depositMax?: string
4
+ /** The application fee for the property, rendered in the first block */
7
5
  applicationFee?: string
8
- costsNotIncluded?: string
9
- depositHelperText?: string
10
- }
11
-
12
- const AdditionalFees = (props: AdditionalFeesProps) => {
13
- if (!props.depositMin && !props.depositMax && !props.applicationFee && !props.costsNotIncluded) {
14
- return <></>
6
+ /** Costs not included in the deposit or application fee, rendered below both blocks */
7
+ costsNotIncluded?: string | React.ReactNode
8
+ /** The deposit amount for the property, rendered in the second block */
9
+ deposit?: string
10
+ strings: {
11
+ sectionHeader: string
12
+ deposit?: string
13
+ depositSubtext?: string[]
14
+ applicationFee?: string
15
+ applicationFeeSubtext?: string[]
15
16
  }
17
+ }
16
18
 
17
- const getDeposit = () => {
18
- const min = props.depositMin
19
- const max = props.depositMax
20
- if (min && max && min !== max) {
21
- return `$${min} – $${max}`
22
- } else if (min) return `$${min}`
23
- else return `$${max}`
24
- }
19
+ const AdditionalFees = ({
20
+ deposit,
21
+ applicationFee,
22
+ costsNotIncluded,
23
+ strings,
24
+ }: AdditionalFeesProps) => {
25
25
  return (
26
26
  <div className="info-card bg-gray-100 border-0">
27
- <p className="info-card__title">{t("listings.sections.additionalFees")}</p>
27
+ <p className="info-card__title mb-2">{strings.sectionHeader}</p>
28
28
  <div className="info-card__columns text-sm">
29
- {props.applicationFee && (
30
- <div className="info-card__column">
31
- <div className="text-base">{t("listings.applicationFee")}</div>
32
- <div className="text-xl font-bold">${props.applicationFee}</div>
33
- <div>{t("listings.applicationPerApplicantAgeDescription")}</div>
34
- <div>{t("listings.applicationFeeDueAt")}</div>
29
+ {applicationFee && (
30
+ <div className={`info-card__column ${deposit && "mr-2"}`}>
31
+ <div className="text-base">{strings.applicationFee}</div>
32
+ <div className="text-xl font-bold">{applicationFee}</div>
33
+ {strings.applicationFeeSubtext?.map((appFeeSubtext, index) => (
34
+ <div key={index}>{appFeeSubtext}</div>
35
+ ))}
35
36
  </div>
36
37
  )}
37
- {(props.depositMin || props.depositMax) && (
38
- <div className="info-card__column">
39
- <div className="text-base">{t("t.deposit")}</div>
40
- <div className="text-xl font-bold">{getDeposit()}</div>
41
- {props.depositHelperText && <div>{props.depositHelperText}</div>}
38
+ {deposit && (
39
+ <div className={`info-card__column ${applicationFee && "ml-2"}`}>
40
+ <div className="text-base">{strings.deposit}</div>
41
+ <div className="text-xl font-bold">{deposit}</div>
42
+ {strings.depositSubtext?.map((depositSubtext, index) => (
43
+ <div key={index}>{depositSubtext}</div>
44
+ ))}
42
45
  </div>
43
46
  )}
44
47
  </div>
45
48
 
46
- {props.costsNotIncluded && <p className="text-sm mt-6">{props.costsNotIncluded}</p>}
49
+ {costsNotIncluded && (
50
+ <p className={`text-sm mt-2 ${(applicationFee || deposit) && `mt-6`}`}>
51
+ {costsNotIncluded}
52
+ </p>
53
+ )}
47
54
  </div>
48
55
  )
49
56
  }
@@ -19,6 +19,7 @@
19
19
  .listings-row_figure {
20
20
  @apply w-full;
21
21
  @apply p-3;
22
+ @apply pb-0;
22
23
 
23
24
  @screen lg {
24
25
  @apply w-6/12;
@@ -32,6 +33,17 @@
32
33
  @screen lg {
33
34
  @apply w-6/12;
34
35
  }
36
+
37
+ .listings-row_headers {
38
+ @apply flex;
39
+ @apply flex-col;
40
+ @apply items-center;
41
+ @apply text-center;
42
+ @screen md {
43
+ @apply items-start;
44
+ @apply text-left;
45
+ }
46
+ }
35
47
  }
36
48
 
37
49
  .listings-row_table {
@@ -122,8 +122,10 @@ const ListingCard = (props: ListingCardProps) => {
122
122
  (contentProps.contentHeader?.text || contentProps?.contentSubheader?.text) && (
123
123
  <hr className={"mb-2"} />
124
124
  )}
125
- {getHeader(contentProps?.tableHeader, 4, "tableHeader")}
126
- {getHeader(contentProps?.tableSubheader, 5, "tableSubheader")}
125
+ <div className={"listings-row_headers"}>
126
+ {getHeader(contentProps?.tableHeader, 4, "tableHeader")}
127
+ {getHeader(contentProps?.tableSubheader, 5, "tableSubheader")}
128
+ </div>
127
129
  {children && children}
128
130
  {tableProps && (tableProps.data || tableProps.stackedData) && (
129
131
  <>
@@ -159,7 +161,7 @@ const ListingCard = (props: ListingCardProps) => {
159
161
  <ImageCard {...imageCardProps} />
160
162
  </div>
161
163
  <div className="listings-row_content">
162
- <div>{getContentHeader()}</div>
164
+ <div className={"listings-row_headers"}>{getContentHeader()}</div>
163
165
  {getContent()}
164
166
  </div>
165
167
  </article>