Skip to content

Commit

Permalink
latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
grctest committed Jul 25, 2022
1 parent 34b4c1e commit c783b3a
Show file tree
Hide file tree
Showing 22 changed files with 355 additions and 690 deletions.
20 changes: 10 additions & 10 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"files": {
"main.css": "./static/css/main.ce5255c3.chunk.css",
"main.js": "./static/js/main.df7f3e82.chunk.js",
"main.js.map": "./static/js/main.df7f3e82.chunk.js.map",
"main.css": "./static/css/main.d1fd1db2.chunk.css",
"main.js": "./static/js/main.1f2e7aaf.chunk.js",
"main.js.map": "./static/js/main.1f2e7aaf.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.a4364986.js",
"runtime-main.js.map": "./static/js/runtime-main.a4364986.js.map",
"static/js/2.fa8bc740.chunk.js": "./static/js/2.fa8bc740.chunk.js",
"static/js/2.fa8bc740.chunk.js.map": "./static/js/2.fa8bc740.chunk.js.map",
"static/js/2.fe40f47b.chunk.js": "./static/js/2.fe40f47b.chunk.js",
"static/js/2.fe40f47b.chunk.js.map": "./static/js/2.fe40f47b.chunk.js.map",
"index.html": "./index.html",
"static/css/main.ce5255c3.chunk.css.map": "./static/css/main.ce5255c3.chunk.css.map",
"static/js/2.fa8bc740.chunk.js.LICENSE.txt": "./static/js/2.fa8bc740.chunk.js.LICENSE.txt"
"static/css/main.d1fd1db2.chunk.css.map": "./static/css/main.d1fd1db2.chunk.css.map",
"static/js/2.fe40f47b.chunk.js.LICENSE.txt": "./static/js/2.fe40f47b.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.a4364986.js",
"static/js/2.fa8bc740.chunk.js",
"static/css/main.ce5255c3.chunk.css",
"static/js/main.df7f3e82.chunk.js"
"static/js/2.fe40f47b.chunk.js",
"static/css/main.d1fd1db2.chunk.css",
"static/js/main.1f2e7aaf.chunk.js"
]
}
7 changes: 5 additions & 2 deletions build/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ ipcMain.on('openGallery', (event, arg) => {
shell.openExternal("https://nftea.gallery/gallery");
})


ipcMain.on('beetDownload', (event, arg) => {
event.returnValue = 'Opening github!'
shell.openExternal("https://github.com/bitshares/beet/releases");
})

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
createWindow()

app.commandLine.appendSwitch('ignore-certificate-errors');
//app.commandLine.appendSwitch('ignore-certificate-errors');

app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
Expand Down
2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Unofficial NFT issuance tool for the Bitshares blockchain"/><meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><title>NFT issuance tool</title><link href="./static/css/main.ce5255c3.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,l,f=t[0],i=t[1],a=t[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,a||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,f=1;f<r.length;f++){var i=r[f];0!==o[i]&&(n=!1)}n&&(u.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},o={1:0},u=[];function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="./";var f=this.webpackJsonpnft_tool=this.webpackJsonpnft_tool||[],i=f.push.bind(f);f.push=t,f=f.slice();for(var a=0;a<f.length;a++)t(f[a]);var p=i;r()}([])</script><script src="./static/js/2.fa8bc740.chunk.js"></script><script src="./static/js/main.df7f3e82.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Unofficial NFT issuance tool for the Bitshares blockchain"/><meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><title>NFT issuance tool</title><link href="./static/css/main.d1fd1db2.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,l,f=t[0],i=t[1],a=t[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,a||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,f=1;f<r.length;f++){var i=r[f];0!==o[i]&&(n=!1)}n&&(u.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},o={1:0},u=[];function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="./";var f=this.webpackJsonpnft_tool=this.webpackJsonpnft_tool||[],i=f.push.bind(f);f.push=t,f=f.slice();for(var a=0;a<f.length;a++)t(f[a]);var p=i;r()}([])</script><script src="./static/js/2.fe40f47b.chunk.js"></script><script src="./static/js/main.1f2e7aaf.chunk.js"></script></body></html>
5 changes: 4 additions & 1 deletion public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ ipcMain.on('openGallery', (event, arg) => {
shell.openExternal("https://nftea.gallery/gallery");
})


ipcMain.on('beetDownload', (event, arg) => {
event.returnValue = 'Opening github!'
shell.openExternal("https://github.com/bitshares/beet/releases");
})

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
Expand Down
7 changes: 7 additions & 0 deletions public/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ async function _galleryLink(target) {
ipcRenderer.send('openGallery', target);
}

async function _beetLink(target) {
ipcRenderer.send('beetDownload', target);
}

/*
* Testing node latencies for requested blockchain
*/
Expand All @@ -94,6 +98,9 @@ contextBridge.exposeInMainWorld(
},
openGallery: async (target) => {
return _galleryLink(target);
},
beetDownload: async (target) => {
return _beetLink(target);
}
}
);
47 changes: 4 additions & 43 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,14 @@
text-align: center;
}

.App-logo {
height: 20vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo.rotate {
animation: App-logo-spin infinite 20s linear;
}
}

div.inline-logo {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}

div.inline-logo > img {
margin-right: 3vw;
}

div.inline-logo .smaller {
height: 10vh;
}

