-
Notifications
You must be signed in to change notification settings - Fork 171
Expand file tree
/
Copy pathButtonPlatform.android.ts
More file actions
42 lines (36 loc) · 1.12 KB
/
ButtonPlatform.android.ts
File metadata and controls
42 lines (36 loc) · 1.12 KB
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
import { buildProps } from '@fluentui-react-native/framework';
import type { ButtonAppearance, ButtonSize, ButtonTokens } from './Button.types';
export function buttonPlatformSlotProps() {
return {
rippleContainer: buildProps(
(tokens: ButtonTokens) => {
return {
style: {
flexDirection: 'row',
alignSelf: 'baseline',
borderColor: tokens.borderInnerColor,
borderWidth: tokens.borderInnerWidth,
borderRadius: tokens.borderRadius,
overflow: 'hidden',
},
};
},
['borderRadius'],
),
};
}
export const getDefaultSize = (): ButtonSize => {
return 'medium';
};
export const getPlatformSpecificAppearance = (appearance: ButtonAppearance): ButtonAppearance => {
switch (appearance) {
case 'accent': // Included to cover Mobile platform naming guidelines, maps to 'primary'.
return 'primary';
case 'primary':
case 'subtle':
case 'outline': // 'Outline' exists only for Mobile platforms, default picked on other platforms.
return appearance;
default:
return 'primary';
}
};