-
Notifications
You must be signed in to change notification settings - Fork 1
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
SUL23-417 - Study Place additional room info #123
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -42,21 +48,30 @@ const StudyPlaceFeatures = ({branchHours, branchTitle, branchUrl, capacity, cont | |||
|
|||
<div className="card-body items-start rs-px-3 rs-pb-3 rs-pt-7 md:rs-pt-3 w-full"> | |||
<div className="leading-display text-18 pt-0 font-normal "> | |||
<h2 id={headingId} className="type-3 rs-mb-1">{type}</h2> | |||
<h2 id={headingId} className="type-3 rs-mb-1">{roomDonorName} {type}</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to trim if the donor name is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pookmish How about [roomDonorName, type].join(" ")
instead? That way it ignores the space if room is null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd have to filter it if you do that. [roomDonorName, type].filter(item => !!item).join(" ")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Not a fan of that. I could trim it this way: {(node.sulStudyRoomDonorName || '').trim()} {node.sulStudyType.name}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still have the space between. You're trimming the wrong thing. Something like this would work:
{node.sulStudyRoomDonorName ? `${node.sulStudyRoomDonorName} ${node.sulStudyType.name}` : node.sulStudyType.name}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pookmish Okay. Sorry. I went back to the join version. Just seems a bit easier for me to know what's going on.
It's interesting that the space never seemed to appear in the UI. I could only see it in console.log(). Which I admit I probably should have ran it through sooner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, it might not even make any difference. But I feel it's good practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also experienced a weird build issues. Both on my local and with the build on this PR. I finally had to switch to another ticket out of frustration. When I came back, it stopped being an issue. Been trying to replicate it. Hope fully it's just one of those on-off things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, Using the .filter
produces this dom markup: <h2 class="type-3 rs-mb-1">Group study room</h2>
While just printing the two values next to eachother produces this dom: <h2 class="type-3 rs-mb-1"> <!-- -->Group study room</h2>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter way seems cleaner.
remove console.log
620b8b5
to
a9a52f6
Compare
READY FOR REVIEW
Summary
Review By (Date)
Urgency
Steps to Test
Affected Projects or Products
Associated Issues and/or People
@mention
them here)See Also