Skip to content

Commit af8a0df

Browse files
author
crzypatchwork
committed
latest
1 parent 00121ca commit af8a0df

File tree

12 files changed

+128
-26
lines changed

12 files changed

+128
-26
lines changed

package-lock.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
"@emotion/react": "^11.8.2",
77
"@emotion/styled": "^11.8.1",
88
"@metamask/legacy-web3": "^2.0.0",
9-
"@mui/material": "^5.5.2",
10-
"@react-css/grid": "^1.5.0",
119
"@testing-library/jest-dom": "^5.14.1",
1210
"@testing-library/react": "^11.2.7",
1311
"@testing-library/user-event": "^12.8.3",
1412
"axios": "^0.21.1",
1513
"big-integer": "^1.6.51",
1614
"bootstrap": "^5.1.3",
1715
"ethers": "^5.5.4",
16+
"find-hashtags": "^1.0.1",
1817
"graphql": "^15.5.1",
1918
"hicetnunc-sdk": "^1.0.13",
2019
"ipfs-http-client": "^52.0.5",

src/App.css

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ a.style {
1515
a.style:hover {
1616
color : white;
1717
background-color: black;
18-
text-decoration: underline;
1918
}
2019

2120
a.button {
2221
height: 15px;
2322
text-decoration: none;
24-
border-style : solid;
23+
border-style: solid;
2524
}
2625

2726
a.button:hover {}
@@ -35,6 +34,20 @@ audio {
3534
max-width: 50vw;
3635
}
3736

37+
.tag {
38+
background-color: black;
39+
color: white;
40+
cursor: pointer;
41+
border-style: solid;
42+
}
43+
44+
.tag:hover {
45+
background-color: white;
46+
color: black;
47+
border-style: solid;
48+
cursor: pointer;
49+
}
50+
3851
.row {
3952
width : 100vw;
4053
display: flex;

src/App.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { Token } from './components/token'
99
import { About } from './components/about'
1010
import { Assets } from './components/assets'
1111
import { Exchange } from './components/exchange'
12-
12+
import { Search } from './components/search'
13+
import { Tags } from './components/tags'
1314
import { HashRouter } from 'react-router-dom/cjs/react-router-dom.min'
1415
import { Config } from './components/config'
1516

@@ -25,11 +26,13 @@ function App() {
2526
<Switch>
2627
<Route exact path='/' component={Feed} />
2728
<Route exact path='/publish' component={Mint} />
28-
<Route path='/asset/:id' component={Token} />
29+
<Route path='/search' component={Search} />
30+
<Route exact path='/tag/:id' component={Tags} />
31+
<Route exact path='/asset/:id' component={Token} />
2932
<Route exact path='/about' component={About} />
3033
<Route exact path='/exchange' component={Exchange} />
3134
<Route exact path='/config' component={Config} />
32-
<Route path='/:id' component={Assets} />
35+
<Route exact path='/:id' component={Assets} />
3336
</Switch>
3437
</HashRouter>
3538
</UngrundContextProvider>

src/components/about.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ Block Explorer URL: https://polygonscan.com/<br/>
9494
9595
<a onClick={() => connectAvax()} href='#'>connect to AVAX</a><br /><br /> */}
9696

97-
Exchange of digital assets can be made making use of MATIC, DAI or ███.<br /><br />
98-
To bridge assets from Ethereum Network to Polygon Network use <a class="style" href="https://wallet.polygon.technology/bridge">Polygon Bridge</a> <a class="style" href='https://www.youtube.com/watch?v=OOVzXvivgyM'>(see how to).</a><br />Gnosis network will also be integrated in the near future.<br />
97+
Exchange of digital assets can be made making use of MATIC.<br /><br />
98+
To bridge assets from Ethereum Network to Polygon Network use <a class="style" href="https://wallet.polygon.technology/bridge">Polygon Bridge</a> <a class="style" href='https://www.youtube.com/watch?v=OOVzXvivgyM'>(see how to).</a><br /><br /><b>This is an experimental decentralized application use at your own risk.</b><br />
9999
{/* To bridge assets from Ethereum Network to Gnosis Chain use <a class="style" href="https://bridge.xdaichain.com/">xDai Bridge</a> <a class="style" href='https://www.xdaichain.com/for-users/bridges/converting-xdai-via-bridge/moving-dai-to-xdai'>(see how to).</a><br /> */}<br />
100100
{/* <div style={style}>
101101
</div> */}

src/components/assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class Assets extends Component {
185185
<div>
186186
<div>
187187
<a class="style" style={{cursor : 'pointer'}}>//creations //</a>
188-
<a class="style" style={{cursor : 'pointer'}}>collection //</a>
188+
<a class="style" style={{cursor : 'pointer'}} onClick={() => console.log('oi')}>collection //</a>
189189
</div>
190190
<div class="row">
191191
{

src/components/feed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class Feed extends Component {
7272

7373
render() {
7474
return (
75-
<div>
75+
<div><br/>
7676
{
7777
!this.state.loading ?
7878
<div class='row'><br />

src/components/header.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Header extends Component {
8282
render() {
8383
return (
8484
<div>
85-
<div style={{ borderBottom: 'solid', height: '50px' }}>
85+
<div style={{ /* borderBottom: 'solid', */ height: '50px' }}>
8686
<div>
8787
<a href='/' style={{ marginTop: '7.5px', zIndex: 1, position: 'absolute', fontSize: '25px', cursor: 'pointer' }}>███</a>
8888
{
@@ -105,7 +105,7 @@ export class Header extends Component {
105105
}
106106
</div>
107107
</div>
108-
<div style={{ display: 'inline' }}>
108+
<div style={{ display: 'inline', marginBottom: '50px' }}>
109109
<span>
110110
<a class='style' onClick={() => this.context.setSelected(undefined)} href='/'> {/* filters ? */}
111111
//feed //
@@ -158,6 +158,9 @@ export class Header extends Component {
158158
<a href='collections'></a> */}
159159
</span>
160160
</div>
161+
{/* <div>
162+
<input type="text" placeholder="search..."></input>
163+
</div> */}
161164
</div>
162165
)
163166
}

src/components/mint.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { NFTStorage, File } from 'nft.storage'
66
import { create } from 'ipfs-http-client'
77
import { Loading } from './load'
88

9+
const findHashtags = require('find-hashtags')
10+
911
var Contract = require('web3-eth-contract')
1012
const Web3 = require('web3')
1113
const apiKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweEY1NDdDNUIyMjMzMTc3MDZkZDdkODNEMjA4ODRkRDgxOTIxNTBiNEUiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyODE5NTc4NTc2MSwibmFtZSI6InRlc3QifQ.RED_BCrWtUgodnbLxdFV5lKxVTPruv1Cg-bcDL7jtrI'
@@ -20,6 +22,7 @@ export class Mint extends Component {
2022
description: undefined,
2123
amount: undefined,
2224
royalties: undefined,
25+
hashtags: undefined,
2326
file: undefined,
2427
display: undefined,
2528
result: undefined,
@@ -28,11 +31,18 @@ export class Mint extends Component {
2831

2932
componentWillMount = async () => { }
3033

31-
handleChange = e => this.setState({ [e.target.name]: e.target.value })
34+
handleChange = e => {
35+
if (e.target.name == 'hashtags') {
36+
this.setState({ [e.target.name]: findHashtags(e.target.value) })
37+
} else {
38+
this.setState({ [e.target.name]: e.target.value })
39+
}
40+
}
3241

3342
onFileUpload = e => {
3443
this.setState({ file: e.target.files[0] })
3544
console.log(e.target.files[0].type)
45+
console.log(e.target.files[0])
3646
console.log(e.target.files[0].type !== undefined)
3747
if (e.target.files[0].type.split('/')[0] != 'image' && e.target.files[0].type.split('/')[0] != 'text' && e.target.files[0].type != 'application/pdf') this.setState({ video: true })
3848
console.log(this.state.video)
@@ -44,7 +54,7 @@ export class Mint extends Component {
4454

4555
// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt
4656
// https://blog.secure-monkey.com/considerations-when-using-aes-gcm-for-encrypting-files/
47-
57+
4858
console.log(await this.state.file.arrayBuffer())
4959
console.log(ls.get('pk'))
5060

@@ -93,6 +103,7 @@ export class Mint extends Component {
93103

94104
mint = async () => {
95105

106+
console.log(this.state)
96107
this.context.setLoading(true)
97108
this.context.setMsg('preparing asset')
98109

@@ -128,6 +139,7 @@ export class Mint extends Component {
128139
}
129140
}
130141

142+
if (this.state.hashtags?.length > 0) obj.attributes = this.state.hashtags.map(e => { return { 'value' : e } })
131143
if (this.state.file.type != undefined) obj.mimeType = this.state.file.type
132144

133145
let str = JSON.stringify(obj)
@@ -201,6 +213,7 @@ export class Mint extends Component {
201213
<div>
202214
<input type="text" placeholder="title" name="title" onChange={this.handleChange} /><br />
203215
<input type="text" placeholder="description" name="description" onChange={this.handleChange} /><br />
216+
{/* <input type="text" placeholder="#hashtags" name="hashtags" onChange={this.handleChange} /><br /> */}
204217
<input type="text" placeholder="amount" name="amount" onChange={this.handleChange} /><br />
205218
<input type="text" placeholder="royalties" name="royalties" onChange={this.handleChange} /><br />
206219
<input type="file" name="file" onChange={this.onFileUpload} />

src/components/search.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useContext, useState } from 'react'
22
import { UngrundContext } from '../context/UngrundContext'
3+
const findHashtags = require('find-hashtags')
34

45
export const Search = () => {
56

@@ -8,7 +9,8 @@ export const Search = () => {
89

910
return (
1011
<div>
11-
<input type="text" placeholder="search" onChange={e => console.log(e)} />
12+
<input type="text" placeholder="search" onChange={e => console.log(findHashtags(e.target.value))} />
13+
<button>search</button>
1214
</div>
1315
)
1416
}

0 commit comments

Comments
 (0)