Skip to content

Commit

Permalink
fix: update from review
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Nov 2, 2023
1 parent 548ca25 commit 24d289a
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion components/discount/registerDiscount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const RegisterDiscount: FunctionComponent<RegisterDiscountProps> = ({

addTransaction({
timestamp: Date.now(),
subtext: "Registering a domain",
subtext: "Domain registration",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.BUY_DOMAIN,
Expand Down
2 changes: 1 addition & 1 deletion components/domains/registerV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const RegisterV2: FunctionComponent<RegisterV2Props> = ({ domain, groups }) => {

addTransaction({
timestamp: Date.now(),
subtext: "Registering your domain",
subtext: "Domain registration",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.BUY_DOMAIN,
Expand Down
2 changes: 1 addition & 1 deletion components/domains/renewal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const Renewal: FunctionComponent<RenewalProps> = ({ groups }) => {

addTransaction({
timestamp: Date.now(),
subtext: "Renewing your domain",
subtext: "Domain renewal",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.RENEW_DOMAIN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const ClickablePersonhoodIcon: FunctionComponent<
subtext: "Proof of personhood",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.VERIFIER,
type: TransactionType.VERIFIER_POP,
hash: verifierData.transaction_hash,
status: "pending",
},
Expand Down
2 changes: 1 addition & 1 deletion components/identities/actions/identityActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const IdentityActions: FunctionComponent<IdentityActionsProps> = ({
subtext: "Set as main domain",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.BUY_DOMAIN,
type: TransactionType.MAIN_DOMAIN,
hash: mainDomainData.transaction_hash,
status: "pending",
},
Expand Down
2 changes: 1 addition & 1 deletion components/identities/actions/subdomainModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const SubdomainModal: FunctionComponent<SubdomainModalProps> = ({
subtext: `For ${domain}`,
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.SUBDOMAIN,
type: TransactionType.SUBDOMAIN_CREATION,
hash: transferDomainData.transaction_hash,
status: "pending",
},
Expand Down
3 changes: 0 additions & 3 deletions hooks/useNotificationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function useNotificationManager() {

useEffect(() => {
const intervalId = setInterval(() => {
console.log("notifications", notifications);
notifications.forEach(checkTransactionStatus);
}, 5000);

Expand All @@ -35,8 +34,6 @@ export function useNotificationManager() {
const data = await provider.getTransactionReceipt(transaction.hash);
const updatedTransactions = [...notifications];

console.log("data", data);

if (data?.status === "REJECTED" || data?.status === "REVERTED") {
updatedTransactions[index].data.status = "error";
updatedTransactions[index].data.txStatus = "REJECTED";
Expand Down
2 changes: 1 addition & 1 deletion pages/discord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const Discord: NextPage = () => {
subtext: "Discord verification",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.VERIFIER,
type: TransactionType.VERIFIER_DISCORD,
hash: discordVerificationData.transaction_hash,
status: "pending",
},
Expand Down
4 changes: 2 additions & 2 deletions pages/github.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ const Github: NextPage = () => {
posthog?.capture("githubVerificationTx");
addTransaction({
timestamp: Date.now(),
subtext: "Discord verification",
subtext: "Github verified",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.VERIFIER,
type: TransactionType.VERIFIER_GITHUB,
hash: githubVerificationData.transaction_hash,
status: "pending",
},
Expand Down
4 changes: 2 additions & 2 deletions pages/twitter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ const Twitter: NextPage = () => {
posthog?.capture("twitterVerificationTx");
addTransaction({
timestamp: Date.now(),
subtext: "Discord verification",
subtext: "Twitter verification",
type: NotificationType.TRANSACTION,
data: {
type: TransactionType.VERIFIER,
type: TransactionType.VERIFIER_TWITTER,
hash: twitterVerificationData.transaction_hash,
status: "pending",
},
Expand Down
14 changes: 10 additions & 4 deletions utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ export enum TransactionType {
DISABLE_AUTORENEW = "DISABLE_AUTORENEW",
CHANGE_ADDRESS = "CHANGE_ADDRESS",
TRANSFER_IDENTITY = "TRANSFER_IDENTITY",
VERIFIER = "VERIFIER",
VERIFIER_POP = "VERIFIER_POP",
VERIFIER_TWITTER = "VERIFIER_TWITTER",
VERIFIER_DISCORD = "VERIFIER_DISCORD",
VERIFIER_GITHUB = "VERIFIER_GITHUB",
MAIN_DOMAIN = "MAIN_DOMAIN",
SUBDOMAIN = "SUBDOMAIN",
SUBDOMAIN_CREATION = "SUBDOMAIN_CREATION",
SET_PFP = "SET_PFP",
}

Expand All @@ -46,9 +49,12 @@ export const notificationTitle: Record<TransactionType, string> = {
[TransactionType.DISABLE_AUTORENEW]: "Auto renewal disabled",
[TransactionType.CHANGE_ADDRESS]: "Address changed",
[TransactionType.TRANSFER_IDENTITY]: "Domain transferred",
[TransactionType.VERIFIER]: "Verifier added",
[TransactionType.VERIFIER_POP]: "Proof of personhood verified",
[TransactionType.VERIFIER_TWITTER]: "Twitter verified",
[TransactionType.VERIFIER_DISCORD]: "Discord verified",
[TransactionType.VERIFIER_GITHUB]: "Github verified",
[TransactionType.MAIN_DOMAIN]: "Main domain set",
[TransactionType.SUBDOMAIN]: "Subdomain created",
[TransactionType.SUBDOMAIN_CREATION]: "Subdomain created",
[TransactionType.SET_PFP]: "New profile picture set",
};

Expand Down

0 comments on commit 24d289a

Please sign in to comment.