Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions diversehq/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.pnp
.pnp.js
package-lock.json
yarn.lock
# testing
/coverage

Expand All @@ -29,6 +30,7 @@ yarn-error.log*
.env.development.local
.env.test.local
.env.production.local
.env.local

# vercel
.vercel
2 changes: 1 addition & 1 deletion diversehq/components/Community.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Community(){
<Image className="rounded-[25px]" src="https://academy-public.coinmarketcap.com/optimized-uploads/1c07f13ce8e748f6934a28583cca6f5b.jpg" width={500} height={600} />
<div className="justify-center items-center text-justify -tracking-2 lg:pl-20 ">
{/* <h1 className="text-center text-[30px] font-extrabold gradient-text">You like Subreddits?<br /> You will Love Communities in Village</h1> */}
<h1 className="text-center font-extrabold text-3xl pt-10 pb-10 gradient-text">You Like SubReddits?<br/> You'll Love Communities in Village.</h1>
<h1 className="text-center font-extrabold text-3xl pt-10 pb-10 gradient-text">You Like SubReddits?<br/> You'll Love Communities in Diversehq.</h1>
<div className="p-4 text-lg">
{community.map((item, index) =>{
return(
Expand Down
8 changes: 4 additions & 4 deletions diversehq/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const Header = () => {
<h1 className="font-semibold gradient-text text-6xl lg:text-9xl text-center h-40 md:text-8xl md-h-20 ">Diverse HQ</h1>
{/* </ScrollAnimation> */}
<div className="text-white text-center text-[20px] md:text-[25px] font-sans font-medium py-5" >
<h1>Build<span className="gradient-text"> Community</span> and <span className="gradient-text">Community Tokens</span> on-chain</h1>
<h1>Build<span className="gradient-text"> diverse</span> community and <span className="gradient-text">Community Tokens</span> on-chain</h1>
<h1>
Create <span className="gradient-text">Art</span> and <span className="gradient-text">Meme</span> as <span className="gradient-text">NFT</span>
share <span className="gradient-text">Memes</span> and <span className="gradient-text">Art</span> Within your Community
</h1>
<h1><span className="gradient-text">Appreciate</span> Your Favourite <span className="gradient-text">Art</span> or <span className="gradient-text">Meme</span> with <span className="gradient-text">Super Comment</span></h1>
<h1><span className="gradient-text">Appreciate</span> interesting <span className="gradient-text">Art</span> or <span className="gradient-text">Meme</span> with <span className="gradient-text">Super Comments</span></h1>
<div className="pt-5">
{/* <Link className="bg-gradient-to-tr from-amber-500 to-fuchsia-700 rounded-full w-36" href="/home">Get Inn</Link> */}
<Link className="bg-gradient-to-tr from-amber-500 to-fuchsia-700 rounded-full w-36" href="/home">Get Inn ser ➡</Link>
</div>
</div>
</div>
Expand Down
51 changes: 0 additions & 51 deletions diversehq/components/filecoin.js

This file was deleted.

7 changes: 4 additions & 3 deletions diversehq/contracts/TokenSeed.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions diversehq/contracts/Tokens.json

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions diversehq/data/posts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"text": "Nec vero pietas adversus deos nec quanta iis gratia debeatur sine explicatione naturae intellegi potest. Aliter enim explicari, quod quaeritur, non potest. Quaero igitur, quo modo hae tantae commendationes a natura profectae subito a sapientia relictae sint. An dolor longissimus quisque miserrimus, voluptatem non optabiliorem diuturnitas facit? Quare obscurentur etiam haec, quae secundum naturam esse dicimus, in vita beata; Scio enim esse quosdam, qui quavis lingua philosophari possint; Nunc haec primum fortasse audientis servire debemus. Quarum cum una sit, qua mores conformari putantur, differo eam partem, quae quasi stirps ets huius quaestionis.",
"id": 6,
"author": { "name": "Rose Kelley", "age": 22, "avatar": "1.jpg" },
"date": "Sep 16, 2019"
},
{
"text": "Se dicere inter honestum et turpe nimium quantum, nescio quid inmensum, inter ceteras res nihil omnino interesse. Nec vero alia sunt quaerenda contra Carneadeam illam sententiam. Sed tamen omne, quod de re bona dilucide dicitur, mihi praeclare dici videtur. Non modo carum sibi quemque, verum etiam vehementer carum esse? Tamen aberramus a proposito, et, ne longius, prorsus, inquam, Piso, si ista mala sunt, placet.",
"id": 5,
"author": { "name": "Helen Snyder", "age": 25, "avatar": "4.jpg" },
"date": "Sep 08, 2019"
},
{
"text": "Istam voluptatem perpetuam quis potest praestare sapienti? Verum esto: verbum ipsum voluptatis non habet dignitatem, nec nos fortasse intellegimus. Vulgo enim dicitur: Iucundi acti labores, nec male Euripidesconcludam, si potero, Latine; Inde igitur, inquit, ordiendum est. Haec quo modo conveniant, non sane intellego. Hic quoque suus est de summoque bono dissentiens dici vere Peripateticus non potest. Quamquam id quidem licebit iis existimare, qui legerint. Eorum enim est haec querela, qui sibi cari sunt seseque diligunt. Si quicquam extra virtutem habeatur in bonis. Nec tamen ille erat sapiens quis enim hoc aut quando aut ubi aut unde?",
"id": 4,
"author": { "name": "Philip Martin", "age": 33, "avatar": "5.jpg" },
"date": "Sep 02, 2019"
},
{
"text": "Quam vellem, inquit, te ad Stoicos inclinavisses! erat enim, si cuiusquam, certe tuum nihil praeter virtutem in bonis ducere. Sin autem ad animum, falsum est, quod negas animi ullum esse gaudium, quod non referatur ad corpus.",
"id": 3,
"author": { "name": "Keith Simpson", "age": 36, "avatar": "3.jpg" },
"date": "Aug 28, 2019"
},
{
"text": "Videmusne ut pueri ne verberibus quidem a contemplandis rebus perquirendisque deterreantur? Tum ille: Finem, inquit, interrogandi, si videtur, quod quidem ego a principio ita me malle dixeram hoc ipsum providens, dialecticas captiones. Aeque enim contingit omnibus fidibus, ut incontentae sint. Quod quidem iam fit etiam in Academia. At vero illa, quae Peripatetici, quae Stoici dicunt, semper tibi in ore sunt in iudiciis, in senatu. Hoc est vim afferre, Torquate, sensibus, extorquere ex animis cognitiones verborum, quibus inbuti sumus.",
"id": 2,
"author": { "name": "Heather May", "age": 39, "avatar": "2.jpg" },
"date": "Aug 22, 2019"
},
{
"text": "Nam cui proposito sit conservatio sui, necesse est huic partes quoque sui caras suo genere laudabiles. Facete M. Et tamen ego a philosopho, si afferat eloquentiam, non asperner, si non habeat, non admodum flagitem. Ne amores quidem sanctos a sapiente alienos esse arbitrantur. Utinam quidem dicerent alium alio beatiorem! Iam ruinas videres. Quacumque enim ingredimur, in aliqua historia vestigium ponimus. Quod quidem iam fit etiam in Academia.",
"id": 1,
"author": { "name": "Denise Webb", "age": 24, "avatar": "6.jpg" },
"date": "Aug 18, 2019"
}
]
15 changes: 10 additions & 5 deletions diversehq/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "village",
"name": "diverse",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -8,19 +8,24 @@
"lint": "next lint"
},
"dependencies": {
"@urql/core": "^2.4.4",
"airtable": "^0.11.1",
"ethers": "^5.5.3",
"firebase": "^9.6.11",
"graphql": "^16.3.0",
"next": "12.0.7",
"react": "17.0.2",
"react-animate-on-scroll": "^2.1.5",
"react-dom": "17.0.2",
"vanilla-tilt": "^1.7.2"
"vanilla-tilt": "^1.7.2",
"web3.storage": "^4.0.0"
},
"devDependencies": {
"autoprefixer": "^10.4.1",
"autoprefixer": "^10.4.4",
"dotenv": "^16.0.0",
"eslint": "8.6.0",
"eslint-config-next": "12.0.7",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.11"
"postcss": "^8.4.12",
"tailwindcss": "^3.0.23"
}
}
13 changes: 11 additions & 2 deletions diversehq/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import '../styles/globals.css'
import {WalletProvider} from "../utils/WalletContext"
import WalletProvider from "../utils/WalletContext"
import { createClient, Provider } from 'urql';

const client = createClient({
url: 'https://api.thegraph.com/subgraphs/name/kirtirajsinh/diversehq'
});


function MyApp({ Component, pageProps }) {
return(
<WalletProvider>
<Provider value={client}>
<Component {...pageProps} />
</WalletProvider>)
</Provider>
</WalletProvider>
)
}

export default MyApp
91 changes: 91 additions & 0 deletions diversehq/pages/home/[address].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { Token } from 'graphql';
import { useRouter } from 'next/router'
import {useEffect, useState, useReducer} from "react"
import { createClient, Client } from '@urql/core';
import {Web3Storage} from "web3.storage"
import Image from 'next/image'


const client = createClient({
url: "https://api.thegraph.com/subgraphs/name/kirtirajsinh/diversehq"
})


const Community = ()=>{
const router = useRouter();
const {address} = router.query
const [files, setFiles] = useState([])
const [messages, showMessage] = useReducer((msgs, m) => msgs.concat(m), [])
const [tokens, setTokens] = useState('')

console.log(address)

const handleSubmit= async(event) => {
event.preventDefault()
const token = process.env.NEXT_PUBLIC_WEB3_STORAGE_API_KEY
showMessage('> 📦 creating web3.storage client')
const client = new Web3Storage({ token })

// showMessage('> 🤖 chunking and hashing the files (in your browser!) to calculate the Content ID')
const cid = await client.put(files, {
onRootCidReady: localCid => {
// showMessage(`> 🔑 locally calculated Content ID: ${localCid} `)
// showMessage('> 📡 sending files to web3.storage ')
},
onStoredChunk: bytes => showMessage(`> 🛰 sent ${bytes.toLocaleString()} bytes to web3.storage`)
})
showMessage(`> ✅ web3.storage now hosting ${cid}`)
showLink(`https://dweb.link/ipfs/${cid}/${files[0].name}`)

// showMessage('> 📡 fetching the list of all unique uploads on this account')
let totalBytes = 0
for await (const upload of client.list()) {
totalBytes += upload.dagSize || 0
}
// showMessage(`> ⁂ ${totalBytes.toLocaleString()} bytes stored!`)
};

function showLink (url) {
showMessage(<span>&gt; 🔗 <a href={url}>{url}</a></span>)
}

const query = `
query{
tokens(where:{tokenaddress:"${address}"}) {
id
count
tokenaddress
creator
name
symbol
totalSupply
}
}
`

async function fetchData(event) {
const response = await client.query(query).toPromise();
console.log('response:', response)
// setTokens(response.data.tokens[0])
}
useEffect(() => {
fetchData();
}, [])

return(
<div>
{/* <h1>Community Name: {token.name}</h1> */}
<form onSubmit={handleSubmit}>
<label htmlFor='filepicker'>Pick files to store</label>
<input type='file' id='filepicker' name='fileList' onChange={e => setFiles(e.target.files)} />
<input type='submit' value='Submit' id='submit' />
</form>
<div id='output'>
&gt; ⁂ waiting for form submission...
{messages.map((m, i) => <div key={m + i}>{m}</div>)}
</div>
</div>
)
}

export default Community;
63 changes: 34 additions & 29 deletions diversehq/pages/home/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState, useContext } from "react";
import Link from 'next/link';
import {WalletContext} from "../../utils/WalletContext";
import { createClient } from 'urql';
import { createClient } from '@urql/core';

