@bloom-housing/ui-components 5.0.1-alpha.20 → 5.0.1-alpha.21

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,17 @@
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
+ ## [5.0.1-alpha.21](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.20...@bloom-housing/ui-components@5.0.1-alpha.21) (2022-07-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * allow jsx in expandable section ([#2902](https://github.com/bloom-housing/bloom/issues/2902)) ([93ae489](https://github.com/bloom-housing/bloom/commit/93ae489196ad96a9f68247ff2b5cc3fbe0f347d2))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [5.0.1-alpha.20](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@5.0.1-alpha.19...@bloom-housing/ui-components@5.0.1-alpha.20) (2022-07-20)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloom-housing/ui-components",
3
- "version": "5.0.1-alpha.20",
3
+ "version": "5.0.1-alpha.21",
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",
@@ -110,5 +110,5 @@
110
110
  "ts-jest": "^26.4.1",
111
111
  "typesafe-actions": "^5.1.0"
112
112
  },
113
- "gitHead": "e9eb58b6a83245200b200af3d17fe6987096c256"
113
+ "gitHead": "2540be88ca435f79002e08aa062094c69c0bdb80"
114
114
  }
@@ -4,7 +4,7 @@ import { ExpandableContent } from "../../../actions/ExpandableContent"
4
4
 
5
5
  export interface ExpandableSectionProps {
6
6
  content: string | React.ReactNode
7
- expandableContent?: string
7
+ expandableContent?: string | React.ReactNode
8
8
  strings: {
9
9
  title: string
10
10
  readMore?: string
@@ -14,19 +14,27 @@ export interface ExpandableSectionProps {
14
14
 
15
15
  const ExpandableSection = ({ content, expandableContent, strings }: ExpandableSectionProps) => {
16
16
  if (!content) return null
17
+
18
+ const getTextContent = (textContent: string | React.ReactNode) => {
19
+ return (
20
+ <>
21
+ {typeof textContent === "string" ? (
22
+ <Markdown options={{ disableParsingRawHTML: false }}>{textContent}</Markdown>
23
+ ) : (
24
+ textContent
25
+ )}
26
+ </>
27
+ )
28
+ }
17
29
  return (
18
30
  <section className="aside-block">
19
31
  <h4 className="text-caps-underline">{strings.title}</h4>
20
32
  <div className="text-tiny text-gray-750">
21
- {typeof content === "string" ? (
22
- <Markdown options={{ disableParsingRawHTML: false }}>{content}</Markdown>
23
- ) : (
24
- content
25
- )}
33
+ {getTextContent(content)}
26
34
  {expandableContent && (
27
35
  <div className={"mt-2"}>
28
36
  <ExpandableContent strings={{ readMore: strings.readMore, readLess: strings.readLess }}>
29
- <Markdown options={{ disableParsingRawHTML: false }}>{expandableContent}</Markdown>
37
+ {getTextContent(expandableContent)}
30
38
  </ExpandableContent>
31
39
  </div>
32
40
  )}