-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix: Implement skeleton view in workspace member page #43893
Merged
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e80539f
Fix: Implement skeleton view in workspace member page
truph01 135663a
Fix: Remove two last lines
truph01 c97a944
Fix: Type
truph01 c0f0d07
Fix: Merge main
truph01 aea1528
Fix: Lint
truph01 d38cf0b
Fix: Lint
truph01 a1b38f8
Fix: Lint
truph01 02d824f
Fix: Conflict
truph01 ee1ec27
Fix: Remove inline styles
truph01 2b60ac5
Fix: Remove UserListSkeletonView
truph01 08db8dc
Fix: Comment
truph01 8913b18
Fix: Using padding left 16px
truph01 1802c67
Fix: Apply x position 68 to two stacked lines
truph01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import {Circle, Rect} from 'react-native-svg'; | ||
import useTheme from '@hooks/useTheme'; | ||
import type {SkeletonViewProps} from './SelectionList/types'; | ||
import ItemListSkeletonView from './Skeletons/ItemListSkeletonView'; | ||
|
||
function UserListSkeletonView({shouldAnimate = true}: SkeletonViewProps) { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<ItemListSkeletonView | ||
shouldAnimate={shouldAnimate} | ||
itemContainerStyle={{backgroundColor: theme.highlightBG, marginBottom: 12, marginHorizontal: 20, borderRadius: 8}} | ||
renderSkeletonItem={() => ( | ||
<> | ||
<Circle | ||
cx="40" | ||
cy="32" | ||
r="20" | ||
/> | ||
<Rect | ||
x="72" | ||
y="18" | ||
width="20%" | ||
height="8" | ||
/> | ||
<Rect | ||
x="72" | ||
y="38" | ||
width="10%" | ||
height="8" | ||
/> | ||
</> | ||
)} | ||
/> | ||
); | ||
} | ||
|
||
UserListSkeletonView.displayName = 'UserListSkeletonView'; | ||
|
||
export default UserListSkeletonView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this is extremely similar to
OptionsListSkeletonView
, I'm wondering if it would be better to just pass a prop likeisTableList
toOptionsListSkeletonView
, which would keep things more DRY. Any thoughts?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.
@jjcoffee Sorry, you mean that we should remove the UserListSkeletonView component, then handle it in OptionListSkeletonView by passing prop
isUserList
, right?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.
Yeah I think that's tidier, unless you have any other thoughts! I think
isTableList
as a prop name fits better here as we're only styling the list as a table, rather than changing the layout from the base layout to fit something specific for a user list.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.
@jjcoffee In the main branch, we already have
TableListItemSkeleton
,ItemListSkeletonView
, andOptionListSkeletonView
(which is based onItemListSkeletonView
). In this PR, we just added a new skeleton component,UserListSkeletonView
. To maintain consistency with other skeleton components, we should keepUserListSkeletonView
as is. If we plan to letOptionListSkeletonView
handleUserListSkeletonView
by passingisUserList
, we should apply the same approach to the other skeleton components likeTableListItemSkeleton
andItemListSkeletonView
.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.
My point is that
UserListSkeletonView
is almost identical toOptionListSkeletonView
, so I'm not sure how useful it is to split it out into a new component since it doesn't apply any layout changes, just a few style tweaks (as far as I can tell).OptionListSkeletonView
andTableListItemSkeleton
both useItemListSkeletonView
, so I'm not sure your point applies here. Unless I'm missing something!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.
Sorry, why did you say that OptionListSkeletonView uses TableListItemSkeleton? Is there any mistake here?
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.
Haha oops sorry, I meant that they both use
ItemListSkeletonView
. We are displaying anOptionList
here, so I don't know if it makes sense to add a new component as not all user lists should be displayed as tables. I think we are fundamentally saying "here's an option list, but we want it to look like a table".TableListItemSkeleton
uses a completely different layout (not just styling), that's why it needs to be split into a separate component.