const query = `
query{
Expand All @@ -17,7 +17,7 @@ query{
}
`
const client = createClient({
url: ""
url: "https://api.thegraph.com/subgraphs/name/kirtirajsinh/diversehq"
})

const App = () => {
Expand Down Expand Up @@ -82,43 +82,48 @@ const App = () => {

return (

<div className="mainContainer">
<div className="dataContainer">
<div className="h-screen bg-gray-50">
<div className="flex flex-col ">

<div className="flex flex-col justify-center items-center">
<div className="header">
👋 Welcome to the first step towards creating a Great community!
👋 Welcome to the first step towards <br/> building a Great community!
</div>

<Link href='/tokencr' className="waveButton">
<div className="pt-8">
{!wallet ? (
<button className="border border-black max-w-md hover:bg-gray-400 p-2 rounded-full " onClick={connectWallet}>
Connect Wallet
</button>
): (
<button className="border border-black max-w-md hover:bg-red-50 p-2 rounded-full cursor-cell">
<Link href='/tokencr' className="">
Create Token
</Link>


{/* * If there is no currentAccount render this button */}

{!wallet && (
<button className="waveButton" onClick={connectWallet}>
Connect Wallet
</button>
)}
</div>
</div>
<br />
<div>

<div className="flex flex-col p-16">
{
tokens.map((token, index) => (
<div>
<p>
`Token Name: ${token.name} <br></br>
Token Symbol: {token.symbol} <br></br>
Token Address: {token.tokenaddress} <br></br>
Total Supply: {token.totalSupply} <br></br>
Token Creator: {token.creator}`
</p>
</div>
))
}
tokens.map((token) => (
<button className="p-2 hover:bg-red-50" key={token.tokenaddress}>
<Link href={'/home/' + token.tokenaddress} className="">

<p className="border rounded-md border-black p-3 ">
Community Name: {token.name} <br></br>
Token Symbol: ${token.symbol} <br></br>
Token Creator: {token.creator}<br/>
Token Address: {token.tokenaddress}
</p>
</Link>
</button>
))
}
</div>
</div>
</div>
);
}
export default App

export default App
4 changes: 2 additions & 2 deletions diversehq/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ const Home = () => {
</div>
<div className="flex flex-col">
<Community />
<Features />
{/* <Features /> */}
<Join />
</div>
</div>
)
}

export default Home
export default Home
Loading