瀏覽代碼

feat(react) removed unused native components

master
Calin Chitu 3 年之前
父節點
當前提交
4f49cde73e

+ 0
- 71
react/features/base/react/components/native/BackButton.js 查看文件

@@ -1,71 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-import { TouchableOpacity } from 'react-native';
5
-
6
-import { ColorSchemeRegistry } from '../../../color-scheme';
7
-import { Icon, IconArrowBack } from '../../../icons';
8
-import { connect } from '../../../redux';
9
-
10
-/**
11
- * The type of the React {@code Component} props of {@link BackButton}.
12
- */
13
-type Props = {
14
-
15
-    /**
16
-     * The action to be performed when the button is pressed.
17
-     */
18
-    onPress: Function,
19
-
20
-    /**
21
-     * An external style object passed to the component.
22
-     */
23
-    style?: Object,
24
-
25
-    /**
26
-     * The color schemed style of the Header component.
27
-     */
28
-    _headerStyles: Object
29
-};
30
-
31
-/**
32
- * A component rendering a back button.
33
- */
34
-class BackButton extends Component<Props> {
35
-    /**
36
-     * Implements React's {@link Component#render()}, renders the button.
37
-     *
38
-     * @inheritdoc
39
-     * @returns {ReactElement}
40
-     */
41
-    render() {
42
-        return (
43
-            <TouchableOpacity
44
-                accessibilityLabel = { 'Back' }
45
-                onPress = { this.props.onPress }>
46
-                <Icon
47
-                    src = { IconArrowBack }
48
-                    style = { [
49
-                        this.props._headerStyles.headerButtonIcon,
50
-                        this.props.style
51
-                    ] } />
52
-            </TouchableOpacity>
53
-        );
54
-    }
55
-}
56
-
57
-/**
58
- * Maps part of the Redux state to the props of this component.
59
- *
60
- * @param {Object} state - The Redux state.
61
- * @returns {{
62
- *     _headerStyles: Object
63
- * }}
64
- */
65
-function _mapStateToProps(state) {
66
-    return {
67
-        _headerStyles: ColorSchemeRegistry.get(state, 'Header')
68
-    };
69
-}
70
-
71
-export default connect(_mapStateToProps)(BackButton);

+ 0
- 44
react/features/base/react/components/native/Button.js 查看文件

@@ -1,44 +0,0 @@
1
-/* @flow */
2
-
3
-import React, { Component } from 'react';
4
-import { Text, TouchableOpacity } from 'react-native';
5
-
6
-type Props = {
7
-
8
-    /**
9
-     * React Elements to display within the component.
10
-     */
11
-    children: React$Node | Object,
12
-
13
-    /**
14
-     * Handler called when the user presses the button.
15
-     */
16
-    onValueChange: Function,
17
-
18
-    /**
19
-     * The component's external style.
20
-     */
21
-    style: Object
22
-};
23
-
24
-/**
25
- * Renders a button.
26
- */
27
-export default class ButtonImpl extends Component<Props> {
28
-    /**
29
-     * Implements React's {@link Component#render()}, renders the button.
30
-     *
31
-     * @inheritdoc
32
-     * @returns {ReactElement}
33
-     */
34
-    render() {
35
-        return (
36
-            <TouchableOpacity
37
-                onPress = { this.props.onValueChange } >
38
-                <Text style = { this.props.style }>
39
-                    { this.props.children }
40
-                </Text>
41
-            </TouchableOpacity>
42
-        );
43
-    }
44
-}

+ 0
- 91
react/features/base/react/components/native/ForwardButton.js 查看文件

