tooot/src/components/Timeline/Shared/HeaderDefault.ios.tsx

76 lines
2.5 KiB
TypeScript
Raw Normal View History

2021-02-13 01:26:02 +01:00
import Icon from '@components/Icon'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
2020-12-13 14:04:25 +01:00
import { StyleConstants } from '@utils/styles/constants'
2021-02-13 01:26:02 +01:00
import { useTheme } from '@utils/styles/ThemeManager'
2022-06-07 20:07:14 +02:00
import React, { useContext } from 'react'
2021-04-09 21:43:12 +02:00
import { useTranslation } from 'react-i18next'
2022-08-09 00:44:56 +02:00
import { Pressable, View } from 'react-native'
2022-06-06 22:49:43 +02:00
import ContextMenu from 'react-native-context-menu-view'
import { ContextMenuContext } from './ContextMenu'
import HeaderSharedAccount from './HeaderShared/Account'
2021-01-01 23:10:47 +01:00
import HeaderSharedApplication from './HeaderShared/Application'
import HeaderSharedCreated from './HeaderShared/Created'
2021-01-11 21:36:57 +01:00
import HeaderSharedMuted from './HeaderShared/Muted'
2021-02-13 01:26:02 +01:00
import HeaderSharedVisibility from './HeaderShared/Visibility'
2020-10-25 01:35:41 +02:00
2020-10-31 21:04:46 +01:00
export interface Props {
2021-01-07 19:13:09 +01:00
queryKey?: QueryKeyTimeline
2020-12-03 01:28:56 +01:00
status: Mastodon.Status
highlighted: boolean
2020-10-31 21:04:46 +01:00
}
2022-06-06 22:49:43 +02:00
const TimelineHeaderDefault = ({ queryKey, status, highlighted }: Props) => {
const { t } = useTranslation('componentContextMenu')
2022-04-30 21:29:08 +02:00
const { colors } = useTheme()
2021-01-30 01:29:15 +01:00
2022-06-07 20:07:14 +02:00
const contextMenuContext = useContext(ContextMenuContext)
2022-06-06 22:49:43 +02:00
2022-04-30 21:29:08 +02:00
return (
<View style={{ flex: 1, flexDirection: 'row' }}>
2022-06-06 22:49:43 +02:00
<View style={{ flex: 7 }}>
2022-04-30 21:29:08 +02:00
<HeaderSharedAccount account={status.account} />
<View
style={{
flexDirection: 'row',
alignItems: 'center',
marginTop: StyleConstants.Spacing.XS,
marginBottom: StyleConstants.Spacing.S
}}
>
<HeaderSharedCreated
created_at={status.created_at}
edited_at={status.edited_at}
highlighted={highlighted}
2021-02-27 16:33:54 +01:00
/>
2022-04-30 21:29:08 +02:00
<HeaderSharedVisibility visibility={status.visibility} />
<HeaderSharedMuted muted={status.muted} />
<HeaderSharedApplication application={status.application} />
</View>
2021-02-27 16:33:54 +01:00
</View>
2020-10-25 01:35:41 +02:00
2022-08-09 00:44:56 +02:00
{queryKey ? (
2022-04-30 21:29:08 +02:00
<Pressable
2022-06-06 22:49:43 +02:00
accessibilityHint={t('accessibilityHint')}
Test updates (#456) * Build succeeded * Fix RN update caused Android build error Spent whole fucking 2 days to figure this out https://github.com/facebook/react-native/issues/35210 * Fixed #408 Potentially because of too small pressable area * Fixed #439 * Bump up RN and Expo * Fixed #450 * Spelling (#449) * spelling: announcement Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: corrupted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dimensions Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: favourites Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: mutation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: retrieve Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: transitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * Fixed #451 More properly adjusted flexbox layout * Partial fix of #444 It is possible to implement what the web does but that adds additional resources which I believe is not justified. Filtering is meant to be precise. Even hiding the entire block that you still would like to take a look at the content, then why would you set up a certain filter then. Though showing the matched filter is still useful. * New Crowdin updates (#440) * New translations tabs.json (German) * New translations tabs.json (Italian) * New translations tabs.json (Japanese) * New translations tabs.json (Korean) * New translations tabs.json (Chinese Simplified) * New translations tabs.json (Chinese Traditional) * New translations tabs.json (Vietnamese) * New translations tabs.json (Portuguese, Brazilian) * New translations tabs.json (Chinese Simplified) * New translations instance.json (German) * New translations parse.json (German) * New translations timeline.json (German) * New translations mediaSelector.json (German) * New translations emojis.json (German) * New translations contextMenu.json (German) * New translations actions.json (German) * New translations compose.json (German) * New translations accountSelection.json (German) * New translations timeline.json (German) * New translations contextMenu.json (German) * New translations actions.json (German) * New translations compose.json (German) * New translations tabs.json (German) * New translations screens.json (German) * New translations common.json (French) * New translations instance.json (French) * New translations parse.json (French) * New translations relationship.json (French) * New translations timeline.json (French) * New translations actions.json (French) * New translations imageViewer.json (French) * New translations announcements.json (French) * New translations compose.json (French) * New translations screens.json (French) * New translations tabs.json (French) * New translations mediaSelector.json (French) * New translations emojis.json (French) * New translations contextMenu.json (French) * New translations accountSelection.json (French) * New translations actions.json (French) * New translations announcements.json (French) * New translations compose.json (French) * New translations accountSelection.json (French) * New translations instance.json (French) * New translations parse.json (French) * New translations relationship.json (French) * New translations timeline.json (French) * New translations imageViewer.json (French) * New translations compose.json (French) * New translations tabs.json (French) * New translations mediaSelector.json (French) * New translations emojis.json (French) * New translations contextMenu.json (French) * New translations common.json (French) * New translations compose.json (French) * New translations screens.json (French) * New translations tabs.json (French) * New translations contextMenu.json (French) * New translations common.json (French) * New translations instance.json (French) * Added French translation 🇫🇷 * Fixed #454 * Fixed #443 Basically matching all none whitespace characters * Fixed #446 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-12 17:59:32 +01:00
style={{ flex: 1, flexBasis: StyleConstants.Font.Size.L }}
2022-06-06 22:49:43 +02:00
>
<ContextMenu
Test updates (#456) * Build succeeded * Fix RN update caused Android build error Spent whole fucking 2 days to figure this out https://github.com/facebook/react-native/issues/35210 * Fixed #408 Potentially because of too small pressable area * Fixed #439 * Bump up RN and Expo * Fixed #450 * Spelling (#449) * spelling: announcement Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: corrupted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dimensions Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: favourites Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: mutation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: retrieve Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: transitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * Fixed #451 More properly adjusted flexbox layout * Partial fix of #444 It is possible to implement what the web does but that adds additional resources which I believe is not justified. Filtering is meant to be precise. Even hiding the entire block that you still would like to take a look at the content, then why would you set up a certain filter then. Though showing the matched filter is still useful. * New Crowdin updates (#440) * New translations tabs.json (German) * New translations tabs.json (Italian) * New translations tabs.json (Japanese) * New translations tabs.json (Korean) * New translations tabs.json (Chinese Simplified) * New translations tabs.json (Chinese Traditional) * New translations tabs.json (Vietnamese) * New translations tabs.json (Portuguese, Brazilian) * New translations tabs.json (Chinese Simplified) * New translations instance.json (German) * New translations parse.json (German) * New translations timeline.json (German) * New translations mediaSelector.json (German) * New translations emojis.json (German) * New translations contextMenu.json (German) * New translations actions.json (German) * New translations compose.json (German) * New translations accountSelection.json (German) * New translations timeline.json (German) * New translations contextMenu.json (German) * New translations actions.json (German) * New translations compose.json (German) * New translations tabs.json (German) * New translations screens.json (German) * New translations common.json (French) * New translations instance.json (French) * New translations parse.json (French) * New translations relationship.json (French) * New translations timeline.json (French) * New translations actions.json (French) * New translations imageViewer.json (French) * New translations announcements.json (French) * New translations compose.json (French) * New translations screens.json (French) * New translations tabs.json (French) * New translations mediaSelector.json (French) * New translations emojis.json (French) * New translations contextMenu.json (French) * New translations accountSelection.json (French) * New translations actions.json (French) * New translations announcements.json (French) * New translations compose.json (French) * New translations accountSelection.json (French) * New translations instance.json (French) * New translations parse.json (French) * New translations relationship.json (French) * New translations timeline.json (French) * New translations imageViewer.json (French) * New translations compose.json (French) * New translations tabs.json (French) * New translations mediaSelector.json (French) * New translations emojis.json (French) * New translations contextMenu.json (French) * New translations common.json (French) * New translations compose.json (French) * New translations screens.json (French) * New translations tabs.json (French) * New translations contextMenu.json (French) * New translations common.json (French) * New translations instance.json (French) * Added French translation 🇫🇷 * Fixed #454 * Fixed #443 Basically matching all none whitespace characters * Fixed #446 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-12 17:59:32 +01:00
style={{ flex: 1, alignItems: 'center' }}
2022-06-17 00:14:32 +02:00
dropdownMenuMode
2022-06-07 20:07:14 +02:00
actions={contextMenuContext}
onPress={() => {}}
2022-06-06 22:49:43 +02:00
children={
<Icon
name='MoreHorizontal'
color={colors.secondary}
size={StyleConstants.Font.Size.L}
/>
}
/>
</Pressable>
2022-04-30 21:29:08 +02:00
) : null}
</View>
)
}
2020-10-25 01:35:41 +02:00
2021-02-27 16:33:54 +01:00
export default TimelineHeaderDefault