@bloom-housing/ui-components 4.2.2-alpha.16 → 4.2.2-alpha.19

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,30 @@
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.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)
7
+
8
+ **Note:** Version bump only for package @bloom-housing/ui-components
9
+
10
+
11
+
12
+
13
+
14
+ ## [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)
15
+
16
+ **Note:** Version bump only for package @bloom-housing/ui-components
17
+
18
+
19
+
20
+
21
+
22
+ ## [4.2.2-alpha.17](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.2.2-alpha.16...@bloom-housing/ui-components@4.2.2-alpha.17) (2022-04-28)
23
+
24
+ **Note:** Version bump only for package @bloom-housing/ui-components
25
+
26
+
27
+
28
+
29
+
6
30
  ## [4.2.2-alpha.16](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.2.2-alpha.15...@bloom-housing/ui-components@4.2.2-alpha.16) (2022-04-27)
7
31
 
8
32
  **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.16",
3
+ "version": "4.2.2-alpha.19",
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",
@@ -70,7 +70,7 @@
70
70
  "webpack": "^4.44.2"
71
71
  },
72
72
  "dependencies": {
73
- "@bloom-housing/backend-core": "^4.2.2-alpha.4",
73
+ "@bloom-housing/backend-core": "^4.2.2-alpha.5",
74
74
  "@mapbox/mapbox-sdk": "^0.13.0",
75
75
  "@types/body-scroll-lock": "^2.6.1",
76
76
  "@types/jwt-decode": "^2.2.1",
@@ -102,5 +102,5 @@
102
102
  "tailwindcss": "2.2.10",
103
103
  "typesafe-actions": "^5.1.0"
104
104
  },
105
- "gitHead": "b720633cb8f3d9f69c5cd8d7093088d13a61046d"
105
+ "gitHead": "1f533505104083c02e2bacd3b23d39de95273ea9"
106
106
  }
@@ -1,5 +1,4 @@
1
1
  import * as React from "react"
2
- import Markdown from "markdown-to-jsx"
3
2
 
4
3
  export interface Address {
5
4
  city?: string
@@ -38,9 +37,11 @@ export const MultiLineAddress = (props: AddressProps) => {
38
37
  <br />
39
38
  </>
40
39
  )}
41
- <Markdown children={props.address.street || ""} />
42
- <br />
43
- {props.address.city}, {props.address.state} {props.address.zipCode}
40
+ {props.address.street} {props.address.street2}
41
+ {(props.address.street || props.address.street2) && <br />}
42
+ {props.address.city}
43
+ {props.address.city && (props.address.state || props.address.zipCode) && ","}{" "}
44
+ {props.address.state} {props.address.zipCode}
44
45
  </>
45
46
  )
46
47
  }
@@ -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
  }