Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,27 @@ function HeaderAction(props: HeaderActionProps) {

if (ActionComponent) return ActionComponent

if (content && icon) {
return (
<TouchableOpacity
style={[$actionContainer, { backgroundColor }]}
onPress={onPress}
disabled={!onPress}
activeOpacity={0.8}
>
<Icon
size={24}
icon={icon}
color={iconColor}
onPress={onPress}
containerStyle={[$actionIconContainer, { backgroundColor }]}
style={isRTL ? { transform: [{ rotate: "180deg" }] } : {}}
/>
<Text weight="medium" size="md" text={content} style={$actionText} />
</TouchableOpacity>
)
}

if (content) {
return (
<TouchableOpacity
Expand Down Expand Up @@ -277,6 +298,16 @@ const $title: TextStyle = {
textAlign: "center",
}

const $actionContainer: ViewStyle = {
flexGrow: 0,
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
height: "100%",
paddingHorizontal: spacing.md,
zIndex: 2,
}

const $actionTextContainer: ViewStyle = {
flexGrow: 0,
alignItems: "center",
Expand Down
2 changes: 1 addition & 1 deletion app/screens/ContentViewScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ContentViewScreen: FC<ContentViewScreenProps> = observer(function C
<Screen style={$root} contentContainerStyle={$styles.flex1}>
<Header
onLeftPress={navigation.goBack}
// leftText="Back" // TODO: Check why is it not visible with the icon and the component has onPress handler already
leftText="Back"
backgroundColor={colors.background.primary}
leftIcon="caretLeft"
leftIconColor={colors.content.secondary}
Expand Down
2 changes: 1 addition & 1 deletion app/screens/VideoPlayerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const VideoPlayerScreen: FC<VideoPlayerScreenProps> = observer(function V
<Screen style={$root} contentContainerStyle={$styles.flex1}>
<Header
onLeftPress={goBack}
// leftText="Back" // TODO: Check why is it not visible with the icon and the component has onPress handler already
leftText="Back"
backgroundColor={colors.background.primary}
leftIcon="caretLeft"
leftIconColor={colors.content.secondary}
Expand Down