From 9686006f99767d61fbceb808e0c5aa75b3ebf078 Mon Sep 17 00:00:00 2001 From: Aroso Emmanuel Date: Thu, 28 Nov 2024 22:45:21 +0100 Subject: [PATCH 1/7] Fix: Add distinct warning for expired domains --- components/UI/navbar.tsx | 4 ++++ components/identities/identitiesGalleryV1.tsx | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/components/UI/navbar.tsx b/components/UI/navbar.tsx index 32c43120..8033608c 100644 --- a/components/UI/navbar.tsx +++ b/components/UI/navbar.tsx @@ -306,7 +306,11 @@ const Navbar: FunctionComponent = () => { >>>>>> e09c027 (Fix: Add distinct warning for expired domains) target="_blank" >
  • diff --git a/components/identities/identitiesGalleryV1.tsx b/components/identities/identitiesGalleryV1.tsx index 7eab56c5..a67e0f7b 100644 --- a/components/identities/identitiesGalleryV1.tsx +++ b/components/identities/identitiesGalleryV1.tsx @@ -69,14 +69,24 @@ const IdentitiesGalleryV1: FunctionComponent = ({ >>>>>> e09c027 (Fix: Add distinct warning for expired domains) identity?.domain_expiry ?? 0 )}` } arrow > +<<<<<<< HEAD +======= + {/* */} + +>>>>>>> e09c027 (Fix: Add distinct warning for expired domains) ) : null} From c27edcd556727734f6a6a6c6086973ba8479679c Mon Sep 17 00:00:00 2001 From: Aroso Emmanuel Date: Thu, 28 Nov 2024 22:58:32 +0100 Subject: [PATCH 2/7] Fix: Add distinct warning for expired domains --- .gitignore | 2 +- components/UI/walletConnect.tsx | 24 ++--- public/fonts/poppins/OFL.txt | 186 ++++++++++++++++---------------- utils/connectorWrapper.ts | 15 ++- 4 files changed, 120 insertions(+), 107 deletions(-) diff --git a/.gitignore b/.gitignore index 4b340ef1..8053fde5 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,4 @@ next-env.d.ts yarn.lock -.env \ No newline at end of file +.env diff --git a/components/UI/walletConnect.tsx b/components/UI/walletConnect.tsx index f978fb4e..e3887dc1 100644 --- a/components/UI/walletConnect.tsx +++ b/components/UI/walletConnect.tsx @@ -1,4 +1,4 @@ -import React, { FunctionComponent } from "react"; +import React, { FunctionComponent, useEffect, useState } from "react"; import { useRouter } from "next/router"; import { Modal, useMediaQuery } from "@mui/material"; import { Connector } from "starknetkit"; @@ -8,9 +8,9 @@ import { getConnectorDiscovery, getConnectorIcon, getConnectorName, + isInArgentMobileAppBrowser, sortConnectors, } from "@/utils/connectorWrapper"; -import { isInArgentMobileAppBrowser } from 'starknetkit/argentMobile'; type WalletConnectProps = { closeModal: () => void; @@ -26,21 +26,21 @@ const WalletConnect: FunctionComponent = ({ connectWallet, }) => { const router = useRouter(); + const [isArgentMobile, setIsArgentMobile] = useState(false); const connect = (connector: Connector) => { connectWallet(connector); closeModal(); }; const isMobile = useMediaQuery("(max-width: 768px)"); - const filterConnectors = (connectors: Connector[]) => { - if (isInArgentMobileAppBrowser()) { - // Filter connectors and remove duplicates - const uniqueConnectors = connectors - .filter((connector) => connector.id === "argentMobile" || connector.id === "argentX") - .reduce((map, connector) => map.set(connector.id, connector), new Map()) - .values(); + useEffect(() => { + if (typeof window !== "undefined") + setIsArgentMobile(isInArgentMobileAppBrowser()); + }, []); - return Array.from(uniqueConnectors); + const filterConnectors = (connectors: Connector[]) => { + if (isArgentMobile) { + return connectors.filter((connector) => connector.id === "argentMobile"); } if (!isMobile) return connectors; return connectors.filter((connector) => connector.id !== "argentX"); @@ -102,13 +102,13 @@ const WalletConnect: FunctionComponent = ({ onClick={() => tryConnect(connector, isAvailable)} >

    {needInstall(connector, isAvailable) ? "Install " : ""} - {isInArgentMobileAppBrowser() + {connector.id === "argentMobile" && isMobile ? "Argent" : getConnectorName(connector.id)}

    diff --git a/public/fonts/poppins/OFL.txt b/public/fonts/poppins/OFL.txt index 246c977c..76df3b56 100644 --- a/public/fonts/poppins/OFL.txt +++ b/public/fonts/poppins/OFL.txt @@ -1,93 +1,93 @@ -Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. +Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/utils/connectorWrapper.ts b/utils/connectorWrapper.ts index 343e9370..172fe18c 100644 --- a/utils/connectorWrapper.ts +++ b/utils/connectorWrapper.ts @@ -1,4 +1,4 @@ -import { Connector } from "starknetkit"; +import { Connector, StarknetWindowObject } from "starknetkit"; import { ArgentMobileConnector } from "starknetkit/argentMobile"; import { InjectedConnector } from "starknetkit/injected"; import { WebWalletConnector } from "starknetkit/webwallet"; @@ -90,6 +90,19 @@ export const getLastConnected = (): Connector | null => { return null; }; +export const isInArgentMobileAppBrowser = (): boolean => { + if (typeof window === "undefined" || !window?.starknet_argentX) { + return false; + } + + const starknetMobile = + window?.starknet_argentX as unknown as StarknetWindowObject & { + isInAppBrowser: boolean; + }; + + return starknetMobile?.isInAppBrowser; +}; + const wallets = [ { id: "argentX", From a79e75e9fee182091f49a820f01a1cf0a5911f6c Mon Sep 17 00:00:00 2001 From: Aroso Emmanuel Date: Thu, 28 Nov 2024 23:48:09 +0100 Subject: [PATCH 3/7] Fix: Add distinct warning for expired domains --- components/UI/navbar.tsx | 4 --- components/UI/walletConnect.tsx | 26 +++++++++---------- components/identities/identitiesGalleryV1.tsx | 9 ------- utils/connectorWrapper.ts | 15 +---------- 4 files changed, 14 insertions(+), 40 deletions(-) diff --git a/components/UI/navbar.tsx b/components/UI/navbar.tsx index 8033608c..16636d21 100644 --- a/components/UI/navbar.tsx +++ b/components/UI/navbar.tsx @@ -306,11 +306,7 @@ const Navbar: FunctionComponent = () => {
  • >>>>>> e09c027 (Fix: Add distinct warning for expired domains) target="_blank" >
  • diff --git a/components/UI/walletConnect.tsx b/components/UI/walletConnect.tsx index e3887dc1..8ee2d1a2 100644 --- a/components/UI/walletConnect.tsx +++ b/components/UI/walletConnect.tsx @@ -1,4 +1,4 @@ -import React, { FunctionComponent, useEffect, useState } from "react"; +import React, { FunctionComponent } from "react"; import { useRouter } from "next/router"; import { Modal, useMediaQuery } from "@mui/material"; import { Connector } from "starknetkit"; @@ -8,9 +8,9 @@ import { getConnectorDiscovery, getConnectorIcon, getConnectorName, - isInArgentMobileAppBrowser, sortConnectors, } from "@/utils/connectorWrapper"; +import { isInArgentMobileAppBrowser } from 'starknetkit/argentMobile'; type WalletConnectProps = { closeModal: () => void; @@ -26,21 +26,21 @@ const WalletConnect: FunctionComponent = ({ connectWallet, }) => { const router = useRouter(); - const [isArgentMobile, setIsArgentMobile] = useState(false); const connect = (connector: Connector) => { connectWallet(connector); closeModal(); }; const isMobile = useMediaQuery("(max-width: 768px)"); - useEffect(() => { - if (typeof window !== "undefined") - setIsArgentMobile(isInArgentMobileAppBrowser()); - }, []); - const filterConnectors = (connectors: Connector[]) => { - if (isArgentMobile) { - return connectors.filter((connector) => connector.id === "argentMobile"); + if (isInArgentMobileAppBrowser()) { + // Filter connectors and remove duplicates + const uniqueConnectors = connectors + .filter((connector) => connector.id === "argentMobile" || connector.id === "argentX") + .reduce((map, connector) => map.set(connector.id, connector), new Map()) + .values(); + + return Array.from(uniqueConnectors); } if (!isMobile) return connectors; return connectors.filter((connector) => connector.id !== "argentX"); @@ -102,13 +102,13 @@ const WalletConnect: FunctionComponent = ({ onClick={() => tryConnect(connector, isAvailable)} >

    {needInstall(connector, isAvailable) ? "Install " : ""} - {connector.id === "argentMobile" && isMobile + {isInArgentMobileAppBrowser() ? "Argent" : getConnectorName(connector.id)}

    @@ -127,4 +127,4 @@ const WalletConnect: FunctionComponent = ({ ); }; -export default WalletConnect; +export default WalletConnect; \ No newline at end of file diff --git a/components/identities/identitiesGalleryV1.tsx b/components/identities/identitiesGalleryV1.tsx index a67e0f7b..5a8d23e8 100644 --- a/components/identities/identitiesGalleryV1.tsx +++ b/components/identities/identitiesGalleryV1.tsx @@ -69,24 +69,15 @@ const IdentitiesGalleryV1: FunctionComponent = ({ >>>>>> e09c027 (Fix: Add distinct warning for expired domains) identity?.domain_expiry ?? 0 )}` } arrow > -<<<<<<< HEAD - -======= {/* */} ->>>>>>> e09c027 (Fix: Add distinct warning for expired domains)
    ) : null} diff --git a/utils/connectorWrapper.ts b/utils/connectorWrapper.ts index 172fe18c..343e9370 100644 --- a/utils/connectorWrapper.ts +++ b/utils/connectorWrapper.ts @@ -1,4 +1,4 @@ -import { Connector, StarknetWindowObject } from "starknetkit"; +import { Connector } from "starknetkit"; import { ArgentMobileConnector } from "starknetkit/argentMobile"; import { InjectedConnector } from "starknetkit/injected"; import { WebWalletConnector } from "starknetkit/webwallet"; @@ -90,19 +90,6 @@ export const getLastConnected = (): Connector | null => { return null; }; -export const isInArgentMobileAppBrowser = (): boolean => { - if (typeof window === "undefined" || !window?.starknet_argentX) { - return false; - } - - const starknetMobile = - window?.starknet_argentX as unknown as StarknetWindowObject & { - isInAppBrowser: boolean; - }; - - return starknetMobile?.isInAppBrowser; -}; - const wallets = [ { id: "argentX", From 8e99365061df0fc405618b3fc2c510d969f1a3dc Mon Sep 17 00:00:00 2001 From: Aroso Emmanuel Date: Fri, 29 Nov 2024 00:30:54 +0100 Subject: [PATCH 4/7] Fix: Add distinct warning for expired domains --- components/identities/identitiesGalleryV1.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/identities/identitiesGalleryV1.tsx b/components/identities/identitiesGalleryV1.tsx index 5a8d23e8..61745d04 100644 --- a/components/identities/identitiesGalleryV1.tsx +++ b/components/identities/identitiesGalleryV1.tsx @@ -64,7 +64,7 @@ const IdentitiesGalleryV1: FunctionComponent = ({ onClick={() => router.push(`/identities/${identity.id}`)} > {needAutoRenewal?.includes(identity.domain) && - isIdentityExpiringSoon(identity) ? ( + (isIdentityExpired(identity) || isIdentityExpiringSoon(identity)) ? (
    Date: Tue, 17 Dec 2024 00:56:31 +0100 Subject: [PATCH 5/7] add distinct warning for expired domains --- components/identities/identitiesGalleryV1.tsx | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/components/identities/identitiesGalleryV1.tsx b/components/identities/identitiesGalleryV1.tsx index 61745d04..8c3e3fa8 100644 --- a/components/identities/identitiesGalleryV1.tsx +++ b/components/identities/identitiesGalleryV1.tsx @@ -57,27 +57,26 @@ const IdentitiesGalleryV1: FunctionComponent = ({ // Our Indexer
    {identities.map((identity, index) => { + const isExpired = isIdentityExpired(identity); + const isExpiringSoon = isIdentityExpiringSoon(identity); + const expiryDate = timestampToReadableDate(identity?.domain_expiry ?? 0); + return (
    router.push(`/identities/${identity.id}`)} > - {needAutoRenewal?.includes(identity.domain) && - (isIdentityExpired(identity) || isIdentityExpiringSoon(identity)) ? ( + {isExpired ? (
    - - {/* */} - + + + +
    + ) : isExpiringSoon ? ( +
    + +
    ) : null} From b4827c49a5ca9e3301e7142d83c8f5d944578bb1 Mon Sep 17 00:00:00 2001 From: Aroso Emmanuel Date: Tue, 17 Dec 2024 11:42:58 +0100 Subject: [PATCH 6/7] expiring soon checks if enbaled auto renewal --- components/identities/identitiesGalleryV1.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/identities/identitiesGalleryV1.tsx b/components/identities/identitiesGalleryV1.tsx index 8c3e3fa8..22ab88c5 100644 --- a/components/identities/identitiesGalleryV1.tsx +++ b/components/identities/identitiesGalleryV1.tsx @@ -73,7 +73,7 @@ const IdentitiesGalleryV1: FunctionComponent = ({
    - ) : isExpiringSoon ? ( + ) : isExpiringSoon && needAutoRenewal?.includes(identity.domain) ? (
    From c45853afe534859ba9338e6708b725f6ef356b4d Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:48:02 +0100 Subject: [PATCH 7/7] removing space --- components/UI/navbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/UI/navbar.tsx b/components/UI/navbar.tsx index 696a44af..710051af 100644 --- a/components/UI/navbar.tsx +++ b/components/UI/navbar.tsx @@ -327,7 +327,7 @@ const Navbar: FunctionComponent = () => {