-
Notifications
You must be signed in to change notification settings - Fork 31
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
refactor(Card): extract image #6066
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,8 @@ const decideWidth = (minWidthInPixels?: number) => { | |
}; | ||
|
||
const decidePosition = ( | ||
imagePosition: ImagePositionType, | ||
imagePositionOnMobile: ImagePositionType, | ||
imagePosition?: ImagePositionType, | ||
imagePositionOnMobile?: ImagePositionType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand why these two are changing to optional. In the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, I have now fixed this in b27392f |
||
imageType?: CardImageType, | ||
) => { | ||
if (imageType === 'avatar') { | ||
|
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.
This logic looks to be wrong? The previous lines:
So this should be
That said I don't think I fully understand why this logic is the way it is
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 could not figure it out either, and this causes no visual difference, so tempted to simplify it like so.
If we want to capture a missing
imageUrl
and a setavatarUrl
, we should have a story against it.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 agree the previous logic is a bit weird and I prefer the new version. I'll leave this up to the two of you. On my side, I'm happy with this PR so I have approved.