Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/template-retail-react-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v6.0.0 (TBD)
(Passwordless/Social PRs that will be unified when merging to develop)
- Add a "Back" button for Standard Login https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2208

## v5.1.0-dev (TBD)

- [BUG] Fixed "getCheckboxProps is not a function" when rendering checkout page in generated app.[#2140](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2140)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const PasswordlessLogin = ({
<StandardLogin
form={form}
handleForgotPasswordClick={handleForgotPasswordClick}
setShowPasswordView={setShowPasswordView}
hideEmail={true}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const StandardLogin = ({
handleForgotPasswordClick,
hideEmail = false,
isSocialEnabled = false,
setShowPasswordView,
idps = []
}) => {
return (
Expand All @@ -38,17 +39,32 @@ const StandardLogin = ({
>
<FormattedMessage defaultMessage="Sign In" id="login_form.button.sign_in" />
</Button>
{isSocialEnabled && idps.length > 0 && (
<>
<Divider />
<Text align="center" fontSize="sm">
<FormattedMessage
defaultMessage="Or Login With"
id="login_form.message.or_login_with"
/>
</Text>
<SocialLogin form={form} idps={idps} />
</>
<Stack spacing={4}>
{isSocialEnabled && idps.length > 0 && (
<>
<Divider />
<Text align="center" fontSize="sm">
<FormattedMessage
defaultMessage="Or Login With"
id="login_form.message.or_login_with"
/>
</Text>
<SocialLogin form={form} idps={idps} />
</>
)}
</Stack>
{hideEmail && (
<Button
onClick={() => setShowPasswordView(false)}
borderColor="gray.500"
color="blue.600"
variant="outline"
>
<FormattedMessage
defaultMessage="Back to Sign In Options"
id="login_form.button.back"
/>
</Button>
)}
</Stack>
</Stack>
Expand All @@ -60,6 +76,7 @@ StandardLogin.propTypes = {
handleForgotPasswordClick: PropTypes.func,
hideEmail: PropTypes.bool,
isSocialEnabled: PropTypes.bool,
setShowPasswordView: PropTypes.func,
idps: PropTypes.arrayOf(PropTypes.string)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('StandardLogin component', () => {

expect(screen.queryByLabelText('Email')).not.toBeInTheDocument()
expect(screen.getByLabelText('Password')).toBeInTheDocument()
expect(screen.getByRole('button', {name: 'Back to Sign In Options'})).toBeInTheDocument()
})

test('renders social login buttons', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2233,6 +2233,12 @@
"value": "Apple"
}
],
"login_form.button.back": [
{
"type": 0,
"value": "Back to Sign In Options"
}
],
"login_form.button.continue_securely": [
{
"type": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2233,6 +2233,12 @@
"value": "Apple"
}
],
"login_form.button.back": [
{
"type": 0,
"value": "Back to Sign In Options"
}
],
"login_form.button.continue_securely": [
{
"type": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4761,6 +4761,20 @@
"value": "]"
}
],
"login_form.button.back": [
{
"type": 0,
"value": "["
},
{
"type": 0,
"value": "Ɓȧȧƈķ ŧǿǿ Şīɠƞ Īƞ Ǿƥŧīǿǿƞş"
},
{
"type": 0,
"value": "]"
}
],
"login_form.button.continue_securely": [
{
"type": 0,
Expand Down
3 changes: 3 additions & 0 deletions packages/template-retail-react-app/translations/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,9 @@
"login_form.button.apple": {
"defaultMessage": "Apple"
},
"login_form.button.back": {
"defaultMessage": "Back to Sign In Options"
},
"login_form.button.continue_securely": {
"defaultMessage": "Continue Securely"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/template-retail-react-app/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,9 @@
"login_form.button.apple": {
"defaultMessage": "Apple"
},
"login_form.button.back": {
"defaultMessage": "Back to Sign In Options"
},
"login_form.button.continue_securely": {
"defaultMessage": "Continue Securely"
},
Expand Down
Loading