Skip to content

Commit

Permalink
Merge pull request #4320 from tloncorp/hm/modals-desktop
Browse files Browse the repository at this point in the history
desktop: modal cleanup
  • Loading branch information
arthyn authored Jan 9, 2025
2 parents 439e905 + 52d6a75 commit 2d5346f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
5 changes: 2 additions & 3 deletions packages/ui/src/components/ActionList/ListFrame.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { BlurView } from 'expo-blur';
import { ComponentProps, PropsWithChildren } from 'react';
import { YStack, styled } from 'tamagui';
import { XStack, YStack, styled } from 'tamagui';

import useIsWindowNarrow from '../../hooks/useIsWindowNarrow';
import { ListItemFrame } from '../ListItem';

const ListFrame = styled(YStack, {
overflow: 'hidden',
Expand All @@ -12,7 +11,7 @@ const ListFrame = styled(YStack, {

const ListFrameComponent = (
props: PropsWithChildren<
ComponentProps<typeof ListItemFrame> & ComponentProps<typeof BlurView>
ComponentProps<typeof XStack> & ComponentProps<typeof BlurView>
>
) => {
const { children, intensity, tint, ...rest } = props;
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/ActionList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ComponentProps, PropsWithChildren } from 'react';
import { styled, withStaticProperties } from 'tamagui';

import { ListItem, ListItemFrame } from '../ListItem';
import { ListItem } from '../ListItem';
import ListFrame from './ListFrame';

const ActionFrame = styled(ListItemFrame, {
const ActionFrame = styled(ListItem, {
borderRadius: 'unset',
borderBottomWidth: 0.5,
borderBottomColor: '$secondaryBorder',
Expand Down
8 changes: 6 additions & 2 deletions packages/ui/src/components/ActionSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Modal, useWindowDimensions } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import {
Dialog,
ScrollView,
SheetProps,
View,
VisuallyHidden,
Expand Down Expand Up @@ -121,8 +122,10 @@ const ActionSheetComponent = ({
maxWidth={800}
minWidth={400}
key="content"
maxHeight="100%"
marginVertical="$2xl"
>
{children}
<ScrollView>{children}</ScrollView>
</Dialog.Content>
</Dialog.Portal>

Expand Down Expand Up @@ -355,6 +358,7 @@ const ActionSheetActionFrame = styled(ListItem, {
borderRadius: 0,
paddingHorizontal: '$2xl',
paddingVertical: '$l',
alignItems: 'center',
$gtSm: {
paddingHorizontal: '$l',
paddingVertical: '$m',
Expand Down Expand Up @@ -404,7 +408,7 @@ const ActionSheetActionDescription = styled(ListItem.Subtitle, {
context: ActionSheetActionGroupContext,
maxWidth: '100%',
$gtSm: {
maxWidth: 200,
maxWidth: '100%',
},
variants: {
accent: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/ChatOptionsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ function ChatOptionsSheetContent({
{icon}
<ActionSheet.MainContent>
<ListItem.Title>{title}</ListItem.Title>
<ListItem.Subtitle $gtSm={{ maxWidth: 100 }}>
<ListItem.Subtitle $gtSm={{ maxWidth: '100%' }}>
{subtitle}
</ListItem.Subtitle>
</ActionSheet.MainContent>
Expand Down
5 changes: 2 additions & 3 deletions packages/ui/src/components/ListItem/GroupListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// sort-imports-ignore
import type * as db from '@tloncorp/shared/db';
import * as logic from '@tloncorp/shared/logic';
import { View, isWeb } from 'tamagui';
Expand All @@ -8,8 +9,7 @@ import { Button } from '../Button';
import { ContactName } from '../ContactNameV2';
import { Icon } from '../Icon';
import Pressable from '../Pressable';
import type { ListItemProps } from './ListItem';
import { ListItem } from './ListItem';
import { ListItem, ListItemProps } from './ListItem';
import { getGroupStatus, getPostTypeIcon } from './listItemUtils';

export const GroupListItem = ({
Expand Down Expand Up @@ -99,7 +99,6 @@ export const GroupListItem = ({
{isWeb && !isPending && (
<View position="absolute" right="$-2xs" top="$2xl" zIndex={1}>
<Button
onPress={handleLongPress}
borderWidth="unset"
paddingHorizontal={0}
marginHorizontal="$-m"
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/components/ListItem/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ const ListItemEndContent = styled(YStack, {
gap: '$2xs',
justifyContent: 'center',
alignItems: 'flex-end',
$gtSm: {
paddingTop: 0,
},
});

export type ListItem = typeof ListItemFrame;
Expand Down

0 comments on commit 2d5346f

Please sign in to comment.