-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): improve redirect behavior after creating account
- Loading branch information
1 parent
e648a62
commit e69cf33
Showing
6 changed files
with
51 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@bigcommerce/catalyst-core": patch | ||
--- | ||
|
||
improve redirect behavior after creating account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { cache } from 'react'; | ||
|
||
import { client } from '~/client'; | ||
import { graphql } from '~/client/graphql'; | ||
import { revalidate } from '~/client/revalidate-target'; | ||
|
||
const storeNameQuery = graphql(` | ||
query storeNameQuery { | ||
site { | ||
settings { | ||
storeName | ||
} | ||
} | ||
} | ||
`); | ||
|
||
export const getStoreName = cache(async () => { | ||
const { data } = await client.fetch({ | ||
document: storeNameQuery, | ||
fetchOptions: { next: { revalidate } }, | ||
}); | ||
|
||
return data.site.settings?.storeName; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,7 +176,8 @@ | |
"recentlyViewed": "Recently viewed", | ||
"settings": "Account settings", | ||
"changePassword": "Change password", | ||
"editAddress": "Edit address" | ||
"editAddress": "Edit address", | ||
"successMessage": "Your account has been successfully created at {storeName}!" | ||
}, | ||
"Addresses": { | ||
"defaultAddress": "Default", | ||
|
@@ -261,7 +262,6 @@ | |
"submit": "Create account", | ||
"submitting": "Creating account...", | ||
"recaptchaText": "Pass ReCAPTCHA check", | ||
"successMessage": "Dear {firstName} {lastName}, your account was successfully created. Redirecting to account...", | ||
"stateProvincePrefix": "Choose state or province", | ||
"validationMessages": { | ||
"email": "Enter a valid email such as [email protected]", | ||
|