Readd the FAB for composing new posts

This commit is contained in:
Paul Frazee 2023-01-16 17:07:33 -06:00
parent f7d7c78611
commit 00b7189d5d
4 changed files with 76 additions and 11 deletions

View file

@ -7,6 +7,7 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {ViewHeader} from '../com/util/ViewHeader'
import {Feed} from '../com/posts/Feed'
import {Text} from '../com/util/text/Text'
import {FAB} from '../com/util/FAB'
import {useStores} from '../../state'
import {ScreenParams} from '../routes'
import {s, colors} from '../lib/styles'
@ -103,6 +104,7 @@ export const Home = observer(function Home({
<Text style={styles.loadLatestText}>Load new posts</Text>
</TouchableOpacity>
) : undefined}
<FAB icon="pen-nib" onPress={onPressCompose} />
</View>
)
})

View file

@ -18,6 +18,7 @@ import {EmptyState} from '../com/util/EmptyState'
import {Text} from '../com/util/text/Text'
import {ViewHeader} from '../com/util/ViewHeader'
import * as Toast from '../com/util/Toast'
import {FAB} from '../com/util/FAB'
import {s, colors} from '../lib/styles'
import {useOnMainScroll} from '../lib/hooks/useOnMainScroll'
@ -89,6 +90,10 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
)
}
const onPressCompose = () => {
store.shell.openComposer({})
}
// rendering
// =
@ -263,6 +268,7 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
) : (
renderHeader()
)}
<FAB icon="pen-nib" onPress={onPressCompose} />
</View>
)
})