Skip to content

Commit

Permalink
Merge branch 'master' of github.com:draftbit/react-native-jigsaw into…
Browse files Browse the repository at this point in the history
… sieu/p-5297-add-timer-component
  • Loading branch information
sieu-db committed Aug 24, 2024
2 parents 7c817ba + 068119e commit 3fe0bd6
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 22 deletions.
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@draftbit/example",
"description": "Example app for @draftbit/ui",
"version": "50.2.7",
"version": "50.2.8",
"private": true,
"scripts": {
"android": "expo start --android",
Expand All @@ -14,8 +14,8 @@
"clean:modules": "rimraf node_modules"
},
"dependencies": {
"@draftbit/maps": "50.2.7",
"@draftbit/ui": "50.2.7",
"@draftbit/maps": "50.2.8",
"@draftbit/ui": "50.2.8",
"@expo/dev-server": "0.1.123",
"@expo/webpack-config": "~19.0.1",
"@react-navigation/drawer": "^6.6.3",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "50.2.7",
"version": "50.2.8",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*", "example"],
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"clean": "lerna run clean",
"clean:modules": "lerna run clean:modules && rm -rf node_modules",
"typescript": "tsc --composite false",
"version:expo": "lerna version major --no-push --exact",
"version:major": "lerna version minor --no-push --exact",
"version:minor": "lerna version patch --no-push --exact",
"version:expo": "lerna version major --no-push --exact --force-publish",
"version:major": "lerna version minor --no-push --exact --force-publish",
"version:minor": "lerna version patch --no-push --exact --force-publish",
"version:patch": "echo \"No patch versions: See root README.md\"",
"prepare": "husky install",
"tsc": "echo 'You are trying to run \"tsc\" in the workspace root. Run it from an individual package instead.' && exit 1"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@draftbit/core",
"version": "50.2.7",
"version": "50.2.8",
"description": "Core (non-native) Components",
"main": "lib/commonjs/index.js",
"types": "lib/typescript/src/index.d.ts",
Expand Down Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@date-io/date-fns": "^1.3.13",
"@draftbit/react-theme-provider": "^2.1.1",
"@draftbit/theme": "50.2.4",
"@draftbit/theme": "50.2.8",
"@expo/vector-icons": "^14.0.0",
"@gorhom/bottom-sheet": "5.0.0-alpha.7",
"@material-ui/core": "^4.11.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/core/src/components/NumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const NumberInput = React.forwardRef<NativeTextInput, Props>(
const [currentStringNumberValue, setCurrentStringNumberValue] =
useState("");

const delayedValue = useDebounce(value, changeTextDelay);
const [valueToDebounce, setValueToDebounce] = React.useState(value);
const delayedValue = useDebounce(valueToDebounce, changeTextDelay);

const formatValueToStringNumber = (valueToFormat?: number | string) => {
if (valueToFormat != null) {
Expand Down Expand Up @@ -92,7 +93,10 @@ const NumberInput = React.forwardRef<NativeTextInput, Props>(
ref={ref}
keyboardType="numeric"
value={currentStringNumberValue}
onChangeText={handleChangeText}
onChangeText={(newValue) => {
handleChangeText(newValue);
setValueToDebounce(newValue);
}}
{...props}
/>
);
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/components/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ class TextField extends React.Component<Props, State> {
paddingLeft,
paddingRight,
borderRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderWidth,
borderTopWidth,
borderRightWidth,
Expand All @@ -428,6 +432,10 @@ class TextField extends React.Component<Props, State> {
paddingLeft,
paddingRight,
borderRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderWidth,
borderTopWidth,
borderRightWidth,
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/components/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
disabled = false,
editable = true,
value,
onChangeText,
...rest
},
ref
) => {
const theme = useTheme();
const delayedValue = useDebounce(value, changeTextDelay);
const [valueToDebounce, setValueToDebounce] = React.useState(value);
const delayedValue = useDebounce(valueToDebounce, changeTextDelay);

useOnUpdate(() => {
if (delayedValue !== undefined) {
Expand All @@ -49,6 +51,10 @@ const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
{ color: theme.colors.text.strong },
style,
]}
onChangeText={(newValue) => {
onChangeText?.(newValue);
setValueToDebounce(newValue);
}}
{...rest}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions packages/maps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@draftbit/maps",
"version": "50.2.7",
"version": "50.2.8",
"description": "Map Components",
"main": "lib/commonjs/index.js",
"types": "lib/typescript/src/index.d.ts",
Expand Down Expand Up @@ -39,8 +39,8 @@
},
"homepage": "https://github.com/draftbit/react-native-jigsaw#readme",
"dependencies": {
"@draftbit/core": "50.2.7",
"@draftbit/theme": "50.2.4",
"@draftbit/core": "50.2.8",
"@draftbit/theme": "50.2.8",
"@react-google-maps/api": "~2.18.1",
"@teovilla/react-native-web-maps": "^0.9.4",
"color": "^4.2.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@draftbit/native",
"version": "50.2.4",
"version": "50.2.8",
"description": "Draftbit UI Components that Depend on Native Components",
"main": "lib/commonjs/index.js",
"types": "lib/typescript/src/index.d.ts",
Expand Down Expand Up @@ -39,7 +39,7 @@
},
"homepage": "https://github.com/draftbit/react-native-jigsaw#readme",
"dependencies": {
"@draftbit/theme": "50.2.4",
"@draftbit/theme": "50.2.8",
"@expo/vector-icons": "^14.0.0",
"@react-native-community/datetimepicker": "7.6.1",
"@react-native-community/slider": "4.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@draftbit/theme",
"version": "50.2.4",
"version": "50.2.8",
"description": "Draftbit's themeing system",
"main": "lib/commonjs/index.js",
"types": "lib/typescript/src/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@draftbit/ui",
"version": "50.2.7",
"version": "50.2.8",
"description": "Draftbit UI Library",
"main": "lib/commonjs/index.js",
"types": "lib/typescript/src/index.d.ts",
Expand Down Expand Up @@ -43,9 +43,9 @@
},
"homepage": "https://github.com/draftbit/react-native-jigsaw#readme",
"dependencies": {
"@draftbit/core": "50.2.7",
"@draftbit/native": "50.2.4",
"@draftbit/theme": "50.2.4",
"@draftbit/core": "50.2.8",
"@draftbit/native": "50.2.8",
"@draftbit/theme": "50.2.8",
"react-native-reanimated": "~3.6.2"
},
"devDependencies": {
Expand Down

0 comments on commit 3fe0bd6

Please sign in to comment.