Skip to content

Commit

Permalink
fix haptic issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali Nagacevschi committed Sep 11, 2022
1 parent cbce404 commit 46d2b68
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type Pressable = {
onPress?: ((args: any) => void) | null
onSelect?: (selected: any) => void
}
const withHaptics = <P extends Pressable>(Component: React.ComponentType<P>, force = false) => ({ onPress, onSelect, ...props }: any) => {
const withHaptics = <P extends any>(Component: React.ComponentType<P>, force = false) => ({ onPress, onSelect, ...props }: any) => {
const onHapticPress = (args: any) => {
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success)
onPress?.(args)
Expand Down Expand Up @@ -209,20 +209,20 @@ const restyleFunctions = composeRestyleFunctions<Theme, RestyleProps>([
border,
])

export const Datepicker = ({ onPress, onSelect, ...props }: BoxProps<Theme> & UIDatepickerProps): JSX.Element => {
export const Datepicker = ({ onSelect, ...props }: BoxProps<Theme> & UIDatepickerProps) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unreachable code error
const { style } = useRestyle(restyleFunctions, props)
const Component = createRestyleComponent<BoxProps<Theme> & UIDatepickerProps, Theme>(
viewRestyleFunctions,
withHaptics<UIDatepickerProps>(UIDatepicker, true),
)
return <Component { ...props } controlStyle={style} />
return <Component {...{ onSelect, ...props }} controlStyle={style} />
}

type InputProps = UIInputProps & TextProps<Theme>

export const Input = (props: BoxProps<Theme> & InputProps): JSX.Element => {
export const Input = (props: BoxProps<Theme> & InputProps) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unreachable code error
const { style } = useRestyle(restyleFunctions, props)
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"name": "restyle-ui-kitten",
"version": "1.0.3",
"version": "1.0.4",
"dependencies": {
"@eva-design/material": "^2.1.1",
"@react-native-async-storage/async-storage": "~1.17.3",
"@shopify/restyle": "^2.1.0",
"@ui-kitten/components": "^5.1.2"
},
"devDependencies": {
"expo-haptics": "~11.3.0",
"react": "18.0.0",
"react-native": "0.69.5"
},
"description": "combine restyle and ui-kitten",
"main": "index.ts",
"scripts": {
Expand Down
157 changes: 157 additions & 0 deletions yarn-error.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
Arguments:
/Users/vali/.nvm/versions/node/v16.14.2/bin/node /usr/local/Cellar/yarn/1.22.18/libexec/bin/yarn.js

PATH:
/usr/local/opt/[email protected]/bin:/Users/vali/.rbenv/shims:/Users/vali/.nvm/versions/node/v16.14.2/bin:/usr/local/sbin:/Users/vali/.rbenv/shims:/Users/vali/.rbenv/bin:/usr/local/opt/openssl@3/bin:/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home/:/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home//bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/vali/.yarn/bin:/Users/vali/miniconda3/bin:/Users/vali/MyWorks/flutter/bin:/Users/vali/Library/Android/sdk/cmdline-tools/latest/bin:/Users/vali/Library/Android/sdk/emulator

Yarn version:
1.22.18

Node version:
16.14.2

Platform:
darwin x64

Trace:
SyntaxError: /Users/vali/MyWorks/react/restyle-ui-kitten/package.json: Unexpected token } in JSON at position 248
at JSON.parse (<anonymous>)
at /usr/local/Cellar/yarn/1.22.18/libexec/lib/cli.js:1625:59
at Generator.next (<anonymous>)
at step (/usr/local/Cellar/yarn/1.22.18/libexec/lib/cli.js:310:30)
at /usr/local/Cellar/yarn/1.22.18/libexec/lib/cli.js:321:13

npm manifest:
{
"name": "restyle-ui-kitten",
"version": "1.0.3",
"dependencies": {
"@eva-design/material": "^2.1.1",
"@react-native-async-storage/async-storage": "~1.17.3",
"@shopify/restyle": "^2.1.0",
"@ui-kitten/components": "^5.1.2",
},
"devDependencies": {
"react": "18.0.0"
},
"description": "combine restyle and ui-kitten",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/valinagacevschi/restyle-ui-kitten.git"
},
"keywords": [
"restyle",
"ui-kitten",
"eva",
"design"
],
"author": "Valentin Nagacevschi",
"license": "MIT",
"bugs": {
"url": "https://github.com/valinagacevschi/restyle-ui-kitten/issues"
},
"homepage": "https://github.com/valinagacevschi/restyle-ui-kitten#readme"
}

yarn manifest:
No manifest

Lockfile:
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@eva-design/dss@^2.0.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@eva-design/dss/-/dss-2.1.1.tgz#bd8da793e13a0dcac91d852b91ebf05e6fbdc0ee"
integrity sha512-Z6rZSodsQHWW1yDuiop1glJU8xKJSdKTPoWWCBsQWXYMNwTAEPgcZV69HNlnerB+T++jwj2jeoBzO24CTc0PmQ==

"@eva-design/material@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@eva-design/material/-/material-2.1.1.tgz#b08bd8f2c8411871c118fac11f7b59c2f4cdfb2f"
integrity sha512-fVqknxM+PVsuPx0H/CcEgoZkZ1UIr41Cxt56yt67LBCus4xIILqyXx5pAvc//QTz3x7K29UEWH80YS6gpZaRag==

"@eva-design/processor@^2.0.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@eva-design/processor/-/processor-2.1.1.tgz#33a59efa52ee2d206ac4d912dae801d12f9275a8"
integrity sha512-lbxZLm5ARhuk/wxWkaiWhw5XeZ+Xcp1JGCjcZl+S5rUbLppfp4U47jfq861EY27BP1dpQ5PyTVFCbl5eHlRFdg==

"@react-native-async-storage/async-storage@~1.17.3":
version "1.17.10"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.17.10.tgz#8d6a4771912be8454a9e215eebd469b1b8e2e638"
integrity sha512-KrR021BmBLsA0TT1AAsfH16bHYy0MSbhdAeBAqpriak3GS1T2alFcdTUvn13p0ZW6FKRD6Bd3ryU2zhU/IYYJQ==
dependencies:
merge-options "^3.0.4"

"@shopify/restyle@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@shopify/restyle/-/restyle-2.1.0.tgz#c5371deb5db873268bddd7e90fa74f783ad7ed23"
integrity sha512-CE4DDf5ZvDI438n5iQrdqw628Sa0F4C6CwTGxJEAKQLvC+4orWtr2TFPskoxl9hrMfk+TOzNTDZ3tcR88qKvrw==

"@ui-kitten/components@^5.1.2":
version "5.1.2"
resolved "https://registry.yarnpkg.com/@ui-kitten/components/-/components-5.1.2.tgz#18b6aba8ed67b0b893f0ec3f40daf5e698676811"
integrity sha512-J1Gd53+2qngktLSKot9aT+LGhUt05uGE3ouEiY6FsxUZdexlzcQVhp5rRasExUSAYNcN5J7/XSNEPNB9qX0v1g==
dependencies:
"@eva-design/dss" "^2.0.0"
"@eva-design/processor" "^2.0.0"
fecha "3.0.3"
hoist-non-react-statics "^3.2.1"
lodash.merge "^4.6.1"

[email protected]:
version "3.0.3"
resolved "https://registry.yarnpkg.com/fecha/-/fecha-3.0.3.tgz#fabbd416497649a42c24d34bfa726b579203a1e2"
integrity sha512-6LQK/1jud/FZnfEEZJ7y81vw7ge81DNd/XEsX0hgMUjhS+QMljkb1C0czBaP7dMNRVrd5mw/J2J7qI2Nw+TWZw==

hoist-non-react-statics@^3.2.1:
version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
dependencies:
react-is "^16.7.0"

is-plain-obj@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==

"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

lodash.merge@^4.6.1:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

merge-options@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-3.0.4.tgz#84709c2aa2a4b24c1981f66c179fe5565cc6dbb7"
integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==
dependencies:
is-plain-obj "^2.1.0"

react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

[email protected]:
version "18.0.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.0.0.tgz#b468736d1f4a5891f38585ba8e8fb29f91c3cb96"
integrity sha512-x+VL6wbT4JRVPm7EGxXhZ8w8LTROaxPXOqhlGyVSrv0sB1jkyFGgXxJ8LVoPRLvPR6/CIZGFmfzqUa2NYeMr2A==
dependencies:
loose-envify "^1.1.0"

0 comments on commit 46d2b68

Please sign in to comment.