mattermost-mobile/app/components/navigation_header/large.tsx
Elias Nahum 2f3dfbbbfa
Update dependencies and upgrade to RN 0.76.5 (#8421)
* update dev deps

* partial update dependencies

* update watermelondb

* update rn to 0.76.5, expo to 52.0.18 and others

* upgrade android firebase

* upgrade detox deps

* fix package-lock.json

* update emm and paste-input

* update turbo-log

* update network library

* fix tests

* review feedback

* fix Keyboard blocking signIn button

* Fall back to iphone 14 iOS 17.2 simulator as app crashes on iOS 17.4

* changes in deleteCredentialsForServer is causing a crash

* withOptions x2 clearly is wrong

* re-add cli-platform-apple fix

* fix: RN 0.76.5 issue with bottom sheet disappearing (#8478)

* experiment, using view vs BottomSheetView

* revert previous & try disabling enableDynamicSizing

* revert an unintended removal

---------

Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Rahim Rahman <rahim.rahman@mattermost.com>
2025-01-16 07:11:32 -07:00

78 lines
2.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useMemo} from 'react';
import {Text} from 'react-native';
import Animated, {useAnimatedStyle} from 'react-native-reanimated';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
type Props = {
heightOffset: number;
hasSearch: boolean;
subtitle?: string;
theme: Theme;
title: string;
translateY: Animated.DerivedValue<number>;
}
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({
container: {
backgroundColor: theme.sidebarBg,
paddingHorizontal: 20,
},
heading: {
...typography('Heading', 800),
color: theme.sidebarHeaderTextColor,
},
subHeading: {
...typography('Heading', 200, 'Regular'),
color: changeOpacity(theme.sidebarHeaderTextColor, 0.8),
},
}));
const NavigationHeaderLargeTitle = ({
heightOffset,
hasSearch,
subtitle,
theme,
title,
translateY,
}: Props) => {
const styles = getStyleSheet(theme);
const transform = useAnimatedStyle(() => (
{transform: [{translateY: translateY.value}]}
), [translateY?.value]);
const containerStyle = useMemo(() => {
return [{height: heightOffset}, styles.container];
}, [heightOffset, styles.container]);
return (
<Animated.View style={[containerStyle, transform]}>
<Text
ellipsizeMode='tail'
numberOfLines={1}
style={[styles.heading]}
testID='navigation.large_header.title'
>
{title}
</Text>
{!hasSearch && Boolean(subtitle) &&
<Text
ellipsizeMode='tail'
numberOfLines={1}
style={styles.subHeading}
testID='navigation.large_header.subtitle'
>
{subtitle}
</Text>
}
</Animated.View>
);
};
export default NavigationHeaderLargeTitle;