diff --git a/apps/mobile/app.json b/apps/mobile/app.json index de9cecc1..ce29ee90 100644 --- a/apps/mobile/app.json +++ b/apps/mobile/app.json @@ -2,7 +2,7 @@ "expo": { "name": "mobile", "slug": "status-poc", - "version": "1.0.2", + "version": "1.0.3", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", diff --git a/apps/vite/package.json b/apps/vite/package.json index ce5345f2..e7298642 100644 --- a/apps/vite/package.json +++ b/apps/vite/package.json @@ -11,6 +11,7 @@ "@status-im/components": "*", "@status-im/icons": "*", "@tamagui/core": "1.0.15", + "expo-blur": "~12.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-native-web": "^0.18.6" diff --git a/apps/vite/src/app.tsx b/apps/vite/src/app.tsx index e0853bc4..b6d560f8 100644 --- a/apps/vite/src/app.tsx +++ b/apps/vite/src/app.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { cloneElement, useRef, useState } from 'react' import { Composer, @@ -7,11 +7,15 @@ import { SidebarMembers, Topbar, } from '@status-im/components' +import { useBlur } from '@status-im/components/hooks' +import { COMMUNITIES } from '@status-im/components/src/sidebar/mock-data' import { Stack, styled, TamaguiProvider } from '@tamagui/core' import { AnimatePresence } from 'tamagui' import tamaguiConfig from '../tamagui.config' +import type { ReactElement, ReactNode } from 'react' + type ThemeVars = 'light' | 'dark' const AnimatableDrawer = styled(Stack, { @@ -36,15 +40,28 @@ function App() { const [showMembers, setShowMembers] = useState(false) const [selectedChannel, setSelectedChannel] = useState('welcome') + const refMessagesContainer = useRef(null) - const onChannelPress = (id: string) => { + // TODO - this is a hack to get the icon to show up in the topbar when a channel is selected on mount + const [icon, setIcon] = useState( + cloneElement(COMMUNITIES[0].channels[0].icon as ReactElement, { + hasBackground: false, + }) + ) + + const onChannelPress = (id: string, icon?: ReactNode) => { setSelectedChannel(id) + setIcon(icon) } + const { shouldBlurTop, shouldBlurBottom } = useBlur({ + ref: refMessagesContainer, + }) + return (
-