-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3458 from tloncorp/lb/android-fixes
mobile: android polish omnibus
- Loading branch information
Showing
26 changed files
with
624 additions
and
319 deletions.
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
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,59 @@ | ||
import * as db from '@tloncorp/shared/dist/db'; | ||
import { ChatMessageActions, Modal, ZStack } from '@tloncorp/ui'; | ||
import { createRef, useEffect, useState } from 'react'; | ||
import { View } from 'react-native'; | ||
|
||
import { ChannelFixture } from './Channel.fixture'; | ||
import { FixtureWrapper } from './FixtureWrapper'; | ||
import { createFakePosts, group } from './fakeData'; | ||
|
||
const post = createFakePosts(1)[0]; | ||
|
||
function MessageActions() { | ||
const [currentChannel, setCurrentChannel] = useState<db.Channel | null>(null); | ||
const refStub = createRef<View>(); | ||
|
||
useEffect(() => { | ||
if (group) { | ||
const firstChatChannel = group.channels?.find((c) => c.type === 'chat'); | ||
if (firstChatChannel) { | ||
setCurrentChannel(firstChatChannel); | ||
} | ||
} | ||
}, []); | ||
|
||
if (currentChannel) { | ||
return ( | ||
<Modal visible={true} onDismiss={() => null}> | ||
<ChatMessageActions | ||
currentUserId={'~latter-bolden'} | ||
post={post} | ||
postRef={refStub} | ||
onDismiss={() => null} | ||
channelType={currentChannel.type} | ||
/> | ||
</Modal> | ||
); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
export default { | ||
light: ( | ||
<FixtureWrapper fillHeight fillWidth> | ||
<ZStack flex={1}> | ||
<ChannelFixture /> | ||
<MessageActions /> | ||
</ZStack> | ||
</FixtureWrapper> | ||
), | ||
dark: ( | ||
<FixtureWrapper fillHeight fillWidth theme="dark"> | ||
<ZStack flex={1}> | ||
<ChannelFixture theme="dark" /> | ||
<MessageActions /> | ||
</ZStack> | ||
</FixtureWrapper> | ||
), | ||
}; |
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 was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
packages/ui/src/components/ActionList/ListFrame.android.tsx
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,13 @@ | ||
import { YStack, styled } from 'tamagui'; | ||
|
||
const ListFrame = styled(YStack, { | ||
overflow: 'hidden', | ||
backgroundColor: '$secondaryBackground', | ||
shadowColor: '$black', | ||
shadowOffset: { width: 0, height: 2 }, | ||
shadowOpacity: 0.25, | ||
shadowRadius: 3.84, | ||
elevation: 5, | ||
}); | ||
|
||
export default ListFrame; |
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,31 @@ | ||
import { BlurView } from 'expo-blur'; | ||
import { ComponentProps, PropsWithChildren } from 'react'; | ||
import { YStack, styled } from 'tamagui'; | ||
|
||
import { ListItemFrame } from '../ListItem'; | ||
|
||
const ListFrame = styled(YStack, { | ||
overflow: 'hidden', | ||
borderRadius: '$m', | ||
}); | ||
|
||
const ListFrameComponent = ( | ||
props: PropsWithChildren< | ||
ComponentProps<typeof ListItemFrame> & ComponentProps<typeof BlurView> | ||
> | ||
) => { | ||
const { children, intensity, tint, ...rest } = props; | ||
return ( | ||
<ListFrame {...rest}> | ||
<BlurView | ||
style={{ flex: 1 }} | ||
intensity={intensity ?? 80} | ||
tint={tint ?? 'extraLight'} | ||
> | ||
{children} | ||
</BlurView> | ||
</ListFrame> | ||
); | ||
}; | ||
|
||
export default ListFrameComponent; |
Oops, something went wrong.