Skip to content

Commit 187e195

Browse files
committed
fix: design fix
1 parent 0931400 commit 187e195

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

example/App.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from "react";
22
import { SafeAreaView, View, Image, Text, StatusBar } from "react-native";
33
import LinearGradient from "react-native-linear-gradient";
4-
import CounterInput from "react-native-counter-input";
4+
// import CounterInput from "react-native-counter-input";
5+
import CounterInput from "./lib/CounterInput";
56

67
const App = () => {
78
return (

example/ios/Podfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,4 +466,4 @@ SPEC CHECKSUMS:
466466

467467
PODFILE CHECKSUM: 311cf87a4a33d759b7ec994ec3735e03d4ededbf
468468

469-
COCOAPODS: 1.9.3
469+
COCOAPODS: 1.10.0.rc.1

lib/CounterInput.style.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@ interface Style {
66
}
77

88
export const _container = (
9+
width: number | undefined,
910
horizontal: boolean,
1011
backgroundColor: string,
11-
width: number,
12-
height: number,
1312
borderRadius: number,
1413
): ViewStyle => ({
15-
padding: horizontal ? 0 : 9,
16-
flexDirection: horizontal ? "row" : "column",
1714
width: width,
18-
maxWidth: horizontal ? undefined : 70,
19-
height: height,
20-
minHeight: horizontal ? 45 : 140,
2115
backgroundColor,
2216
borderRadius: borderRadius,
17+
padding: horizontal ? 0 : 9,
18+
minHeight: horizontal ? 45 : 140,
19+
maxWidth: horizontal ? undefined : 70,
20+
flexDirection: horizontal ? "row" : "column",
2321
alignItems: "center",
2422
justifyContent: "space-evenly",
2523
shadowRadius: 5,

lib/CounterInput.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,11 @@ export default class CounterInput extends React.Component<
141141
horizontal = false,
142142
backgroundColor = "#fff",
143143
width = horizontal ? 170 : undefined,
144-
height = horizontal ? 60 : undefined,
145144
borderRadius = 24,
146145
} = this.props;
147146
return (
148147
<View
149-
style={_container(
150-
horizontal,
151-
backgroundColor,
152-
width,
153-
height,
154-
borderRadius,
155-
)}
148+
style={_container(width, horizontal, backgroundColor, borderRadius)}
156149
>
157150
{this.renderIncreaseCounter()}
158151
{this.renderTextInput()}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-counter-input",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Counter Input with fully customizable options for React Native",
55
"main": "./build/dist/CounterInput.js",
66
"repository": "[email protected]:WrathChaos/react-native-counter-input.git",

0 commit comments

Comments
 (0)