.App-header {
background-color: #282c34;
background-color: #f3f3f3;
padding: 5px;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
margin-bottom: 5vh;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
/*color: white;*/
}
117 changes: 34 additions & 83 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { useState } from "react";
import { Text, Container, Center, Grid, Col, Paper, Button, Divider } from '@mantine/core'
import { Text, Container, Center, Group, Grid, Col, Paper, Button, Divider } from '@mantine/core'
import { connect, link } from 'beet-js';
import useLocalStorageState from 'use-local-storage-state';

import Upload from "./components/nft/Upload";
import Wizard from "./components/nft/Wizard";
import Offchain from "./components/nft/Offchain";
import DRM from "./components/nft/DRM";
import BeetLink from "./components/nft/BeetLink";
import SelectAsset from "./components/nft/SelectAsset";
import Connect from "./components/Connect";
import BeetLink from "./components/BeetLink";
import DRM from "./components/DRM";
import Mode from "./components/Mode";
import Offchain from "./components/Offchain";
//import Upload from "./components/Upload";
import SelectAsset from "./components/SelectAsset";
import Wizard from "./components/Wizard";

import './App.css'

Expand Down Expand Up @@ -55,55 +57,20 @@ function App() {
setNodes();
}

async function connectToBeet() {
let connected;
try {
connected = await connect(
"NFT Issuance tool",
"Application",
"localhost",
connection ? connection : null,
connection && connection.identity ? connection.identity : null
);
} catch (error) {
console.error(error)
}

if (!connected) {
console.error("Couldn't connect to Beet");
//console.log(beetConnection)
setConnection(null);
setAuthenticated(null);
return;
}

setConnection(connected);
setAuthenticated(connected.authenticated);
}

let initPrompt;
let topText;
let mainPrompt;
if (!connection) {
initPrompt = <span>
<Button
sx={{marginTop: '15px'}}
onClick={() => {
connectToBeet()
}}
>
Connect to Beet
</Button>
</span>;
topText = "This tool is designed for use with the Bitshares BEET Wallet. Launch it then click the button to proceed.";
} else if (connection && !isLinked) {
initPrompt = <Connect
connection={connection}
setConnection={setConnection}
setAuthenticated={setAuthenticated}
/>;
} else if (connection && authenticated && !isLinked) {
initPrompt = <BeetLink
connection={connection}
setIsLinked={setIsLinked}
setIdentity={setIdentity}
setCrypto={setCrypto}
/>;
topText = "Connected to Beet wallet successfully. Now proceed to link this app to the Beet wallet below.";
} else if (!cdkey && isLinked && identity) {
let userID = identity.requested.account.id;
initPrompt = <DRM
Expand All @@ -119,27 +86,8 @@ function App() {
setIdentity={setIdentity}
setCrypto={setCrypto}
/>;
topText = "Checking your Bitshares account for NFT tool eligibility.";
} else if (!mode) {
initPrompt = <span>
<Button
sx={{marginTop: '15px', marginRight: '5px', marginLeft: '5px'}}
onClick={() => {
setMode('create');
}}
>
Creating
</Button>
<Button
sx={{marginTop: '15px', marginRight: '5px'}}
onClick={() => {
setMode('edit');
}}
>
Editing
</Button>
</span>;
topText = "Are you creating a new NFT or editing an existing one?";
initPrompt = <Mode setMode={setMode} />;
} else if (mode === 'edit' && !asset) {
let userID = identity.requested.account.id;
initPrompt = <SelectAsset
Expand All @@ -153,15 +101,12 @@ function App() {
setMode={setMode}
setNodes={setNodes}
/>
topText = "Made a mistake during issuance? Edit it!";
} else if (!images) {
topText = "";
initPrompt = <Offchain
setImages={setImages}
setMode={setMode}
/>
} else if (images) {
topText = "Ready to issue NFTs on the Bitshares blockchain!";
let userID = identity.requested.account.id;
initPrompt = <Wizard
connection={connection}
Expand All @@ -176,38 +121,44 @@ function App() {
setTestnetConnection={setTestnetConnection}
/>;
} else {
topText = "An issue was encountered, reset and try again.";
initPrompt = <Text size="md">An error ocurred</Text>
initPrompt = <Text size="md">An issue was encountered, reset and try again.</Text>
}

return (
<div className="App">
<header className="App-header">
<Container>
<Grid key={"about"} grow>
<Col span={12}>
<Text size="lg">
Bitshares NFT Issuance tool
</Text>
</Col>

<Col span={12}>
<Paper padding="sm" shadow="xs">
<Text size="lg">
Bitshares NFT Issuance tool
</Text>
<Text size="md">
{topText}
</Text>
{
initPrompt
}
{
</Paper>
</Col>

<Col span={12}>
{
isLinked
? <span>
<Divider></Divider>
<Button
<Button
variant="default" color="dark"
sx={{marginTop: '15px', marginRight: '5px'}}
onClick={() => {
openGallery()
}}
>
NFTEA Gallery
</Button>
<Button
<Button
variant="outline" color="dark"
sx={{marginTop: '15px', marginBottom: '5px'}}
onClick={() => {
reset()
Expand All @@ -218,9 +169,9 @@ function App() {
</span>
: null
}
</Paper>
</Col>
</Grid>
</Container>
</header>
</div>
);
Expand Down
Loading

0 comments on commit c783b3a

Please sign in to comment.