Skip to content

Commit

Permalink
fix: Long user names affect position of QR code
Browse files Browse the repository at this point in the history
Long user names affect position of QR code

Signed-off-by: Iuri Pereira <iuricmp@gmail.com>

fix #4391
  • Loading branch information
iuricmp committed Aug 6, 2023
1 parent 09f4cc6 commit 641fcca
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
20 changes: 16 additions & 4 deletions js/packages/screens/chat/Share/Share.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,36 @@ const ScanBody: FC<{ visible: boolean }> = ({ visible = true }) => {
}

const ShareQr: FC = () => {
const { margin } = useStyles()
const { margin, flex } = useStyles()
const { windowWidth, windowHeight, scaleSize } = useAppDimensions()
const account = useAccount()
const qrCodeSize = Math.min(windowHeight, windowWidth) * 0.45

return (
<View>
<View
style={[
{
alignItems: 'center',
justifyContent: 'center',
},
]}
>
<View
style={[
flex.align.center,
flex.justify.center,
flex.direction.row,
margin.top.big,
margin.bottom.small,
{ alignItems: 'center', flexDirection: 'row', justifyContent: 'center' },
margin.horizontal.big,
]}
>
<View style={[margin.right.small]}>
<AccountAvatar size={24 * scaleSize} />
</View>
<UnifiedText>{account.displayName || ''}</UnifiedText>
<UnifiedText numberOfLines={2} ellipsizeMode='tail'>
{account.displayName || ''}
</UnifiedText>
</View>
<QrCode size={qrCodeSize} />
</View>
Expand Down
26 changes: 22 additions & 4 deletions js/packages/screens/chat/Share/__snapshots__/Share.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 641fcca

Please sign in to comment.