Skip to content

Fix Badge component default settings #3832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Changing size default and fixing appearance default for Badge",
"packageName": "@fluentui-react-native/badge",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 3 additions & 1 deletion packages/components/Badge/src/Badge.tsx
Original file line number Diff line number Diff line change
@@ -19,11 +19,13 @@ export const badgeLookup = (layer: string, userProps: BadgeProps): boolean => {
return (
userProps[layer] ||
layer === userProps['appearance'] ||
(!userProps['appearance'] && layer === 'filled') ||
layer === userProps['size'] ||
(!userProps['size'] && layer === 'large') ||
(!userProps['size'] && layer === 'medium') ||
layer === userProps['shape'] ||
(!userProps['shape'] && layer === 'circular') ||
layer === userProps['badgeColor'] ||
(!userProps['badgeColor'] && layer === 'brand') ||
(I18nManager.isRTL && layer === 'rtl')
);
};
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ exports[`Badge component tests Badge all props 1`] = `
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "#00000000",
"borderColor": "#00000000",
"borderColor": "#185abd",
"borderRadius": 4,
"borderWidth": 1,
"bottom": 0,
@@ -45,7 +45,7 @@ exports[`Badge component tests Badge all props 1`] = `
onAccessibilityTap={[Function]}
style={
{
"color": "#ffffff",
"color": "#185abd",
"fontFamily": "Segoe UI",
"fontSize": 12,
"fontWeight": "400",
@@ -65,15 +65,15 @@ exports[`Badge component tests Badge tokens 1`] = `
{
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "yellow",
"borderColor": "#f09",
"backgroundColor": "#185abd",
"borderColor": "#00000000",
"borderRadius": 9999,
"borderWidth": 4,
"bottom": 0,
"flexDirection": "row",
"justifyContent": "center",
"minHeight": 24,
"minWidth": 24,
"minHeight": 20,
"minWidth": 20,
"paddingHorizontal": 4,
"position": "relative",
"right": 0,
@@ -90,7 +90,7 @@ exports[`Badge component tests Badge tokens 1`] = `
{
"color": "#ffffff",
"fontFamily": "Segoe UI",
"fontSize": 12,
"fontSize": 10,
"fontWeight": "400",
"margin": 0,
}
@@ -114,8 +114,8 @@ exports[`Badge component tests Empty Badge 1`] = `
"bottom": 0,
"flexDirection": "row",
"justifyContent": "center",
"minHeight": 24,
"minWidth": 24,
"minHeight": 20,
"minWidth": 20,
"paddingHorizontal": 4,
"position": "relative",
"right": 0,
@@ -135,8 +135,8 @@ exports[`Badge component tests Filled badge with shadow 1`] = `
"borderRadius": 9999,
"bottom": 0,
"justifyContent": "center",
"minHeight": 24,
"minWidth": 24,
"minHeight": 20,
"minWidth": 20,
"position": "relative",
"right": 0,
"shadowColor": "#000000",
@@ -161,8 +161,8 @@ exports[`Badge component tests Filled badge with shadow 1`] = `
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"minHeight": 24,
"minWidth": 24,
"minHeight": 20,
"minWidth": 20,
"paddingHorizontal": 4,
"position": "relative",
"shadowColor": "#000000",
@@ -184,7 +184,7 @@ exports[`Badge component tests Filled badge with shadow 1`] = `
{
"color": "#ffffff",
"fontFamily": "Segoe UI",
"fontSize": 12,
"fontSize": 10,
"fontWeight": "400",
"margin": 0,
}