-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Feature/35712 redesign of members list #37074
Merged
luacmartins
merged 19 commits into
Expensify:main
from
burczu:feature/35712-redesign-of-members-list
Feb 22, 2024
Merged
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d24b4f5
table list item component introduced
burczu 1f638ed
workspace members page: search removed and new list item used
burczu 316863b
members list items styling added
burczu 9a28821
custom list header handled
burczu 61f20d1
badge positioning fixed
burczu 2f81b23
component name fixed
burczu 2ff80c9
simplified statement
burczu 32ee7cd
badge styles adjusted
burczu 35d430b
lint fixed
burczu 330927f
prettier, one more time...
burczu 7f43da6
switched to use badge component
burczu 5a4a6b1
Merge branch 'main' into feature/35712-redesign-of-members-list
burczu 957cce7
badge styles adjusted
burczu 9f7fab4
table list item padding fixed
burczu ddf1f64
unnecessary styles removed
burczu b5c721a
role column text center alligned
burczu bce9160
Merge branch 'main' into feature/35712-redesign-of-members-list
burczu 5833bea
unnecessary underscore reference removed
burczu 118ca71
fix after main sync
burczu 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import MultipleAvatars from '@components/MultipleAvatars'; | ||
import TextWithTooltip from '@components/TextWithTooltip'; | ||
import useStyleUtils from '@hooks/useStyleUtils'; | ||
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import BaseListItem from './BaseListItem'; | ||
import type {TableListItemProps} from './types'; | ||
|
||
function TableListItem({ | ||
item, | ||
isFocused, | ||
showTooltip, | ||
isDisabled, | ||
canSelectMultiple, | ||
onSelectRow, | ||
onDismissError, | ||
shouldPreventDefaultFocusOnSelectRow, | ||
rightHandSideComponent, | ||
}: TableListItemProps) { | ||
const styles = useThemeStyles(); | ||
const theme = useTheme(); | ||
const StyleUtils = useStyleUtils(); | ||
|
||
const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor; | ||
const hoveredBackgroundColor = styles.sidebarLinkHover?.backgroundColor ? styles.sidebarLinkHover.backgroundColor : theme.sidebar; | ||
|
||
return ( | ||
<BaseListItem | ||
item={item} | ||
pressableStyle={[[styles.selectionListPressableItemWrapper, isFocused && styles.activeComponentBG]]} | ||
wrapperStyle={[styles.flexRow, styles.flex1, styles.justifyContentBetween, styles.userSelectNone, styles.alignItemsCenter, isFocused && styles.sidebarLinkActive]} | ||
selectMultipleStyle={[StyleUtils.getCheckboxContainerStyle(20), StyleUtils.getMultiselectListStyles(!!item.isSelected, !!item.isDisabled)]} | ||
isFocused={isFocused} | ||
isDisabled={isDisabled} | ||
showTooltip={showTooltip} | ||
canSelectMultiple={canSelectMultiple} | ||
onSelectRow={onSelectRow} | ||
onDismissError={onDismissError} | ||
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow} | ||
rightHandSideComponent={rightHandSideComponent} | ||
errors={item.errors} | ||
pendingAction={item.pendingAction} | ||
keyForList={item.keyForList} | ||
> | ||
{(hovered) => ( | ||
<> | ||
{!!item.icons && ( | ||
<MultipleAvatars | ||
icons={item.icons ?? []} | ||
shouldShowTooltip={showTooltip} | ||
secondAvatarStyle={[ | ||
StyleUtils.getBackgroundAndBorderStyle(theme.sidebar), | ||
isFocused ? StyleUtils.getBackgroundAndBorderStyle(focusedBackgroundColor) : undefined, | ||
hovered && !isFocused ? StyleUtils.getBackgroundAndBorderStyle(hoveredBackgroundColor) : undefined, | ||
]} | ||
/> | ||
)} | ||
<View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsStretch]}> | ||
<TextWithTooltip | ||
shouldShowTooltip={showTooltip} | ||
text={item.text} | ||
textStyles={[ | ||
styles.optionDisplayName, | ||
isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText, | ||
styles.sidebarLinkTextBold, | ||
styles.pre, | ||
item.alternateText ? styles.mb1 : null, | ||
styles.justifyContentCenter, | ||
]} | ||
/> | ||
{!!item.alternateText && ( | ||
<TextWithTooltip | ||
shouldShowTooltip={showTooltip} | ||
text={item.alternateText} | ||
textStyles={[styles.textLabelSupporting, styles.lh16, styles.pre]} | ||
/> | ||
)} | ||
</View> | ||
{!!item.rightElement && item.rightElement} | ||
</> | ||
)} | ||
</BaseListItem> | ||
); | ||
} | ||
|
||
TableListItem.displayName = 'TableListItem'; | ||
|
||
export default TableListItem; |
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 |
---|---|---|
|
@@ -195,6 +195,7 @@ export default { | |
iAcceptThe: 'Acepto los ', | ||
remove: 'Eliminar', | ||
admin: 'Administrador', | ||
owner: 'Poseedor', | ||
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. NAB I think this should be |
||
dateFormat: 'AAAA-MM-DD', | ||
send: 'Enviar', | ||
notifications: 'Notificaciones', | ||
|
@@ -298,6 +299,8 @@ export default { | |
of: 'de', | ||
default: 'Predeterminado', | ||
update: 'Actualizar', | ||
member: 'Miembro', | ||
role: 'Role', | ||
}, | ||
location: { | ||
useCurrent: 'Usar ubicación actual', | ||
|
@@ -1769,6 +1772,7 @@ export default { | |
}, | ||
addedWithPrimary: 'Se agregaron algunos usuarios con sus nombres de usuario principales.', | ||
invitedBySecondaryLogin: ({secondaryLogin}) => `Agregado por nombre de usuario secundario ${secondaryLogin}.`, | ||
membersListTitle: 'Directorio de todos los miembros del espacio de trabajo.', | ||
}, | ||
card: { | ||
header: 'Desbloquea Tarjetas Expensify gratis', | ||
|
Oops, something went wrong.
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.
Hi team, come from this issue #37293:
styles.sidebarLinkActive
isFocused
style inwrapperStyle
otherwise it causes the above bug.