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

desktop: clean up profile screen #4347

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions packages/ui/src/components/UserProfileScreenView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import {
View,
XStack,
YStack,
isWeb,
styled,
useTheme,
useWindowDimensions,
} from 'tamagui';

import { useContact, useCurrentUserId, useNavigation } from '../contexts';
import { useCopy } from '../hooks/useCopy';
import useIsWindowNarrow from '../hooks/useIsWindowNarrow';
import { triggerHaptic, useGroupTitle } from '../utils';
import { ContactAvatar, GroupAvatar } from './Avatar';
import { Button } from './Button';
Expand Down Expand Up @@ -138,11 +140,12 @@ function StatusBlock({
label: string;
}) {
const windowDimensions = useWindowDimensions();
const isWindowNarrow = useIsWindowNarrow();

return (
<PaddedBlock
padding="$2xl"
width={(windowDimensions.width - 36) / 2}
width={isWindowNarrow ? (windowDimensions.width - 36) / 2 : '100%'}
gap="$2xl"
>
<XStack width="100%" justifyContent="space-between">
Expand Down Expand Up @@ -216,7 +219,7 @@ export function BioDisplay({
...rest
}: { bio: string } & ComponentProps<typeof WidgetPane>) {
return bio.length ? (
<WidgetPane borderRadius={'$2xl'} padding="$2xl" width="100%" {...rest}>
<WidgetPane borderRadius="$2xl" padding="$2xl" width="100%" {...rest}>
<WidgetPane.Title>About</WidgetPane.Title>
<Text size="$body" trimmed={false}>
{bio}
Expand All @@ -230,9 +233,11 @@ export function StatusDisplay({
...rest
}: { status: string } & ComponentProps<typeof WidgetPane>) {
return (
<WidgetPane borderRadius={'$2xl'} padding="$2xl" width="100%" {...rest}>
<WidgetPane borderRadius="$2xl" padding="$2xl" width="100%" {...rest}>
<WidgetPane.Title>Status</WidgetPane.Title>
<Text size="$body">{status}</Text>
<Text size="$body" trimmed={false}>
{status}
</Text>
</WidgetPane>
);
}
Expand Down Expand Up @@ -464,7 +469,7 @@ function ProfileButton(props: {
flexGrow={1}
flexBasis={1}
borderWidth={0}
paddingVertical={'$xl'}
paddingVertical="$xl"
paddingHorizontal="$2xl"
borderRadius="$2xl"
onPress={handlePress}
Expand All @@ -474,6 +479,8 @@ function ProfileButton(props: {
<Text
size="$label/xl"
color={props.hero ? '$background' : '$primaryText'}
paddingHorizontal={isWeb ? '$m' : undefined}
textWrap="nowrap"
>
{props.title}
</Text>
Expand Down
Loading