Skip to content

Commit 6d65788

Browse files
authored
Revert Icon clipped fix (#754)
* Revert "Fix icons from being cut off/clipped (#749)" This reverts commit f5338ca. * v48.4.7
1 parent 98837af commit 6d65788

File tree

9 files changed

+39
-31
lines changed

9 files changed

+39
-31
lines changed

example/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@draftbit/example",
33
"description": "Example app for @draftbit/ui",
4-
"version": "48.4.6",
4+
"version": "48.4.7",
55
"private": true,
66
"main": "__generated__/AppEntry.js",
77
"scripts": {
@@ -16,8 +16,8 @@
1616
"clean:modules": "rimraf node_modules"
1717
},
1818
"dependencies": {
19-
"@draftbit/maps": "48.4.6",
20-
"@draftbit/ui": "48.4.6",
19+
"@draftbit/maps": "48.4.7",
20+
"@draftbit/ui": "48.4.7",
2121
"@expo/dev-server": "0.1.123",
2222
"@expo/webpack-config": "^18.0.1",
2323
"@react-navigation/drawer": "^5.12.9",

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "48.4.6",
2+
"version": "48.4.7",
33
"npmClient": "yarn",
44
"useWorkspaces": true,
55
"packages": ["packages/*", "example"],

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbit/core",
3-
"version": "48.4.6",
3+
"version": "48.4.7",
44
"description": "Core (non-native) Components",
55
"main": "lib/commonjs/index.js",
66
"types": "lib/typescript/src/index.d.ts",

packages/core/src/components/Checkbox/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const Checkbox: React.FC<CheckboxProps & PressableProps & IconSlot> = ({
9292
accessibilityState={{ disabled }}
9393
accessibilityRole="button"
9494
accessibilityLiveRegion="polite"
95-
style={[styles.container, style]}
95+
style={[styles.container, style, { width: size, height: size }]}
9696
>
9797
<Icon
9898
style={styles.icon}

packages/core/src/components/IconButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const IconButton: React.FC<React.PropsWithChildren<Props>> = ({
5252
styles.container,
5353
{
5454
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
55+
width: size,
56+
height: size,
5557
alignItems: "center",
5658
justifyContent: "center",
5759
},

packages/maps/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbit/maps",
3-
"version": "48.4.6",
3+
"version": "48.4.7",
44
"description": "Map Components",
55
"main": "lib/commonjs/index.js",
66
"types": "lib/typescript/src/index.d.ts",
@@ -39,7 +39,7 @@
3939
},
4040
"homepage": "https://github.com/draftbit/react-native-jigsaw#readme",
4141
"dependencies": {
42-
"@draftbit/ui": "48.4.6",
42+
"@draftbit/ui": "48.4.7",
4343
"@teovilla/react-native-web-maps": "^0.9.1",
4444
"lodash.isequal": "^4.5.0",
4545
"react-native-maps": "1.3.2"

packages/native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbit/native",
3-
"version": "48.4.5",
3+
"version": "48.4.7",
44
"description": "Draftbit UI Components that Depend on Native Components",
55
"main": "lib/commonjs/index.js",
66
"types": "lib/typescript/src/index.d.ts",

packages/native/src/components/Icon.tsx

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import * as React from "react";
2-
import { ViewProps, StyleProp, ImageStyle, Platform } from "react-native";
2+
import {
3+
View,
4+
StyleSheet,
5+
ViewProps,
6+
StyleProp,
7+
ImageStyle,
8+
Platform,
9+
} from "react-native";
310

411
// This must use require to work in both web as a published project and in Snack
512
const VectorIcons = require("@expo/vector-icons");
@@ -28,25 +35,24 @@ const Icon: React.FC<React.PropsWithChildren<Props>> = ({
2835
const IconSet = VectorIcons[iconSet];
2936

3037
return (
31-
<IconSet
32-
{...rest}
33-
name={name}
34-
color={color}
35-
size={size}
36-
style={[
37-
{
38-
...Platform.select({
39-
web: {
40-
cursor: "pointer",
41-
userSelect: "none",
42-
},
43-
}),
44-
},
45-
,
46-
style,
47-
]}
48-
/>
38+
<View style={[styles.container, { width: size, height: size }, style]}>
39+
<IconSet {...rest} name={name} color={color} size={size} />
40+
</View>
4941
);
5042
};
5143

44+
const styles = StyleSheet.create({
45+
container: {
46+
alignItems: "center",
47+
justifyContent: "center",
48+
overflow: "hidden",
49+
...Platform.select({
50+
web: {
51+
cursor: "pointer",
52+
userSelect: "none",
53+
},
54+
}),
55+
},
56+
});
57+
5258
export default Icon;

packages/ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbit/ui",
3-
"version": "48.4.6",
3+
"version": "48.4.7",
44
"description": "Draftbit UI Library",
55
"main": "lib/commonjs/index.js",
66
"types": "lib/typescript/src/index.d.ts",
@@ -43,8 +43,8 @@
4343
},
4444
"homepage": "https://github.com/draftbit/react-native-jigsaw#readme",
4545
"dependencies": {
46-
"@draftbit/core": "48.4.6",
47-
"@draftbit/native": "48.4.5",
46+
"@draftbit/core": "48.4.7",
47+
"@draftbit/native": "48.4.7",
4848
"react-native-reanimated": "~2.14.4"
4949
},
5050
"eslintIgnore": [

0 commit comments

Comments
 (0)