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

Tile: add back old api #1527

Merged
merged 15 commits into from
Aug 30, 2023
Merged

Tile: add back old api #1527

merged 15 commits into from
Aug 30, 2023

Conversation

gretanausedaite
Copy link
Contributor

@gretanausedaite gretanausedaite commented Aug 29, 2023

Changes

Adding back props API. Now Tile works both ways:

<Tile.Wrapper>
  <Tile.Name name='Best tile ever' />
  <Tile.ThumbnailArea>
    <Tile.ThumbnailPicture url='/local-picture' />
  </Tile.ThumbnailArea>
</Tile.Wrapper>
<Tile
  name='Second best tile ever'
  thumbnail='/another-local-file'
/>

Testing

Added unit test

Docs

Changeset

@gretanausedaite gretanausedaite added this to the React 3.0 milestone Aug 29, 2023
@gretanausedaite gretanausedaite self-assigned this Aug 29, 2023
@gretanausedaite gretanausedaite mentioned this pull request Aug 29, 2023
24 tasks
@gretanausedaite gretanausedaite marked this pull request as ready for review August 29, 2023 14:29
@gretanausedaite gretanausedaite requested review from a team as code owners August 29, 2023 14:29
@gretanausedaite gretanausedaite requested review from mayank99 and r100-stack and removed request for a team August 29, 2023 14:29
<MenuItem key='menuitem-1'>Item 2</MenuItem>,
]}
leftIcon={
<Tile.IconButton>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why IconButton doesn't work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works. Users must pass size='small' button for it to be "as designed"
left is Tile.IconButton, right is IconButton:
image

  • off topic:
    I think we should fix dark icons within those buttons. CSS tests have them white.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, the icons are messed up only in light theme so i didn't even notice 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now i would say use IconButton with manual size='small' in this unit test. we don't want to mix and match old and new apis.

the color issue can be fixed in a separate PR

* Default tile variant or the folder layout.
* @default 'default'
*/
variant?: 'default' | 'folder';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does folder tile work correctly? i think we had some issues supporting both variants with old apis

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tested in the playground and it's working correctly, even with onClick.

looks like it was fixed in #1255 (comment) + #1255 (comment)

Copy link
Member

@r100-stack r100-stack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good if there are some examples using the old Tile API. (Similar to #1502 (review))

examples/Tile.main.tsx and the other Tile examples that are not currently in the PR are giving type errors. I believe Tile should be changed to Tile.Wrapper for the other Tile examples where we want to demo the new API.

image

@mayank99
Copy link
Contributor

i've updated the missed references. i'll leave it on Greta to handle the rest

@gretanausedaite gretanausedaite added this pull request to the merge queue Aug 30, 2023
@r100-stack
Copy link
Member

Would be good if there are some examples using the old Tile API. (Similar to #1502 (review))

@gretanausedaite I noticed you added this to the merge queue. Are we not adding examples using the old Tile API to the website?

Merged via the queue into dev with commit e0270cc Aug 30, 2023
@gretanausedaite gretanausedaite deleted the greta/add-back-tile branch August 30, 2023 15:44
@gretanausedaite
Copy link
Contributor Author

@gretanausedaite I noticed you added this to the merge queue. Are we not adding examples using the old Tile API to the website?

Created #1538

@r100-stack r100-stack mentioned this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants