Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain update #2

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# BOBDAO
# Builders On Blockchain

###### Project name - Builders On Blockchain
###### Link to working code in a public repo - Steps to check the Unstoppable Domain integration -
1. Clone the Repo
2. cd bob
3. npm install
4. npm start
5. Go to http://localhost:3000
###### Recorded video demo of the integration - https://youtu.be/WoW0iuGrQqA
###### Live URL with working integration - https://bob-dao.vercel.app/
###### Person of contact in case there are any questions - Aviral Gupta (Email - [email protected] )
###### Discord ID - aviral23#0766
###### UnstoppableDomain registered account email address - [email protected]
###### Code where Login With Unstoppable Domain is used - https://github.com/aviral10x/BOBDAO/blob/main/bob/src/components/UDomain.js
###### Code where UnstoppableDomain NFT Resolution is used - https://github.com/aviral10x/BOBDAO/blob/main/bob/src/components/Portfolio.js
File renamed without changes.
16 changes: 16 additions & 0 deletions bob/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Builders On Blockchain

###### Project name - Builders On Blockchain
###### Link to working code in a public repo - Steps to check the Unstoppable Domain integration -
1. Clone the Repo
2. cd bob
3. npm install
4. npm start
5. Go to http://localhost:3000
###### Recorded video demo of the integration - https://youtu.be/WoW0iuGrQqA
###### Live URL with working integration - https://bob-dao.vercel.app/
###### Person of contact in case there are any questions - Aviral Gupta (Email - [email protected] )
###### Discord ID - aviral23#0766
###### UnstoppableDomain registered account email address - [email protected]
###### Code where Login With Unstoppable Domain is used - https://github.com/aviral10x/BOBDAO/blob/main/bob/src/components/UDomain.js
###### Code where UnstoppableDomain NFT Resolution is used - https://github.com/aviral10x/BOBDAO/blob/main/bob/src/components/Portfolio.js
File renamed without changes.
44 changes: 44 additions & 0 deletions personal-portfolio/package-lock.json → bob/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions personal-portfolio/package.json → bob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"react-router-dom": "^6.3.0",
"react-router-hash-link": "^2.4.3",
"react-scripts": "5.0.1",
"axios": "^0.27.2",
"web-vitals": "^2.1.4",
"@babel/preset-react": "^7.16.7",
"@chainlink/contracts": "^0.4.0",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>BOB DAO</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions personal-portfolio/src/App.css → bob/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ span.navbar-text {
position: relative;
background-color: transparent;
transition: 0.3s ease-in-out;
z-index: 1;
}
.navbar-text button span {
z-index: 1;
z-index: 2;
}
.navbar-text button::before {
content: "";
Expand All @@ -172,7 +173,7 @@ span.navbar-text {
background-color: #fff;
left: 0;
top: 0;
z-index: -1;
z-index: 1;
transition: 0.3s ease-in-out;
}
.navbar-text button:hover {
Expand Down
4 changes: 3 additions & 1 deletion personal-portfolio/src/App.js → bob/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Footer } from "./components/Footer";


import Create from './Create'
import Portfolio from './components/Portfolio';

// import MarketplaceAbi from '../contractsData/Marketplace.json'
// import MarketplaceAddress from '../contractsData/Marketplace-address.json'
Expand Down Expand Up @@ -57,7 +58,8 @@ function App() {
<Banner />
<Skills />
<Projects />
<Create/>
<Create />
<Portfolio/>
<Contact />
<Footer />
</div>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const NavBar = () => {
return (
<>
<Router>

<Navbar expand="md" className={scrolled ? "scrolled" : ""}>
<Container>
<Navbar.Brand href="/">
Expand All @@ -49,17 +50,11 @@ export const NavBar = () => {
<Nav.Link href="#home" className={activeLink === 'home' ? 'active navbar-link' : 'navbar-link'} onClick={() => onUpdateActiveLink('home')}>About</Nav.Link>
<Nav.Link href="#skills" className={activeLink === 'skills' ? 'active navbar-link' : 'navbar-link'} onClick={() => onUpdateActiveLink('skills')}>Profile</Nav.Link>
<Nav.Link href="#projects" className={activeLink === 'projects' ? 'active navbar-link' : 'navbar-link'} onClick={() => onUpdateActiveLink('projects')}>Discord</Nav.Link>
<UDomain/>
</Nav>
<span className="navbar-text">
<div className="social-icon">
{/* <a href="#"><img src={navIcon1} alt="" /></a>
<a href="#"><img src={navIcon2} alt="" /></a>
<a href="#"><img src={navIcon3} alt="" /></a> */}
</div>
<HashLink to='/'>
<UDomain/>
</HashLink>
</span>



</Navbar.Collapse>
</Container>
</Navbar>
Expand Down
130 changes: 130 additions & 0 deletions bob/src/components/Portfolio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import React, { useState } from "react";
import axios from "axios";


function Portfolio() {

const API_URL = "https://unstoppabledomains.g.alchemy.com/domains/";
const API_KEY1 = "OPnt5xBjF7t5cIhhqwpZ42iXOoqCut_-";

const [stats, setStats] = useState(null);


function processLookup(e) {
e.preventDefault();

let domain = document.getElementById("domain").value;
if (!domain) return;

axios
.get(API_URL + domain, {
headers: {
Authorization: `bearer ${API_KEY1}`,
},
})
.then((res) => {
setStats(res.data);
console.log(res.data);
})
.catch((err) => {
setStats();
});
}



return (
<>
<div className="flex flex-col px-24 relative justify-center items-center">
<div className=" bg-[#0f172a4d] rounded-3xl p-7 mt-6 ">
<div className="flex flex-col">
<h4>Domain </h4>

</div>

<input
id="domain"
type="text"
placeholder="Enter a domain name"
aria-label="Enter a domain name"
aria-describedby="button-addon"
autoComplete="off"
className=" mt-5 border-[#334155] border bg-[#1E293B] rounded-lg text-[#DBEAFE] py-2 px-10 w-[600px]"
/>
<div className="flex mt-5">

<button
className="font-roboto text-white border-2 px-[60px] py-2 border-[#22C55E] hover:bg-[#22C55E] mb-10"
onClick={processLookup}
>
Search
</button>
</div>


<div className="">
{stats ? (
<div>
<h6>Domain Name - {stats.meta.domain}</h6>
<h6>Owned by - {stats.meta.owner}</h6>
<h6>Blockchain - {stats.meta.blockchain}</h6>
<div>
{stats.records["ipfs.redirect_domain.value"] ? (
<h6>
Website - {stats.records["ipfs.redirect_domain.value"]}
</h6>
) : (
<div>
<h6>No Website found</h6>
</div>
)}
</div>
<div>
<h6>Blockchain addresses in the domain</h6>
<div>
{stats.records["crypto.ETH.address"] ? (
<h6>
ETH Address : {stats.records["crypto.ETH.address"]}
</h6>
) : (
<div>
<h6>No ETH address</h6>
</div>
)}
</div>
<div>
{stats.records["crypto.MATIC.version.MATIC.address"] ? (
<h6>
MATIC Address :{" "}
{stats.records["crypto.MATIC.version.MATIC.address"]}
</h6>
) : (
<div>
<h6>No Matic address</h6>
</div>
)}
</div>

<button className="font-roboto mt-3 px-[60px] py-2 border-gradient-1 mb-10">
<a
className="contactlink"
target="_blank"
href={`${stats.records["ipfs.redirect_domain.value"]}`}
rel="noreferrer"
>
Website
</a>
</button>
</div>
</div>
) : (
<div></div>
)}
</div>
</div>
</div>
</>
);
}

export default Portfolio;
46 changes: 46 additions & 0 deletions bob/src/components/UDomain.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import { useState, useEffect } from 'react';
import UAuth from '@uauth/js';
import { Button } from "react-bootstrap"


const uauth = new UAuth({
clientID: "5d8ef622-e570-43cb-99e4-e71b12167526",
redirectUri: "https://bob-dao.vercel.app/",
});


function UDomain() {
const [Uauth, setUauth] = useState()

async function Connect() {
try {
const authorization = await uauth.loginWithPopup()
setUauth(JSON.parse(JSON.stringify(authorization))["idToken"])

// await authenticate()
} catch (error) {
console.error(error)
}
}

// async function logOut() {
// uauth.logout()
// logout()
// }

function log() {
if (Uauth === null || Uauth === undefined) {
Connect()
}
}

return (
<>
<Button onClick={log}>
{Uauth != null ? Uauth["sub"] : "Login with UNSD"}
</Button>
</>
)
}
export default UDomain
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Loading