diff options
Diffstat (limited to 'src/screens/Hashtag.tsx')
-rw-r--r-- | src/screens/Hashtag.tsx | 71 |
1 files changed, 30 insertions, 41 deletions
diff --git a/src/screens/Hashtag.tsx b/src/screens/Hashtag.tsx index adf5f0080..a0fc3707c 100644 --- a/src/screens/Hashtag.tsx +++ b/src/screens/Hashtag.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {ListRenderItemInfo, Pressable, View} from 'react-native' +import {ListRenderItemInfo, View} from 'react-native' import {PostView} from '@atproto/api/dist/client/types/app/bsky/feed/defs' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -13,16 +13,15 @@ import {shareUrl} from '#/lib/sharing' import {cleanError} from '#/lib/strings/errors' import {sanitizeHandle} from '#/lib/strings/handles' import {enforceLen} from '#/lib/strings/helpers' -import {isNative, isWeb} from '#/platform/detection' import {useSearchPostsQuery} from '#/state/queries/search-posts' import {useSetDrawerSwipeDisabled, useSetMinimalShellMode} from '#/state/shell' import {Pager} from '#/view/com/pager/Pager' import {TabBar} from '#/view/com/pager/TabBar' import {Post} from '#/view/com/post/Post' import {List} from '#/view/com/util/List' -import {ViewHeader} from '#/view/com/util/ViewHeader' -import {CenteredView} from '#/view/com/util/Views' -import {ArrowOutOfBox_Stroke2_Corner0_Rounded} from '#/components/icons/ArrowOutOfBox' +import {atoms as a, web} from '#/alf' +import {Button, ButtonIcon} from '#/components/Button' +import {ArrowOutOfBox_Stroke2_Corner0_Rounded as Share} from '#/components/icons/ArrowOutOfBox' import * as Layout from '#/components/Layout' import {ListFooter, ListMaybePlaceholder} from '#/components/Lists' @@ -110,46 +109,36 @@ export default function HashtagScreen({ return ( <Layout.Screen> - <CenteredView sideBorders={true}> - <ViewHeader - showOnDesktop - title={headerTitle} - subtitle={author ? _(msg`From @${sanitizedAuthor}`) : undefined} - canGoBack - renderButton={ - isNative - ? () => ( - <Pressable - accessibilityRole="button" - onPress={onShare} - hitSlop={HITSLOP_10}> - <ArrowOutOfBox_Stroke2_Corner0_Rounded - size="lg" - onPress={onShare} - /> - </Pressable> - ) - : undefined - } - /> - </CenteredView> + <Layout.Header.Outer> + <Layout.Header.BackButton /> + <Layout.Header.Content> + <Layout.Header.TitleText>{headerTitle}</Layout.Header.TitleText> + {author && ( + <Layout.Header.SubtitleText> + {_(msg`From @${sanitizedAuthor}`)} + </Layout.Header.SubtitleText> + )} + </Layout.Header.Content> + <Layout.Header.Slot> + <Button + label={_(msg`Share`)} + size="small" + variant="ghost" + color="primary" + shape="round" + onPress={onShare} + hitSlop={HITSLOP_10} + style={[{right: -3}]}> + <ButtonIcon icon={Share} size="md" /> + </Button> + </Layout.Header.Slot> + </Layout.Header.Outer> <Pager onPageSelected={onPageSelected} renderTabBar={props => ( - <CenteredView - sideBorders={true} - // @ts-ignore web only - style={ - isWeb - ? { - position: isWeb ? 'sticky' : '', - top: 0, - zIndex: 1, - } - : undefined - }> + <Layout.Center style={web([a.sticky, a.z_10, {top: 0}])}> <TabBar items={sections.map(section => section.title)} {...props} /> - </CenteredView> + </Layout.Center> )} initialPage={0}> {sections.map((section, i) => ( |