Repository navigation
[Timeline][lab] Fix position alternate-reverse generated classname - #37678
ZeeshanTamboli merged 6 commits into
Conversation
Netlify deploy previewhttps://deploy-preview-37678--material-ui.netlify.app/ Bundle size report |
| export default function convertTimelinePositionToClass(position: string): string { | ||
| return position === 'alternate-reverse' | ||
| ? 'positionAlternateReverse' | ||
| : `position${capitalize(position)}`; |
There was a problem hiding this comment.
I'm unsure whether I should create a pascalize function specifically to convert kebab-case to PascalCase for this situation or simply keep the string positionAlternateReverse hardcoded here.
There was a problem hiding this comment.
We can add a function to convert kebab case to pascal case in the utils package and use it in all occurrences where needed. Nice catch, btw 👍
There was a problem hiding this comment.
Since there is only one occurrence in the whole code-base, would it be worth it to create a function?
There was a problem hiding this comment.
I checked and found that it is only needed here. I think it is not worth it to create a util function just for this and so I am keeping the string hard-coded.
|
Hi @ZeeshanTamboli , is this the cause of |
alternate-reverse generated classnamealternate-reverse generated classname
|
@Sutar210599 It is not related to this fix. The issue is that we added this feature in #37311 in the last release but we forgot to bump the version of |
|
Ok, thanks. |
The classname generated for
alternate-reverseclass after adding it in #37311 should be.MuiTimeline-positionAlternateReverse, not.MuiTimeline-positionAlternate-reverse. The capitalize function only capitalizes the first letter of the first word and does not convert kebab-case to PascalCase.