Skip to content

Commit e9240b2

Browse files
wlee221slaymance
andauthored
fix(angular,vue): remove floating border between transitions (#1937)
* Remove `Auth.signIn` from `confirmSignUp` service This should fail because we aren't setting intents yet. * Implement "autoSignIn" redirect intent * Fix incorrect json keys * Remove verification step in autoSignIn * Remove unused var * Add autoSignIn route * Add test for sms-mfa redirect after autosignin * Revert "Fix incorrect json keys" This reverts commit f0d954e. * Create eight-insects-mix.md * Create famous-vans-smile.md * Edit wording * Update eight-insects-mix.md * Update packages/ui/src/machines/authenticator/actors/signIn.ts Co-authored-by: Shane Laymance <[email protected]> * Add hasRouteComponent function * Use switch statement * Fix state -> actorState * Handle `signOut` too * Fix typo * Create twelve-suits-pump.md * Update twelve-suits-pump.md Co-authored-by: Shane Laymance <[email protected]>
1 parent 766bf30 commit e9240b2

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

.changeset/twelve-suits-pump.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@aws-amplify/ui-vue": patch
3+
"@aws-amplify/ui-angular": patch
4+
---
5+
6+
Removed floating border that appears between transitions in Vue and Angular Authenticator.

packages/angular/projects/ui-angular/src/lib/components/authenticator/components/authenticator/authenticator.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div
22
data-amplify-authenticator
33
[attr.data-variation]="variation"
4-
*ngIf="route !== 'authenticated'"
4+
*ngIf="hasRouteComponent()"
55
>
66
<div data-amplify-container>
77
<amplify-slot name="header" [context]="context"></amplify-slot>

packages/angular/projects/ui-angular/src/lib/components/authenticator/components/authenticator/authenticator.component.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,25 @@ export class AuthenticatorComponent
171171
}
172172

173173
public hasTabs() {
174-
const route = this.authenticator.route;
174+
const { route } = this.authenticator;
175175
return route === 'signIn' || route === 'signUp';
176176
}
177177

178+
public hasRouteComponent() {
179+
const { route } = this.authenticator;
180+
181+
switch (route) {
182+
case 'authenticated':
183+
case 'idle':
184+
case 'setup':
185+
case 'signOut':
186+
case 'autoSignIn':
187+
return false;
188+
default:
189+
return true;
190+
}
191+
}
192+
178193
private mapCustomComponents(
179194
componentQuery: QueryList<AmplifySlotDirective>
180195
): Record<string, TemplateRef<any>> {

packages/vue/src/components/authenticator.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,24 @@ const hasTabs = computed(() => {
242242
actorState.value?.matches('signIn') || actorState.value?.matches('signUp')
243243
);
244244
});
245+
246+
const hasRouteComponent = computed(() => {
247+
return !(
248+
state.value.matches('authenticated') ||
249+
state.value.matches('idle') ||
250+
state.value.matches('setup') ||
251+
state.value.matches('signOut') ||
252+
actorState.value?.matches('autoSignIn')
253+
);
254+
});
245255
</script>
246256

247257
<template>
248258
<div
249259
v-bind="$attrs"
250260
data-amplify-authenticator
251261
:data-variation="variation"
252-
v-if="!state?.matches('authenticated')"
262+
v-if="hasRouteComponent"
253263
>
254264
<div data-amplify-container>
255265
<slot name="header"> </slot>

0 commit comments

Comments
 (0)