fix: dynamic to v17.13 & flowscored wallet connect bug fixes

This commit is contained in:
⚪ CHANCE 2023-08-02 16:36:42 -05:00
parent 284193f6ea
commit 241110759e
39 changed files with 333115 additions and 852 deletions

View File

@ -1,58 +1,120 @@
## setup:
# Working with the Dynamic Integration
1. Install R and dependencies
## Getting Started
```
brew install R
brew install libgit2
brew install freetype
brew install harfbuzz fribidi
brew install libtiff
### 1. Install Language Dependencies
Before you do anything, you are going to have to install everything that is needed to make our `R` packages work. After running this, you should be able to go open a terminal and type `R` to receive a help response.
```bash
brew install R libgit2 harfbuzz fribidi libtiff
```
> **Note**
> This is a global install it does not matter where you run this command if you copy-paste the above.*
2. Install required packages by running
> **Important**
> If you are on MacOS, you are likely to have an issue with installing R that can be resolved by running the following in your terminal (again, this is global):
>
> ```bash
> brew update && brew upgrade
> brew reinstall gcc
> brew reinstall r
> ```
```
Rscript setup.R
```
### 2. Install Repository Project References
3. in the terminal create an R project with react?
This repository does not natively contain all the code for the base applications. This package effectively operates as a 'reference' for other applications to reference in an informal means. To retrieve the active state of a package, in your terminal, run:
```bash
Rscript setup.R
```
~ R
> path <- file.path(getwd(), "flowAttestR")
> usethis::create_package(path)
> reactR::scaffoldReactShinyInput(
Surprisingly, you are going to run this in the root directory if you have not before.
> I am actually not sure what this did but somehow files magically showed up. If it turns out this is doing something different, i'm not surprised, please submit a PR with the real information.
> - **CHANCE**
### 3. Create a New Package
Sometimes, you are going to want to add a new project. Because our projects are built in R, you need to run the initial generation with `R` so that you have everything included. With this, we are using `reactR` so that we can use the two together.
> **Important**
> Replace `<package_name>` with the name of your project. This will be used as the name of the directory. For example, for Flow, the Package directory is located at `app/flow/dynamicWidget` this will be referred to as `<package_name>` moving forward.
To open `R` in your terminal run:
```bash
R
```
Now with an `R` process active, we can copy-pasta our code like professionals!
```R
path <- file.path(getwd(), "<package_name>")
usethis::create_package(path)
reactR::scaffoldReactShinyInput(
"wallet_connect",
list(
"reactstrap" = "^8.9.0"
)
)
> quit()
Save workspace image? [y/n/c]: n
```
With that run, you have created a project! Go ahead and close your R process without saving the image by running:
```R
quit()
```
### 4. Working in a Package
With a project already created (whether you just created it or are updating an existing one) go ahead and install the dependencies in your terminal. First of course, navigate to the 'Package' directory.
```bash
cd <package_name>
```
Finally, you are ready to install the dependencies with yarn in your terminal like:
```bash
yarn install
```
## "exporting"
R doesn't call it that but that's what we're doing
```
cd <my library to export>
> **Note**
> Unless you have a reason to, do not upgrade the dependencies.
Remember, we are going to build everything and package it up for use in R which means we need to bundle the dependencies used within the `reactR` implementation.
### 5. Build a Package for Production
With all your work done, you are ready to build the package and hand it off in a PR. To build the package, we need to run a little more `R` and then we are all set. Still in your terminal while in the `<package_name>` directory run:
```bash
yarn run webpack --mode=development
R
```
Back in `R`, let's go ahead and bundle everything together with:
```R
devtools::document()
devtools::load_all()
-or-
devtools::install()
```
You are almost done, but there is one final step. Build the Package as a `.tar.gz`. To do this, you are going to move remain in R and run:
```R
devtools::buid()
```
## Running
Now, we are good developers and will always make sure that everything is nice and running before stepping away with a mash of a PR. To run your Package, still in your same working directory of `<package_name>` navigate to your terminal and run:
```bash
R -e "shiny::runApp('.')"
```
cd <this directory>
R -e "shiny::runApp('.')"
```
This will spin up the app locally for you where you can acccess it at `http://127.0.0.1:3226`.

View File

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 404 B

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 772 B

After

Width:  |  Height:  |  Size: 772 B

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 963 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 645 KiB

After

Width:  |  Height:  |  Size: 645 KiB

View File

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

