mattermost-mobile/app/components/channel_list/threads/index.tsx
Shaz Amjad 1c1d0e36aa
MM-38682: Gekidou Homepage (Static) (#5756)
* Home page first pass

* Adds missing static elements, introduces button component

* Removes inlines styles

* Various clean ups and button component added

* Updates typography, and adds button util

* Removes button component

* Uses stylesheet.create for memoization

* Snapshots updated

* Podfile update / fix

* Flatlist!

* Tests updated

* Moves out server icon, styling fixes

* Sneaky buttons added, compass-icons list, and server_icon removed

* Snapshots

* Adds chevron to header

* Removes unnecessary files

* Tidies up header and error

* Address feedback

* Compass Icon const removed
2021-11-04 10:32:35 -03:00

56 lines
1.7 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
import CompassIcon from '@components/compass_icon';
import TouchableWithFeedback from '@components/touchable_with_feedback';
import {Screens} from '@constants';
import {useTheme} from '@context/theme';
import {goToScreen} from '@screens/navigation';
import {makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({
container: {
display: 'flex',
flexDirection: 'row',
},
icon: {
fontSize: 24,
lineHeight: 28,
color: theme.sidebarText,
},
text: {
color: theme.sidebarText,
paddingLeft: 12,
},
}));
const textStyle = StyleSheet.create([typography('Body', 200, 'SemiBold')]);
const ThreadsButton = () => {
const theme = useTheme();
const styles = getStyleSheet(theme);
/*
* @to-do:
* - Check if there are threads, else return null
* - Change to button, navigate to threads view
* - Add right-side number badge
*/
return (
<TouchableWithFeedback onPress={() => goToScreen(Screens.CHANNEL, 'Channel', {}, {topBar: {visible: false}})} >
<View style={styles.container}>
<CompassIcon
name='message-text-outline'
style={styles.icon}
/>
<Text style={[textStyle, styles.text]}>{'Threads'}</Text>
</View>
</TouchableWithFeedback>
);
};
export default ThreadsButton;