Files
mattermost-mobile/share_extension/components/error/label.tsx
Elias Nahum 6eadc527bb Gekidou Android share extension (#6803)
* Refactor app database queries to not require the app database as argument

* Android Share Extension and fix notifications prompt

* feedback review
2022-11-30 23:18:56 +02:00

52 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {StyleProp, Text, View, ViewStyle} from 'react-native';
import CompassIcon from '@components/compass_icon';
import {makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
type Props = {
style?: StyleProp<ViewStyle>;
text: string;
theme: Theme;
}
const getStyles = makeStyleSheetFromTheme((theme: Theme) => ({
icon: {
color: theme.errorTextColor,
},
message: {
color: theme.errorTextColor,
marginLeft: 7,
top: -2,
...typography('Body', 75),
},
row: {
flexDirection: 'row',
alignItems: 'flex-start',
marginHorizontal: 20,
marginTop: 12,
},
}));
const ErrorLabel = ({style, text, theme}: Props) => {
const styles = getStyles(theme);
return (
<View style={[styles.row, style]}>
<CompassIcon
name='alert-outline'
size={12}
style={styles.icon}
/>
<Text style={styles.message}>
{text}
</Text>
</View>
);
};
export default ErrorLabel;