mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-16 17:57:46 +00:00
feat(ui-components) Add button component (#11868)
This commit is contained in:
@@ -11,13 +11,13 @@ import {
|
||||
import BaseTheme from '../../../ui/components/BaseTheme.native';
|
||||
// @ts-ignore
|
||||
import { BUTTON_MODES, BUTTON_TYPES } from '../../constants';
|
||||
import { ButtonProps } from '../../types';
|
||||
import { IButtonProps } from '../../types';
|
||||
|
||||
// @ts-ignore
|
||||
import styles from './styles';
|
||||
|
||||
|
||||
const Button: React.FC<ButtonProps> = ({
|
||||
const Button: React.FC<IButtonProps> = ({
|
||||
accessibilityLabel,
|
||||
color: buttonColor,
|
||||
disabled,
|
||||
@@ -27,7 +27,7 @@ const Button: React.FC<ButtonProps> = ({
|
||||
onPress,
|
||||
style,
|
||||
type
|
||||
}: ButtonProps) => {
|
||||
}: IButtonProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { CONTAINED } = BUTTON_MODES;
|
||||
const { DESTRUCTIVE, PRIMARY, SECONDARY, TERTIARY } = BUTTON_TYPES;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// @flow
|
||||
|
||||
/**
|
||||
* Z-index for components that are to be rendered like an overlay, to be over
|
||||
* everything, such as modal-type of components, or dialogs.
|
||||
@@ -9,12 +7,12 @@ export const OVERLAY_Z_INDEX = 1000;
|
||||
/**
|
||||
* The types of the buttons.
|
||||
*/
|
||||
export const BUTTON_TYPES = {
|
||||
PRIMARY: 'primary',
|
||||
SECONDARY: 'secondary',
|
||||
TERTIARY: 'tertiary',
|
||||
DESTRUCTIVE: 'destructive'
|
||||
};
|
||||
export enum BUTTON_TYPES {
|
||||
PRIMARY = 'primary',
|
||||
SECONDARY = 'secondary',
|
||||
TERTIARY = 'tertiary',
|
||||
DESTRUCTIVE = 'destructive'
|
||||
}
|
||||
|
||||
/**
|
||||
* The modes of the buttons.
|
||||
@@ -1,13 +1,10 @@
|
||||
export interface ButtonProps {
|
||||
accessibilityLabel?: string;
|
||||
import { ButtonProps } from '../components/common/types';
|
||||
|
||||
export interface IButtonProps extends ButtonProps {
|
||||
color?: string;
|
||||
disabled?: boolean;
|
||||
icon?: JSX.Element;
|
||||
label?: string;
|
||||
labelStyle?: Object|undefined;
|
||||
onPress?: Function;
|
||||
style?: Object|undefined;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface IconButtonProps {
|
||||
|
||||
Reference in New Issue
Block a user