* Add test notification menu * Reduce the minimum version for testing purposes * Address feedback * Add missing strings * Address feedback * Fix snapshots * Bump version limit and use correct link * Fix tests * Fix URL issues
35 lines
901 B
TypeScript
35 lines
901 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
|
|
import {useTheme} from '@context/theme';
|
|
|
|
import Button from '../button';
|
|
|
|
type ButtonProps = {
|
|
button: SectionNoticeButtonProps;
|
|
emphasis: 'primary' | 'tertiary' | 'link';
|
|
}
|
|
|
|
const SectionNoticeButton = ({
|
|
button,
|
|
emphasis,
|
|
}: ButtonProps) => {
|
|
const theme = useTheme();
|
|
const leadingIcon = button.leadingIcon ? {iconName: button.leadingIcon, iconSize: 18} : {};
|
|
const trailingIcon = button.trailingIcon ? {iconName: button.trailingIcon, iconSize: 18} : {};
|
|
|
|
return (
|
|
<Button
|
|
onPress={button.onClick}
|
|
text={button.text}
|
|
theme={theme}
|
|
emphasis={emphasis}
|
|
{...leadingIcon}
|
|
{...trailingIcon}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default SectionNoticeButton;
|