Skip to content

Commit

Permalink
Update footer urls and rename Likecoin to LikeCoin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico Wong authored Aug 1, 2022
2 parents 962621a + d4a2976 commit 2c32bcf
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 86 deletions.
1 change: 1 addition & 0 deletions deploy/likedao/templates/react-app.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ data:
{{- end}}
],
footerLinks: {
githubLink: {{ .Values.reactApp.githubLink | quote }},
tokenLinks: [
{{- range .Values.reactApp.footerLinks.tokenLinks }}
{{- with .}}
Expand Down
7 changes: 2 additions & 5 deletions deploy/likedao/values.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ 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
- 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
Expand Down
4 changes: 2 additions & 2 deletions graphql-server/pkg/abnf/eip4361.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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())),
Expand Down
20 changes: 10 additions & 10 deletions graphql-server/pkg/abnf/eip4361_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"+
Expand Down Expand Up @@ -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" +
Expand Down Expand Up @@ -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"+
Expand All @@ -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"+
Expand All @@ -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"+
Expand All @@ -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"+
Expand All @@ -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"+
Expand All @@ -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"+
Expand All @@ -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"+
Expand Down
11 changes: 2 additions & 9 deletions react-app/config/config.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,11 @@ window.appConfig = {
authEndpoint: "http://localhost:8080/auth",
chainLinks: [],
footerLinks: {
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=LIK",
},
],
contactSupport:
Expand Down
137 changes: 82 additions & 55 deletions react-app/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)}
>
<p className={cn("desktop:grow", "desktop:text-left")}>
<LocalizedText
messageID="footer.likecoin"
messageArgs={{ year: new Date().getFullYear() }}
/>
</p>
<p
className={cn(
"mt-6",
"desktop:mt-0",
Config.footerLinks.tokenLinks.length <= 0 && "hidden"
)}
<div
className={cn("flex", "flex-col", "items-center", "desktop:flex-row")}
>
<LocalizedText messageID="footer.getToken" />
</p>
<p className={cn("desktop:grow", "desktop:text-left")}>
<LocalizedText messageID="footer.license" />
</p>

<AppButton
theme="secondary"
size="small"
type="anchor"
href={Config.footerLinks.githubLink}
messageID="footer.github"
className={cn(
"text-sm",
"capitalize",
"leading-4",
"font-medium",
"text-app-darkgrey",
"m-3"
)}
/>
</div>
<div
className={cn(
"flex",
"justify-center",
"flex-col",
"items-center",
"my-3",
"desktop:px-3"
"mt-3",
"desktop:flex-row",
"desktop:mt-0"
)}
>
{Config.footerLinks.tokenLinks.map((token) => (
<AppButton
key={token.name}
theme="secondary"
size="small"
type="anchor"
href={token.link}
className={cn(
"text-sm",
"capitalize",
"leading-4",
"font-medium",
"text-app-darkgrey",
"m-0.5"
)}
>
{token.name}
</AppButton>
))}
</div>
{Config.footerLinks.contactSupport != null && (
<p
className={cn(
Config.footerLinks.tokenLinks.length <= 0 && "hidden"
)}
>
<LocalizedText messageID="footer.getToken" />
</p>
<div
className={cn(
"flex",
Expand All @@ -76,24 +72,55 @@ const Footer: React.FC = () => {
"desktop:px-3"
)}
>
<p className={cn("pr-3")}>
<LocalizedText messageID="footer.needHelp" />
</p>
<AppButton
messageID="footer.contactSupport"
theme="secondary"
size="small"
type="anchor"
href={Config.footerLinks.contactSupport}
{Config.footerLinks.tokenLinks.map((token) => (
<AppButton
key={token.name}
theme="secondary"
size="small"
type="anchor"
href={token.link}
className={cn(
"text-sm",
"capitalize",
"leading-4",
"font-medium",
"text-app-darkgrey",
"m-0.5"
)}
>
{token.name}
</AppButton>
))}
</div>
{Config.footerLinks.contactSupport != null && (
<div
className={cn(
"text-sm",
"leading-4",
"font-medium",
"text-app-darkgrey"
"flex",
"justify-center",
"items-center",
"my-3",
"desktop:px-3"
)}
/>
</div>
)}
>
<p className={cn("pr-3")}>
<LocalizedText messageID="footer.needHelp" />
</p>
<AppButton
messageID="footer.contactSupport"
theme="secondary"
size="small"
type="anchor"
href={Config.footerLinks.contactSupport}
className={cn(
"text-sm",
"leading-4",
"font-medium",
"text-app-darkgrey"
)}
/>
</div>
)}
</div>
</div>
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions react-app/src/config/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface ChainInfo {
}

interface FooterLinks {
githubLink: string;
tokenLinks: TokenLink[];
contactSupport?: string;
}
Expand Down Expand Up @@ -74,6 +75,7 @@ const defaultConfig: IConfig = {
authEndpoint: "http://localhost:8080/auth",
chainLinks: [],
footerLinks: {
githubLink: "https://github.com/likecoin/likedao",
tokenLinks: [
{
name: "osmosis",
Expand Down
5 changes: 3 additions & 2 deletions react-app/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}`",
Expand All @@ -239,7 +240,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...",
Expand Down
5 changes: 3 additions & 2 deletions react-app/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}`",
Expand All @@ -239,7 +240,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...",
Expand Down
2 changes: 1 addition & 1 deletion react-app/src/providers/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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` +
Expand Down

0 comments on commit 2c32bcf

Please sign in to comment.