Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate RichTextDisplay into PostingCard component #243

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

sherryhli
Copy link
Member

Ticket link

N/A, just spotted a use of richtext that we missed.

Implementation description

  • Wrapped posting description in RichTextDisplay component

Steps to test

  1. Run the application with seed data
  2. Navigate to localhost:3000/volunteer/postings
  3. Verify that the posting description is properly formatted (not JSON string)

single-line

4. Check the truncate behaviour (max 2 lines of description displayed in card). Create a temporary rich text string in PostingCard.tsx and pass into RichTextDisplay
const richTextSample = '{"blocks":[{"key":"2ggjh","text":"hi","type":"ordered-list-item","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}},{"key":"2nlb2","text":"aewf","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":4,"style":"BOLD"}],"entityRanges":[],"data":{}},{"key":"6a81d","text":"asf","type":"ordered-list-item","depth":0,"inlineStyleRanges":[{"offset":0,"length":3,"style":"BOLD"},{"offset":0,"length":3,"style":"UNDERLINE"}],"entityRanges":[],"data":{}}],"entityMap":{}}'

The full description contains 3 lines, verify that only 2 are displayed.

Side note: Chakra apparently limits the width of the second line to be less than or equal to the length of the first. @JoshuaYe @uwblueprint/sistering-w22-design is this an issue? For the example below, the second line consists of "2. aewf" but only "2. ae..." is displayed due to the first line being "1. hi".

multiline

What should reviewers focus on?

  • Does it work?

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 025a9ec):

https://sistering-dev--pr243-sherry-posting-card-e0d2tg0s.web.app

(expires Tue, 05 Apr 2022 06:04:10 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sherryhli sherryhli merged commit c5b8cdc into main Mar 29, 2022
@sherryhli sherryhli deleted the sherry/posting-card-richtext branch March 29, 2022 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants