From e79177646f763407ae1a52d70843d38e073bafa6 Mon Sep 17 00:00:00 2001 From: Rico Date: Thu, 28 Jul 2022 19:37:15 +0800 Subject: [PATCH 1/5] react-app: Update Likecoin texts to LikeCoin refs #328 --- react-app/src/i18n/translations/en.json | 4 ++-- react-app/src/i18n/translations/zh.json | 4 ++-- react-app/src/providers/AuthProvider.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/react-app/src/i18n/translations/en.json b/react-app/src/i18n/translations/en.json index 7c4fe815..2f369c4f 100644 --- a/react-app/src/i18n/translations/en.json +++ b/react-app/src/i18n/translations/en.json @@ -221,7 +221,7 @@ "auth.loginFailure": "Failed to login, please try again", "footer.contactSupport": "Contact Support", "footer.getToken": "Get Token", - "footer.likecoin": "© {year} Likecoin", + "footer.likecoin": "© {year} LikeCoin", "footer.needHelp": "Need help?", "form.validation.address.invalidAddress": "Invalid address", "form.validation.address.invalidPrefix": "Invalid address prefix, please use address with prefix `{prefix}`", @@ -239,7 +239,7 @@ "reactions.confused": "Confused", "reactions.dislike": "Dislike", "reactions.like": "Like", - "reactions.likecoin": "Likecoin", + "reactions.likecoin": "LikeCoin", "reactions.thinking": "Thinking", "reactions.whatever": "Whatever", "transaction.broadcasting": "Broadcasting transaction...", diff --git a/react-app/src/i18n/translations/zh.json b/react-app/src/i18n/translations/zh.json index 08dcdb79..17ecf33d 100644 --- a/react-app/src/i18n/translations/zh.json +++ b/react-app/src/i18n/translations/zh.json @@ -221,7 +221,7 @@ "auth.loginFailure": "Failed to login, please try again", "footer.contactSupport": "Contact Support", "footer.getToken": "Get Token", - "footer.likecoin": "© {year} Likecoin", + "footer.likecoin": "© {year} LikeCoin", "footer.needHelp": "Need help?", "form.validation.address.invalidAddress": "Invalid address", "form.validation.address.invalidPrefix": "Invalid address prefix, please use address with prefix `{prefix}`", @@ -239,7 +239,7 @@ "reactions.confused": "Confused", "reactions.dislike": "Dislike", "reactions.like": "Like", - "reactions.likecoin": "Likecoin", + "reactions.likecoin": "LikeCoin", "reactions.thinking": "Thinking", "reactions.whatever": "Whatever", "transaction.broadcasting": "Broadcasting transaction...", diff --git a/react-app/src/providers/AuthProvider.tsx b/react-app/src/providers/AuthProvider.tsx index 4c7eca5d..b8a36d41 100644 --- a/react-app/src/providers/AuthProvider.tsx +++ b/react-app/src/providers/AuthProvider.tsx @@ -13,7 +13,7 @@ function makeSignInWithCosmosMessage( ): string { const now = new Date(); return ( - `${url.host} wants you to sign in with your Likecoin account:\n` + + `${url.host} wants you to sign in with your LikeCoin account:\n` + `${address}\n\n\n\n` + `URI: ${url.origin}\n` + `Version: 1\n` + From 3e06030864cb858decf79c713c324692ba385e8a Mon Sep 17 00:00:00 2001 From: Rico Date: Fri, 29 Jul 2022 12:24:47 +0800 Subject: [PATCH 2/5] react-app, deploy: Add github url to footerlinks config refs #328 --- deploy/likedao/templates/react-app.config.yaml | 1 + deploy/likedao/values.sample.yaml | 1 + react-app/config/config.template.js | 1 + react-app/src/config/Config.ts | 2 ++ 4 files changed, 5 insertions(+) diff --git a/deploy/likedao/templates/react-app.config.yaml b/deploy/likedao/templates/react-app.config.yaml index bd04e098..1d06789f 100644 --- a/deploy/likedao/templates/react-app.config.yaml +++ b/deploy/likedao/templates/react-app.config.yaml @@ -46,6 +46,7 @@ data: {{- end}} ], footerLinks: { + githubLink: {{ .Values.reactApp.githubLink | quote }}, tokenLinks: [ {{- range .Values.reactApp.footerLinks.tokenLinks }} {{- with .}} diff --git a/deploy/likedao/values.sample.yaml b/deploy/likedao/values.sample.yaml index 009b69c1..68b19964 100644 --- a/deploy/likedao/values.sample.yaml +++ b/deploy/likedao/values.sample.yaml @@ -33,6 +33,7 @@ reactApp: - chainId: likecoin-mainnet-2 link: http://localhost:3000 footerLinks: + githubLink: https://github.com/likecoin/likedao tokenLinks: - name: osmosis link: https://app.osmosis.zone/?from=ATOM&to=LIKE diff --git a/react-app/config/config.template.js b/react-app/config/config.template.js index 76cd0476..3d9027dd 100644 --- a/react-app/config/config.template.js +++ b/react-app/config/config.template.js @@ -24,6 +24,7 @@ window.appConfig = { authEndpoint: "http://localhost:8080/auth", chainLinks: [], footerLinks: { + githubLink: "https://github.com/likecoin/likedao", tokenLinks: [ { name: "osmosis", diff --git a/react-app/src/config/Config.ts b/react-app/src/config/Config.ts index c0efa687..2759f02a 100644 --- a/react-app/src/config/Config.ts +++ b/react-app/src/config/Config.ts @@ -30,6 +30,7 @@ export interface ChainInfo { } interface FooterLinks { + githubLink: string; tokenLinks: TokenLink[]; contactSupport?: string; } @@ -74,6 +75,7 @@ const defaultConfig: IConfig = { authEndpoint: "http://localhost:8080/auth", chainLinks: [], footerLinks: { + githubLink: "https://github.com/likecoin/likedao", tokenLinks: [ { name: "osmosis", From 90e49ba7fa7b2ff1f2d39301cc322603c2cac7b2 Mon Sep 17 00:00:00 2001 From: Rico Date: Thu, 28 Jul 2022 19:43:51 +0800 Subject: [PATCH 3/5] react-app: Add license and github url to footer refs #328 --- react-app/src/components/Footer/Footer.tsx | 137 ++++++++++++--------- react-app/src/i18n/translations/en.json | 3 +- react-app/src/i18n/translations/zh.json | 3 +- 3 files changed, 86 insertions(+), 57 deletions(-) diff --git a/react-app/src/components/Footer/Footer.tsx b/react-app/src/components/Footer/Footer.tsx index fae57dd0..5535ee20 100644 --- a/react-app/src/components/Footer/Footer.tsx +++ b/react-app/src/components/Footer/Footer.tsx @@ -16,57 +16,53 @@ const Footer: React.FC = () => { "text-sm", "leading-5", "font-normal", + "items-center", "text-gray-500", "desktop:flex", - "desktop:items-center", + "desktop:justify-between", "desktop:mt-5" )} > -

- -

-

- -

+

+ +

+ + +
- {Config.footerLinks.tokenLinks.map((token) => ( - - {token.name} - - ))} -
- {Config.footerLinks.contactSupport != null && ( +

+ +

{ "desktop:px-3" )} > -

- -

- ( + + {token.name} + + ))} +
+ {Config.footerLinks.contactSupport != null && ( +
-
- )} + > +

+ +

+ + + )} + ); diff --git a/react-app/src/i18n/translations/en.json b/react-app/src/i18n/translations/en.json index 2f369c4f..841f2668 100644 --- a/react-app/src/i18n/translations/en.json +++ b/react-app/src/i18n/translations/en.json @@ -221,7 +221,8 @@ "auth.loginFailure": "Failed to login, please try again", "footer.contactSupport": "Contact Support", "footer.getToken": "Get Token", - "footer.likecoin": "© {year} LikeCoin", + "footer.github": "GitHub", + "footer.license": "Apache License", "footer.needHelp": "Need help?", "form.validation.address.invalidAddress": "Invalid address", "form.validation.address.invalidPrefix": "Invalid address prefix, please use address with prefix `{prefix}`", diff --git a/react-app/src/i18n/translations/zh.json b/react-app/src/i18n/translations/zh.json index 17ecf33d..e1e4ca75 100644 --- a/react-app/src/i18n/translations/zh.json +++ b/react-app/src/i18n/translations/zh.json @@ -221,7 +221,8 @@ "auth.loginFailure": "Failed to login, please try again", "footer.contactSupport": "Contact Support", "footer.getToken": "Get Token", - "footer.likecoin": "© {year} LikeCoin", + "footer.github": "GitHub", + "footer.license": "Apache License", "footer.needHelp": "Need help?", "form.validation.address.invalidAddress": "Invalid address", "form.validation.address.invalidPrefix": "Invalid address prefix, please use address with prefix `{prefix}`", From e9a4a0a7168d481e34c5c45ac2aceafc36eef011 Mon Sep 17 00:00:00 2001 From: Rico Date: Fri, 29 Jul 2022 12:29:26 +0800 Subject: [PATCH 4/5] react-app, deploy: Update osmosis url and remove liquid & emeris refs #327 --- deploy/likedao/values.sample.yaml | 6 +----- react-app/config/config.template.js | 10 +--------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/deploy/likedao/values.sample.yaml b/deploy/likedao/values.sample.yaml index 68b19964..3a4491ba 100644 --- a/deploy/likedao/values.sample.yaml +++ b/deploy/likedao/values.sample.yaml @@ -36,11 +36,7 @@ reactApp: githubLink: https://github.com/likecoin/likedao tokenLinks: - name: osmosis - link: https://app.osmosis.zone/?from=ATOM&to=LIKE - - name: liquid - link: https://app.liquid.com/exchange/LIKEUSDT - - name: emeris - link: https://app.emeris.com/welcome + link: https://app.osmosis.zone/?from=OSMO&to=LIKE contactSupport: https://go.crisp.chat/chat/embed/?website_id=5c009125-5863-4059-ba65-43f177ca33f7 bech32Config: bech32PrefixAccAddr: like diff --git a/react-app/config/config.template.js b/react-app/config/config.template.js index 3d9027dd..099831e6 100644 --- a/react-app/config/config.template.js +++ b/react-app/config/config.template.js @@ -28,15 +28,7 @@ window.appConfig = { tokenLinks: [ { name: "osmosis", - link: "https://app.osmosis.zone/?from=ATOM&to=LIKE", - }, - { - name: "liquid", - link: "https://app.liquid.com/exchange/LIKEUSDT", - }, - { - name: "emeris", - link: "https://app.emeris.com/welcome", + link: "https://app.osmosis.zone/?from=OSMO&to=LIK", }, ], contactSupport: From d4a2976a2059551a126d793ca533adeacc3c39b8 Mon Sep 17 00:00:00 2001 From: Rico Date: Mon, 1 Aug 2022 15:02:40 +0800 Subject: [PATCH 5/5] graphql-server: Update eip4361 abnf spelling for LikeCoin refs #328 --- graphql-server/pkg/abnf/eip4361.go | 4 ++-- graphql-server/pkg/abnf/eip4361_test.go | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/graphql-server/pkg/abnf/eip4361.go b/graphql-server/pkg/abnf/eip4361.go index 61d4b904..7892a350 100644 --- a/graphql-server/pkg/abnf/eip4361.go +++ b/graphql-server/pkg/abnf/eip4361.go @@ -19,7 +19,7 @@ const ( // https://eips.ethereum.org/EIPS/eip-4361 -// domain %s" wants you to sign in with your Likecoin account:" LF +// domain %s" wants you to sign in with your LikeCoin account:" LF // address LF // LF // [ statement LF ] @@ -36,7 +36,7 @@ const ( // resources ] func AuthenticationMessage() abnf.Rule { return abnf.C( - abnf.K(Authority(), AuthorityFQDN), abnf.SP(), abnf.VS("wants you to sign in with your Likecoin account:"), abnf.LF(), + abnf.K(Authority(), AuthorityFQDN), abnf.SP(), abnf.VS("wants you to sign in with your LikeCoin account:"), abnf.LF(), abnf.K(_address(), AddressFQDN), abnf.LF(), abnf.LF(), abnf.O(abnf.C(abnf.K(_statement(), StatementFQDN), abnf.LF())), diff --git a/graphql-server/pkg/abnf/eip4361_test.go b/graphql-server/pkg/abnf/eip4361_test.go index e91e6999..78688c78 100644 --- a/graphql-server/pkg/abnf/eip4361_test.go +++ b/graphql-server/pkg/abnf/eip4361_test.go @@ -13,12 +13,12 @@ func Test_EIP4361Message(t *testing.T) { authority := "likedao.com" address := "like1cq425wdjy0lg6zswt38j06kepq782mxzsuveua" uri := "https://likedao.com" - chainID := "likecoin-mainnet-2" + chainID := "LikeCoin-mainnet-2" nonce := "12345678" issuedAt := "2006-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+ @@ -64,7 +64,7 @@ func Test_EIP4361Message(t *testing.T) { }) t.Run("Official EIP Sample Message", func(t *testing.T) { - message := "service.org wants you to sign in with your Likecoin account:\n" + + message := "service.org wants you to sign in with your LikeCoin account:\n" + "like1cq425wdjy0lg6zswt38j06kepq782mxzsuveua\n" + "\n" + "I accept the ServiceOrg Terms of Service: https://service.org/tos\n" + @@ -93,7 +93,7 @@ func Test_EIP4361Message(t *testing.T) { issuedAt := "2020-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+ @@ -117,7 +117,7 @@ func Test_EIP4361Message(t *testing.T) { issuedAt := "2020-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+ @@ -141,7 +141,7 @@ func Test_EIP4361Message(t *testing.T) { issuedAt := "2020-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+ @@ -165,7 +165,7 @@ func Test_EIP4361Message(t *testing.T) { issuedAt := "2020-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+ @@ -189,7 +189,7 @@ func Test_EIP4361Message(t *testing.T) { issuedAt := "2020-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+ @@ -213,7 +213,7 @@ func Test_EIP4361Message(t *testing.T) { issuedAt := "20200-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+ @@ -237,7 +237,7 @@ func Test_EIP4361Message(t *testing.T) { issuedAt := "2020-01-02T15:04:05Z" message := fmt.Sprintf( - "%s wants you to sign in with your Likecoin account:\n"+ + "%s wants you to sign in with your LikeCoin account:\n"+ "%s\n"+ "\n\n\n"+ "URI: %s\n"+