View File

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,27 @@
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{
/***/ "./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js":
/*!********************************************************************************************************************************!*\
!*** ./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js ***!
\********************************************************************************************************************************/
/*! exports provided: EditProfileView, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditProfileView", function() { return EditProfileView; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditProfileView; });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
var EditProfileView = function EditProfileView() {
return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])("p", {
children: "Edit Profile View"
});
};
/***/ })
}]);
//# sourceMappingURL=0.dynamic_button.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js"],"names":["EditProfileView","jsx","children"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwC;AAExC,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAA;EAAA,OAASC,6DAAG,CAAC,GAAG,EAAE;IAAEC,QAAQ,EAAE;EAAoB,CAAC,CAAC;AAAA","file":"0.dynamic_button.js","sourcesContent":["import { jsx } from 'react/jsx-runtime';\n\nconst EditProfileView = () => jsx(\"p\", { children: \"Edit Profile View\" });\n\nexport { EditProfileView, EditProfileView as default };\n"],"sourceRoot":""}

View File

@ -0,0 +1,27 @@
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],{
/***/ "./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js":
/*!************************************************************************************************************************!*\
!*** ./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js ***!
\************************************************************************************************************************/
/*! exports provided: ProfileView, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProfileView", function() { return ProfileView; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ProfileView; });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
var ProfileView = function ProfileView() {
return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])("p", {
children: "Profile View"
});
};
/***/ })
}]);
//# sourceMappingURL=1.dynamic_button.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js"],"names":["ProfileView","jsx","children"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwC;AAExC,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAA;EAAA,OAASC,6DAAG,CAAC,GAAG,EAAE;IAAEC,QAAQ,EAAE;EAAe,CAAC,CAAC;AAAA","file":"1.dynamic_button.js","sourcesContent":["import { jsx } from 'react/jsx-runtime';\n\nconst ProfileView = () => jsx(\"p\", { children: \"Profile View\" });\n\nexport { ProfileView, ProfileView as default };\n"],"sourceRoot":""}

View File

@ -0,0 +1,27 @@
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
/***/ "./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js":
/*!************************************************************************************************************************!*\
!*** ./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js ***!
\************************************************************************************************************************/
/*! exports provided: WalletsView, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WalletsView", function() { return WalletsView; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WalletsView; });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
var WalletsView = function WalletsView() {
return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])("p", {
children: "Wallets View"
});
};
/***/ })
}]);
//# sourceMappingURL=2.dynamic_button.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./node_modules/@dynamic-labs/sdk-react-core/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js"],"names":["WalletsView","jsx","children"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwC;AAExC,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAA;EAAA,OAASC,6DAAG,CAAC,GAAG,EAAE;IAAEC,QAAQ,EAAE;EAAe,CAAC,CAAC;AAAA","file":"2.dynamic_button.js","sourcesContent":["import { jsx } from 'react/jsx-runtime';\n\nconst WalletsView = () => jsx(\"p\", { children: \"Wallets View\" });\n\nexport { WalletsView, WalletsView as default };\n"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"private": true,
"dependencies": {
"@dynamic-labs/sdk-react": "^0.15.0",
"@dynamic-labs/sdk-react": "^0.17.13",
"react": "^18.2.0",
"reactstrap": "^8.9.0"
},

View File

@ -1,14 +1,20 @@
import { reactShinyInput } from "reactR";
import { DynamicContextProvider, DynamicWidget } from "@dynamic-labs/sdk-react";
import DynamicAppUser from "./DynamicAppUser.jsx";
// Access the Dynamic Configuration Dashboard at:
// https://app.dynamic.xyz/dashboard/configurations
//
// You must have a valid invite, but can just access this with your email if
// an invite has been sent.
const TextInput = ({ configuration, value, setValue }) => {
return (
<DynamicContextProvider
settings={{
appName: "FlowScored",
multiWallet: true,
environmentId: "c6ef9d8c-6b8d-441a-9f67-72b728cef538",
environmentId: "c6ef9d8c-6b8d-441a-9f67-72b728cef538", // DANGEROUS: Live environment
eventsCallbacks: {
onAuthSuccess: (args) => {
console.log("onAuthSuccess was called", args);
@ -33,7 +39,8 @@ const TextInput = ({ configuration, value, setValue }) => {
},
}}
>
<DynamicWidget />
<DynamicWidget innerButtonComponent='Connect your wallets' />
<DynamicAppUser setNewValue={setValue} />
</DynamicContextProvider>
);

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.