@@ -1,91 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-import { Text, TouchableOpacity } from 'react-native';
5
-
6
-import { ColorSchemeRegistry } from '../../../color-scheme';
7
-import { translate } from '../../../i18n';
8
-import { connect } from '../../../redux';
9
-
10
-/**
11
- * The type of the React {@code Component} props of {@link ForwardButton}.
12
- */
13
-type Props = {
14
-
15
-    /**
16
-     * True if the nutton should be disabled.
17
-     */
18
-    disabled: boolean;
19
-
20
-    /**
21
-     * The i18n label key of the button.
22
-     */
23
-    labelKey: string,
24
-
25
-    /**
26
-     * The action to be performed when the button is pressed.
27
-     */
28
-    onPress: Function,
29
-
30
-    /**
31
-     * An external style object passed to the component.
32
-     */
33
-    style?: Object,
34
-
35
-    /**
36
-     * The function to be used to translate i18n labels.
37
-     */
38
-    t: Function,
39
-
40
-    /**
41
-     * The color schemed style of the Header component.
42
-     */
43
-    _headerStyles: Object
44
-};
45
-
46
-/**
47
- * A component rendering a forward/next/action button.
48
- */
49
-class ForwardButton extends Component<Props> {
50
-    /**
51
-     * Implements React's {@link Component#render()}, renders the button.
52
-     *
53
-     * @inheritdoc
54
-     * @returns {ReactElement}
55
-     */
56
-    render() {
57
-        const { _headerStyles } = this.props;
58
-
59
-        return (
60
-            <TouchableOpacity
61
-                accessibilityLabel = { 'Forward' }
62
-                disabled = { this.props.disabled }
63
-                onPress = { this.props.onPress } >
64
-                <Text
65
-                    style = { [
66
-                        _headerStyles.headerButtonText,
67
-                        this.props.disabled && _headerStyles.disabledButtonText,
68
-                        this.props.style
69
-                    ] }>
70
-                    { this.props.t(this.props.labelKey) }
71
-                </Text>
72
-            </TouchableOpacity>
73
-        );
74
-    }
75
-}
76
-
77
-/**
78
- * Maps part of the Redux state to the props of the component.
79
- *
80
- * @param {Object} state - The Redux state.
81
- * @returns {{
82
- *     _headerStyles: Object
83
- * }}
84
- */
85
-function _mapStateToProps(state) {
86
-    return {
87
-        _headerStyles: ColorSchemeRegistry.get(state, 'Header')
88
-    };
89
-}
90
-
91
-export default translate(connect(_mapStateToProps)(ForwardButton));

+ 0
- 73
react/features/base/react/components/native/HeaderLabel.js 查看文件

@@ -1,73 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-import { Text, View } from 'react-native';
5
-
6
-import { ColorSchemeRegistry } from '../../../color-scheme';
7
-import { translate } from '../../../i18n';
8
-import { connect } from '../../../redux';
9
-
10
-/**
11
- * The type of the React {@code Component} props of {@link HeaderLabel}.
12
- */
13
-type Props = {
14
-
15
-    /**
16
-     * The i18n key of the label to be rendered.
17
-     */
18
-    labelKey: string,
19
-
20
-    /**
21
-     * The i18n translate function.
22
-     */
23
-    t: Function,
24
-
25
-    /**
26
-     * The color schemed style of the Header component.
27
-     */
28
-    _headerStyles: Object
29
-};
30
-
31
-/**
32
- * A component rendering a standard label in the header.
33
- */
34
-class HeaderLabel extends Component<Props> {
35
-    /**
36
-     * Implements React's {@link Component#render()}.
37
-     *
38
-     * @inheritdoc
39
-     * @returns {ReactElement}
40
-     */
41
-    render() {
42
-        const { _headerStyles } = this.props;
43
-
44
-        return (
45
-            <View
46
-                pointerEvents = 'box-none'
47
-                style = { _headerStyles.headerTextWrapper }>
48
-                <Text
49
-                    style = { [
50
-                        _headerStyles.headerText
51
-                    ] }>
52
-                    { this.props.t(this.props.labelKey) }
53
-                </Text>
54
-            </View>
55
-        );
56
-    }
57
-}
58
-
59
-/**
60
- * Maps part of the Redux state to the props of this component.
61
- *
62
- * @param {Object} state - The Redux state.
63
- * @returns {{
64
- *     _headerStyles: Object
65
- * }}
66
- */
67
-function _mapStateToProps(state) {
68
-    return {
69
-        _headerStyles: ColorSchemeRegistry.get(state, 'Header')
70
-    };
71
-}
72
-
73
-export default translate(connect(_mapStateToProps)(HeaderLabel));

+ 0
- 4
react/features/base/react/components/native/index.js 查看文件

@@ -1,12 +1,8 @@
1 1
 // @flow
2 2
 
3 3
 export { default as AvatarListItem } from './AvatarListItem';
4
-export { default as BackButton } from './BackButton';
5 4
 export { default as BaseIndicator } from './BaseIndicator';
6
-export { default as Button } from './Button';
7 5
 export { default as Container } from './Container';
8
-export { default as ForwardButton } from './ForwardButton';
9
-export { default as HeaderLabel } from './HeaderLabel';
10 6
 export { default as Image } from './Image';
11 7
 export { default as Link } from './Link';
12 8
 export { default as Linkify } from './Linkify';

Loading…
取消
儲存