-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy pathButtonSizeTestSection.tsx
146 lines (141 loc) · 5.61 KB
/
ButtonSizeTestSection.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import * as React from 'react';
import { Platform, View } from 'react-native';
import { ButtonV1 as Button, CompoundButton, FAB } from '@fluentui/react-native';
import { iconProps } from '../Common/iconExamples';
import { commonTestStyles, testContentRootViewStyle } from '../Common/styles';
const isMobile = Platform.OS === 'android' || Platform.OS === 'ios';
export const ButtonSizeTest: React.FunctionComponent = () => {
const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
return (
<View style={testContentRootViewStyle}>
{svgIconsEnabled && (
<>
<Button
iconOnly
size="small"
icon={iconProps}
accessibilityLabel="Small size button with accessibility icon"
style={commonTestStyles.vmargin}
tooltip="button tooltip"
/>
<Button
iconOnly
size="small"
appearance="primary"
icon={iconProps}
accessibilityLabel="Small size button with accessibility icon"
style={commonTestStyles.vmargin}
tooltip="button tooltip"
/>
<Button
iconOnly
size="medium"
icon={iconProps}
accessibilityLabel="Medium size button with accessibility icon"
style={commonTestStyles.vmargin}
/>
<Button
iconOnly
size="medium"
appearance="primary"
icon={iconProps}
accessibilityLabel="Medium size button with accessibility icon"
style={commonTestStyles.vmargin}
/>
<Button
iconOnly
size="large"
icon={iconProps}
accessibilityLabel="Large size button with accessibility icon"
style={commonTestStyles.vmargin}
/>
<Button
iconOnly
size="large"
appearance="primary"
icon={iconProps}
accessibilityLabel="Large size button with accessibility icon"
style={commonTestStyles.vmargin}
/>
<Button size="small" icon={iconProps} style={commonTestStyles.vmargin}>
Small Button with icon
</Button>
<Button size="small" appearance="primary" icon={iconProps} style={commonTestStyles.vmargin}>
Small Button with icon
</Button>
<Button size="medium" icon={iconProps} style={commonTestStyles.vmargin}>
Medium Button with icon
</Button>
<Button size="medium" appearance="primary" icon={iconProps} style={commonTestStyles.vmargin}>
Medium Button with icon
</Button>
<Button size="large" icon={iconProps} style={commonTestStyles.vmargin}>
Large Button with icon
</Button>
<Button size="large" appearance="primary" icon={iconProps} style={commonTestStyles.vmargin}>
Large Button with icon
</Button>
<FAB size="small" icon={iconProps} style={commonTestStyles.vmargin}>
Small FAB
</FAB>
<FAB size="large" icon={iconProps} style={commonTestStyles.vmargin}>
Large FAB
</FAB>
</>
)}
<Button size="small" style={commonTestStyles.vmargin}>
Small
</Button>
<Button size="medium" style={commonTestStyles.vmargin}>
Medium
</Button>
<Button size="large" style={commonTestStyles.vmargin}>
Large
</Button>
{!isMobile && (
<>
<Button loading size="small" style={commonTestStyles.vmargin}>
Loading Button Small
</Button>
<Button loading size="medium" style={commonTestStyles.vmargin}>
Loading Button Medium
</Button>
<Button loading size="large" style={commonTestStyles.vmargin}>
Loading Button Large
</Button>
<CompoundButton secondaryContent="Small compound button" size="small" style={commonTestStyles.vmargin}>
Compound Button
</CompoundButton>
<CompoundButton appearance="primary" secondaryContent="Small compound button" size="small" style={commonTestStyles.vmargin}>
Compound Button
</CompoundButton>
<CompoundButton secondaryContent="Medium compound button" size="medium" style={commonTestStyles.vmargin}>
Compound Button
</CompoundButton>
<CompoundButton appearance="primary" secondaryContent="Medium compound button" size="medium" style={commonTestStyles.vmargin}>
Compound Button
</CompoundButton>
<CompoundButton secondaryContent="Large compound button" size="large" style={commonTestStyles.vmargin}>
Compound Button
</CompoundButton>
<CompoundButton appearance="primary" secondaryContent="Large compound button" size="large" style={commonTestStyles.vmargin}>
Compound Button
</CompoundButton>
{svgIconsEnabled && (
<>
<CompoundButton icon={iconProps} secondaryContent="SecondaryContent" size="small" style={commonTestStyles.vmargin}>
Content
</CompoundButton>
<CompoundButton icon={iconProps} secondaryContent="SecondaryContent" size="medium" style={commonTestStyles.vmargin}>
Content
</CompoundButton>
<CompoundButton icon={iconProps} secondaryContent="SecondaryContent" size="large" style={commonTestStyles.vmargin}>
Content
</CompoundButton>
</>
)}
</>
)}
</View>
);
};