-
Notifications
You must be signed in to change notification settings - Fork 25
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
Kuwait Theme: Module List Item Component #2527
Conversation
Visit the preview URL for this PR (updated for commit 417a9f2): https://plh-teens-app1--pr2527-feat-module-list-com-7i7exiev.web.app (expires Fri, 06 Dec 2024 14:15:35 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: e4c0bab6b08dd290fbf002fd6e07987fa4b5fce1 |
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.
Looks great! A few comments:
- Should the
module_alignment
automatically adapt when a right-to-left language is selected? Currently it seems that the relative position of the elements within the item does flip, but the text alignment doesn't (FYI can test this behaviour by going to the templatefeature_rtl_language
and selecting English RTL). We would also need to flip thenav_image_asset
.
English regular vs English RTL:
-
Instead of a
target_template
parameter, should we have this in theaction_list
column asclick | go_to: [target_template]
which is more in line with our usual syntax for button actions? This would give flexibility of authoring more button actions if needed, such as setting fields / dynamic data. -
I noticed that only the area around the
nav_image_asset
in this component is clickable, not the full "button". I kind of expected that the full button would be clickable (because it has a drop shadow) - but don't feel super strongly, so happy to hear what others think.
@FaithDaka Which Title Case convention is used for the |
@esmeetewinkel Currently I'm not familiar with the
This makes sense to me. I'm still getting accustomed to the functionality in the sheets so I can switch to that.
Great point! For a better UX the entire card should be clickable with the arrow as a visual cue. It does get messy with accidental clicks when scrolling involved but I agree that it is more intuitive. |
@esmeetewinkel |
…pp-builder into feat-module-list-comp
…national/open-app-builder into feat-module-list-comp
@chrismclarke @jfmcquade Are there any concerns with this PR? |
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.
Thanks, @FaithDaka, sorry for the slow response. I think this looks good, nice to see our component parameter conventions being used clearly.
I've added a couple of minor comments inline. I'm happy to approve but I would suggest waiting for an approval from all reviewers before merging.
/* TEMPLATE PARAMETER: "module_image_asset". The image attached to the module */ | ||
moduleImageAsset: string | null; | ||
/* TEMPLATE PARAMETER: "text_transform". The format of the text on the module item. Default null */ | ||
textTransform: "capitalise" | "uppercase" | 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.
I think we probably don't need the capitalise
option. It's going to apply a sub-optimal version of title case where words like "of", "to", "and" etc. get capitalised, a convention which may also vary by language. So I think capitalisation within strings is something that authors need to determine themselves when supplying the string. The same argument could be applied, to some extent, to "uppercase" too, but I can see how this could be useful so I'm happy to have it included.
/* TEMPLATE PARAMETER: "text_transform". The format of the text on the module item. Default null */ | ||
textTransform: "capitalise" | "uppercase" | null; | ||
/* TEMPLATE PARAMETER: "is_nav_item". Marks an item as navigable in order to show the navigation image asset. Default "true" */ | ||
navItem: boolean; |
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.
Could this be removed as an explicit property and whether or not to show the nav image just be inferred from whether or not an asset is provided?
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.
@jfmcquade I'll use the is-locked
boolean property given that navItem
property was added to make the routing more customisable, otherwise if routing is based on the assets then even a locked module will route to a linked page when a goto
action is defined, which is not desired.
…pp-builder into feat-module-list-comp
…national/open-app-builder into feat-module-list-comp
/* TEMPLATE PARAMETER: "nav_image_asset". The navigation icon*/ | ||
navImageAsset: string | null; | ||
/* TEMPLATE PARAMETER: "locked_image_asset". The locked icon*/ | ||
lockedImageAsset: string | 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.
nit(non-blocking): assuming the author doesn't provide these variables they will come through as undefined
(and not null
). Makes no real semantic difference, but might be easier to author the interface in the same way by marking optional properties with a ?
, e.g.
interface IModuleListItemParams{
lockedImageAsset?: string
}
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.
Looks good to me, I agree with the minor comments @jfmcquade added but see no issue with merging here and adding as a follow-up (given all the code is nicely isolated to the plh components workspace)
Thanks for making the updates @FaithDaka, I've added one minor commit in line with Chris's suggestion. I will merge this now. |
PR Checklist
Description
plh_module_list_item
created and styled. Corresponding debug sheet: LinkAuthor Notes
plh_module_list_item
component with the followingparameter_list
:module_image_asset
: The image attached to the module item.text_transform
(optional): The format of the text on the module item. Default null-nav_image_asset
: For the navigation iconlocked_image_asset
(optional): For the locked iconis_locked
(optional): The boolean that marks the module as locked or unlockedGit Issues
Closes #2534
Screenshots