mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
iOS almost working
This commit is contained in:
41
src/screens/Compose/Root/Header.tsx
Normal file
41
src/screens/Compose/Root/Header.tsx
Normal file
@ -0,0 +1,41 @@
|
||||
import {
|
||||
getLocalActiveIndex,
|
||||
getLocalInstances
|
||||
} from '@utils/slices/instancesSlice'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import React, { useContext } from 'react'
|
||||
import { StyleSheet, View } from 'react-native'
|
||||
import { useSelector } from 'react-redux'
|
||||
import ComposeContext from '../utils/createContext'
|
||||
import ComposePostingAs from './Header/PostingAs'
|
||||
import ComposeSpoilerInput from './Header/SpoilerInput'
|
||||
import ComposeTextInput from './Header/TextInput'
|
||||
|
||||
const ComposeRootHeader: React.FC = () => {
|
||||
const { composeState } = useContext(ComposeContext)
|
||||
const localActiveIndex = useSelector(getLocalActiveIndex)
|
||||
const localInstances = useSelector(getLocalInstances)
|
||||
|
||||
return (
|
||||
<>
|
||||
{localActiveIndex !== null &&
|
||||
localInstances.length &&
|
||||
localInstances.length > 1 && (
|
||||
<View style={styles.postingAs}>
|
||||
<ComposePostingAs />
|
||||
</View>
|
||||
)}
|
||||
{composeState.spoiler.active ? <ComposeSpoilerInput /> : null}
|
||||
<ComposeTextInput />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
postingAs: {
|
||||
marginHorizontal: StyleConstants.Spacing.Global.PagePadding,
|
||||
marginTop: StyleConstants.Spacing.S
|
||||
}
|
||||
})
|
||||
|
||||
export default ComposeRootHeader
|
Reference in New Issue
Block a user