Skip to content

Commit

Permalink
add ens daouri text record
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashmi-278 committed May 24, 2024
1 parent 5441cb1 commit 01e5169
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 204 deletions.
10 changes: 7 additions & 3 deletions daostar-website/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,10 @@ function App() {
variables: {
"where": {
"value_not": null,
"key_starts_with_nocase": "com.github",
"key_ends_with_nocase": "com.github"
}
"key_starts_with_nocase": "daouri",
"key_ends_with_nocase": "daouri"
},
"first": 5
},
});
const {
Expand Down Expand Up @@ -346,6 +347,8 @@ function App() {
const EASOptimismAttestations =
EASOptimismData?.attestations || [];

const ENSTextRecords =
ENSQueryResData?.textChangeds || [];
// This object clones and modifies the mainnetV0 registration instances to change the network ID to "ethereum"
// So that when we click on an old registration instance card we are able to view and edit its proprties
// this allows to query mainnetV0 subgraph link
Expand Down Expand Up @@ -418,6 +421,7 @@ function App() {
osmosisInstances={osmosisInstances}
stargazeInstances={stargazeInstances}
easAttestations={EASAttestations}
ENSTextRecords={ENSTextRecords}
/>
}
/>
Expand Down
70 changes: 0 additions & 70 deletions daostar-website/src/components/ENSCard/AttestationCard.css

This file was deleted.

124 changes: 0 additions & 124 deletions daostar-website/src/components/ENSCard/AttestationCard.js

This file was deleted.

39 changes: 39 additions & 0 deletions daostar-website/src/components/ENSCard/ENSCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { Fragment } from 'react';
import { Card, Divider } from '@blueprintjs/core';
import '../AttestationCard/AttestationCard.css';

const DisplayENSTextRecord = ({
id,
key,
value,
resolver
}) => {
const daoName = resolver?.domain?.name ?? "Unknown DAO";
const daoAddress = resolver?.domain?.resolvedAddress?.id ?? "Unknown DAO";
const daoURI = value ? value : "https://daostar.org/registration";

return (
<Card className='wizard-card attestation-card'>
<Fragment>
<h3>{daoName}</h3>
<Divider />
<div className="card-metadata">
<p className="bp4-text-small wizard-no-margin">
<span className="bp4-text-muted">ENS ID: </span>
{id}
</p>
<p className="bp4-text-small wizard-no-margin">
<span className="bp4-text-muted">DAO Address: </span>
{daoAddress}
</p>
<p className="bp4-text-small wizard-no-margin">
<span className="bp4-text-muted">DAO URI: </span>
{daoURI}
</p>
</div>
</Fragment>
</Card>
);
};

export default DisplayENSTextRecord;
10 changes: 9 additions & 1 deletion daostar-website/src/components/ExplorePage/ExplorePage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from "react";
import RegistrationCard from "../RegistrationCard/RegistrationCard";
import AttestationCard from "../AttestationCard/AttestationCard";
import ENSCard from "../ENSCard/ENSCard";
import "./ExplorePage.css";
import { InputGroup, Button } from "@blueprintjs/core";
import { filterEASbyId } from "../FilterRegistrations/Filter_Registrations_By_Id";
Expand Down Expand Up @@ -61,6 +62,7 @@ const NetworkButtons = [
{ text: "Osmosis", filter: "osmosis" },
{ text: "Stargaze", filter: "stargaze" },
{ text: "EAS", filter: "easAttestations" },
{ text: "ENS", filter: "ensTextRecords"}

];
NetworkButtons.sort((a, b) => a.text.localeCompare(b.text));
Expand All @@ -70,7 +72,8 @@ const ExplorePage = ({
junosInstances,
osmosisInstances,
stargazeInstances,
easAttestations
easAttestations,
ENSTextRecords
}) => {
const [filterVal, setFilterVal] = useState("");
const onChangeFilter = (e) => setFilterVal(e.target.value);
Expand Down Expand Up @@ -156,6 +159,11 @@ const ExplorePage = ({
.map((attestation, i) => (
<AttestationCard key={i} {...attestation} />
));
case "ensTextRecords":
return ENSTextRecords
.map((textRecord, i) => (
<ENSCard key={i} {...textRecord} />
));
default:
return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,19 @@ const ATTESTATIONS_BY_SCHEMA = gql`


const ENS_QUERY = gql `
query TextChangeds($where: TextChanged_filter) @api(contextKey: "apiName"){
textChangeds(where: $where) {
query TextChangeds($where: TextChanged_filter, $first: Int) @api(contextKey: "apiName"){
textChangeds(where: $where, first: $first) {
id
key
value
resolver {
addr {
id
domain {
name
resolvedAddress {
id
}
}
}
address
}
}
}
`;
Expand Down

0 comments on commit 01e5169

Please sign in to comment.