-
Notifications
You must be signed in to change notification settings - Fork 2
feature/BA-2725 profile summary drawer #301
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9264bf6
feature/BA-2725 profile summary drawer
rf2tsl 8fbca84
qa updates
rf2tsl 45f5d2c
review updates
rf2tsl e72e448
fix aria label
rf2tsl 56a6e1e
code rabbit update
rf2tsl 1bd4d8f
fix image sizing
rf2tsl bc036de
more review changes
rf2tsl a325e7c
function name changes
rf2tsl 1744858
code rabbit fix
rf2tsl dff3918
Merge branch 'master' of github.com:silverlogic/baseapp-frontend into…
rf2tsl 1fc6069
changelogs
rf2tsl 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
84 changes: 84 additions & 0 deletions
84
packages/components/modules/messages/web/ProfileSummary/Body/index.tsx
This file contains hidden or 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,84 @@ | ||
| import { FC } from 'react' | ||
|
|
||
| import { CircledAvatar } from '@baseapp-frontend/design-system/components/web/avatars' | ||
| import { IconButton } from '@baseapp-frontend/design-system/components/web/buttons' | ||
| import { | ||
| NewGroupIcon, | ||
| ProfileNoCircleIcon, | ||
| } from '@baseapp-frontend/design-system/components/web/icons' | ||
| import { TypographyWithEllipsis } from '@baseapp-frontend/design-system/components/web/typographies' | ||
|
|
||
| import { Box, Divider, Typography } from '@mui/material' | ||
|
|
||
| import { | ||
| ButtonContainer, | ||
| HeaderContainer, | ||
| Subheader, | ||
| SubheaderContainer, | ||
| TitleContainer, | ||
| } from './styled' | ||
| import { BodyProps } from './types' | ||
|
|
||
| const Body: FC<BodyProps> = ({ avatar, avatarSize = 144, biography, username, name, pk }) => { | ||
| const formattedUsername = username ? username.replace(/^\/+/, '') : '' | ||
| const profilePath = username ?? `/profile/${pk}` | ||
rf2tsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return ( | ||
| <Box sx={{ display: 'grid', gridTemplateRows: 'auto 1fr' }}> | ||
| <HeaderContainer> | ||
| <CircledAvatar src={avatar} width={avatarSize} height={avatarSize} hasError={false} /> | ||
| <TitleContainer> | ||
| <TypographyWithEllipsis variant="subtitle1" color="text.primary"> | ||
| {name} | ||
| </TypographyWithEllipsis> | ||
| <TypographyWithEllipsis variant="body2" color="text.secondary"> | ||
| {`@${formattedUsername}`} | ||
| </TypographyWithEllipsis> | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </TitleContainer> | ||
| </HeaderContainer> | ||
| <SubheaderContainer> | ||
| <ButtonContainer> | ||
| <IconButton | ||
| size="small" | ||
| aria-label="go to profile" | ||
| onClick={() => window.open(profilePath, '_blank')} | ||
| sx={{ maxWidth: 'fit-content', gap: '8px' }} | ||
| > | ||
| <ProfileNoCircleIcon sx={{ fontSize: '18px' }} /> | ||
| <Typography variant="subtitle2" color="text.primary"> | ||
| Go to profile | ||
| </Typography> | ||
| </IconButton> | ||
|
|
||
| <IconButton | ||
| size="small" | ||
| aria-label="edit group chat" | ||
| sx={{ maxWidth: 'fit-content', gap: '8px' }} | ||
| > | ||
| <NewGroupIcon sx={{ fontSize: '18px', color: 'text.primary' }} /> | ||
| <Typography variant="subtitle2" color="text.primary"> | ||
| Add contact to a group | ||
| </Typography> | ||
| </IconButton> | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </ButtonContainer> | ||
| <Subheader> | ||
| <Typography variant="subtitle2" color="text.primary"> | ||
| About | ||
| </Typography> | ||
| </Subheader> | ||
| <Divider /> | ||
| <Subheader> | ||
| <Typography variant="caption" color="text.secondary"> | ||
| {biography?.split('\n').map((line, index) => ( | ||
| <span key={index}> | ||
| {line} | ||
| {index < biography.split('\n').length - 1 && <br />} | ||
| </span> | ||
| ))} | ||
| </Typography> | ||
| </Subheader> | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </SubheaderContainer> | ||
| </Box> | ||
| ) | ||
| } | ||
|
|
||
| export default Body | ||
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.
Uh oh!
There was an error while loading. Please reload this page.