Skip to content

Commit

Permalink
refactor: move uzaverse pay modals in the library
Browse files Browse the repository at this point in the history
  • Loading branch information
kalculata committed Aug 30, 2023
1 parent 5d1e0f6 commit ca5e426
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 106 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['react-native-reanimated/plugin'],
};
1 change: 0 additions & 1 deletion example/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = function (api) {
},
},
],
'react-native-reanimated/plugin',
],
};
};
3 changes: 0 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
"web": "expo start --web"
},
"dependencies": {
"@gorhom/bottom-sheet": "4",
"expo": "~49.0.8",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.4",
"react-native-gesture-handler": "~2.12.0",
"react-native-reanimated": "~3.3.0",
"react-native-web": "~0.19.6"
},
"devDependencies": {
Expand Down
30 changes: 18 additions & 12 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import React, { useRef } from 'react';

Check failure on line 1 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

'useRef' is defined but never used

import { StyleSheet, Button } from 'react-native';
import ScreenWrapper from './ScreenWrapper';
import UzaversePayModal from './Modal';
import UzaversePaySheetModal from './utils';
import { StyleSheet, Button, View } from 'react-native';
// import ScreenWrapper from './ScreenWrapper';
// import UzaversePayModal from './Modal';
// import UzaversePaySheetModal from './utils';

export default function App() {
const bottomSheetModalRef = useRef<UzaversePaySheetModal>(null);
// const bottomSheetModalRef = useRef<UzaversePaySheetModal>(null);

function openModal() {
bottomSheetModalRef.current?.present();
}
// function openModal() {
// bottomSheetModalRef.current?.present();
// }

// return (
// <ScreenWrapper style={styles.container}>
// <Button title="Donate" onPress={openModal} />
// <UzaversePayModal ref={bottomSheetModalRef} style={styles.sheetStyle} />
// </ScreenWrapper>
// );

return (
<ScreenWrapper style={styles.container}>
<Button title="Donate" onPress={openModal} />
<UzaversePayModal ref={bottomSheetModalRef} style={styles.sheetStyle} />
</ScreenWrapper>
<View style={styles.container}>
<Button title="Don" />
</View>
);
}

Expand Down
75 changes: 4 additions & 71 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,6 @@
"@babel/helper-plugin-utils" "^7.22.5"
"@babel/plugin-syntax-numeric-separator" "^7.10.4"

"@babel/plugin-transform-object-assign@^7.16.7":
version "7.22.5"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.22.5.tgz#290c1b9555dcea48bb2c29ad94237777600d04f9"
integrity sha512-iDhx9ARkXq4vhZ2CYOSnQXkmxkDgosLi3J8Z17mKz7LyzthtkdVchLD7WZ3aXeCuvJDOW3+1I5TpJmwIbF9MKQ==
dependencies:
"@babel/helper-plugin-utils" "^7.22.5"

"@babel/plugin-transform-object-rest-spread@^7.22.5":
version "7.22.11"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.11.tgz#dbbb06ce783cd994a8f430d8cefa553e9b42ca62"
Expand Down Expand Up @@ -1102,7 +1095,7 @@
"@babel/types" "^7.4.4"
esutils "^2.0.2"

"@babel/preset-typescript@^7.13.0", "@babel/preset-typescript@^7.16.7":
"@babel/preset-typescript@^7.13.0":
version "7.22.11"
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.22.11.tgz#f218cd0345524ac888aa3dc32f029de5b064b575"
integrity sha512-tWY5wyCZYBGY7IlalfKI1rLiGlIfnwsRHZqlky0HVv8qviwQ1Uo/05M6+s+TcTCVa6Bmoo2uJW5TMFX6Wa4qVg==
Expand Down Expand Up @@ -1170,13 +1163,6 @@
"@babel/helper-validator-identifier" "^7.22.5"
to-fast-properties "^2.0.0"

"@egjs/hammerjs@^2.0.17":
version "2.0.17"
resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124"
integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==
dependencies:
"@types/hammerjs" "^2.0.36"

"@expo/bunyan@4.0.0", "@expo/bunyan@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@expo/bunyan/-/bunyan-4.0.0.tgz#be0c1de943c7987a9fbd309ea0b1acd605890c7b"
Expand Down Expand Up @@ -1549,21 +1535,6 @@
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==

"@gorhom/bottom-sheet@4":
version "4.4.7"
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-4.4.7.tgz#fc80b3f0b7ebab056ce226f3aa3a89b2db8660dd"
integrity sha512-ukTuTqDQi2heo68hAJsBpUQeEkdqP9REBcn47OpuvPKhdPuO1RBOOADjqXJNCnZZRcY+HqbnGPMSLFVc31zylQ==
dependencies:
"@gorhom/portal" "1.0.14"
invariant "^2.2.4"

"@gorhom/portal@1.0.14":
version "1.0.14"
resolved "https://registry.yarnpkg.com/@gorhom/portal/-/portal-1.0.14.tgz#1953edb76aaba80fb24021dc774550194a18e111"
integrity sha512-MXyL4xvCjmgaORr/rtryDNFy3kU4qUbKlwtQqqsygd0xX3mhKjOLn6mQK8wfu0RkoE0pBE0nAasRoHua+/QZ7A==
dependencies:
nanoid "^3.3.1"

"@graphql-typed-document-node/core@^3.1.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861"
Expand Down Expand Up @@ -2073,11 +2044,6 @@
"@types/minimatch" "*"
"@types/node" "*"

"@types/hammerjs@^2.0.36":
version "2.0.41"
resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.41.tgz#f6ecf57d1b12d2befcce00e928a6a097c22980aa"
integrity sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA==

"@types/html-minifier-terser@^6.0.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35"
Expand Down Expand Up @@ -3332,11 +3298,6 @@ convert-source-map@^1.7.0:
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"
integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==

convert-source-map@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==

cookie-signature@1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
Expand Down Expand Up @@ -4600,13 +4561,6 @@ hermes-profile-transformer@^0.0.6:
dependencies:
source-map "^0.7.3"

hoist-non-react-statics@^3.3.0:
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"

hosted-git-info@^3.0.2:
version "3.0.8"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-3.0.8.tgz#6e35d4cc87af2c5f816e4cb9ce350ba87a3f370d"
Expand Down Expand Up @@ -6087,7 +6041,7 @@ mz@^2.7.0:
object-assign "^4.0.1"
thenify-all "^1.0.0"

nanoid@^3.3.1, nanoid@^3.3.6:
nanoid@^3.3.6:
version "3.3.6"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
Expand Down Expand Up @@ -6896,7 +6850,7 @@ prompts@^2.3.2, prompts@^2.4.0:
kleur "^3.0.3"
sisteransi "^1.0.5"

prop-types@*, prop-types@^15.7.2:
prop-types@*:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
Expand Down Expand Up @@ -7018,7 +6972,7 @@ react-dom@18.2.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==

react-is@^16.13.1, react-is@^16.7.0:
react-is@^16.13.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
Expand All @@ -7028,27 +6982,6 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-native-gesture-handler@~2.12.0:
version "2.12.1"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.12.1.tgz#f11a99fb95169810c6886fad5efa01a17fd81660"
integrity sha512-deqh36bw82CFUV9EC4tTo2PP1i9HfCOORGS3Zmv71UYhEZEHkzZv18IZNPB+2Awzj45vLIidZxGYGFxHlDSQ5A==
dependencies:
"@egjs/hammerjs" "^2.0.17"
hoist-non-react-statics "^3.3.0"
invariant "^2.2.4"
lodash "^4.17.21"
prop-types "^15.7.2"

react-native-reanimated@~3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.3.0.tgz#80f9d58e28fddf62fe4c1bc792337b8ab57936ab"
integrity sha512-LzfpPZ1qXBGy5BcUHqw3pBC0qSd22qXS3t8hWSbozXNrBkzMhhOrcILE/nEg/PHpNNp1xvGOW8NwpAMF006roQ==
dependencies:
"@babel/plugin-transform-object-assign" "^7.16.7"
"@babel/preset-typescript" "^7.16.7"
convert-source-map "^2.0.0"
invariant "^2.2.4"

react-native-web@~0.19.6:
version "0.19.8"
resolved "https://registry.yarnpkg.com/react-native-web/-/react-native-web-0.19.8.tgz#46127f8b310148fde11e4fef67fe625603599d47"
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,10 @@
}
]
]
},
"dependencies": {
"@gorhom/bottom-sheet": "4",
"react-native-gesture-handler": "~2.12.0",
"react-native-reanimated": "~3.3.0"
}
}
10 changes: 0 additions & 10 deletions src/components/BottomSheet.tsx

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import UzaversePayBottomSheet from './components/BottomSheet';
import UzaversePaySheetContent from './components/SheetContent';
import UzaversePayScreenWrapper from '../example/src/ScreenWrapper';

export {
UzaversePayBottomSheet,
UzaversePaySheetContent,
UzaversePayScreenWrapper,
};
export { UzaversePaySheetContent, UzaversePayScreenWrapper };
Loading

0 comments on commit ca5e426

Please sign in to comment.