-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/newsletter page #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marcin-hoa
wants to merge
5
commits into
main
Choose a base branch
from
feature/newsletter-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6431eb9
feat: wip
marcin-hoa 1851ce3
feat(newsletter): replaced content of newsletter-page and added name …
marcin-hoa 72d8e4b
feat: made the description text larger
marcin-hoa fc5e887
feat: added success case to newsletter-page component
marcin-hoa 766d70b
feat: removed px class in mobile view
marcin-hoa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
26 changes: 26 additions & 0 deletions
26
libs/blog/newsletter/feature-newsletter/src/lib/page/newsletter-page.component.html
This file contains hidden or 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,26 @@ | ||
@if (isConfirmationPage()) { | ||
<al-newsletter-success /> | ||
} @else { | ||
<ng-container *transloco="let t; read: 'newsletterPage'"> | ||
<h2 class="py-4 text-[40px] font-bold"> | ||
{{ t('title') }} | ||
</h2> | ||
|
||
<al-card> | ||
<section | ||
alCardContent | ||
aria-labelledby="angular-love" | ||
class="flex flex-col p-2 lg:flex-row" | ||
> | ||
<div class="mr-14 flex w-full flex-col items-center justify-center"> | ||
<p class="text-xl md:px-12">{{ t('description') }}</p> | ||
</div> | ||
<al-newsletter class="hidden lg:block" /> | ||
</section> | ||
</al-card> | ||
|
||
<al-card alGradientCard class="mt-6 block md:mt-8 lg:hidden"> | ||
<al-newsletter alCardContent /> | ||
</al-card> | ||
</ng-container> | ||
} |
56 changes: 25 additions & 31 deletions
56
libs/blog/newsletter/feature-newsletter/src/lib/page/newsletter-page.component.ts
This file contains hidden or 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 |
---|---|---|
@@ -1,43 +1,37 @@ | ||
import { A11yModule } from '@angular/cdk/a11y'; | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { RouterLink } from '@angular/router'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
computed, | ||
inject, | ||
} from '@angular/core'; | ||
import { toSignal } from '@angular/core/rxjs-interop'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { TranslocoDirective } from '@jsverse/transloco'; | ||
import { FastSvgComponent } from '@push-based/ngx-fast-svg'; | ||
|
||
import { AlLocalizePipe } from '@angular-love/blog/i18n/util'; | ||
import { ButtonComponent } from '@angular-love/blog/shared/ui-button'; | ||
import { CardComponent } from '@angular-love/blog/shared/ui-card'; | ||
|
||
import { NewsletterComponent } from '../feature-newsletter/newsletter.component'; | ||
|
||
import { NewsletterSuccesComponent } from './newsletter-succes/newsletter-succes.component'; | ||
|
||
@Component({ | ||
selector: 'al-newsletter-page', | ||
imports: [ | ||
RouterLink, | ||
ButtonComponent, | ||
TranslocoDirective, | ||
A11yModule, | ||
AlLocalizePipe, | ||
FastSvgComponent, | ||
CardComponent, | ||
NewsletterComponent, | ||
NewsletterSuccesComponent, | ||
], | ||
template: ` | ||
<div | ||
*transloco="let t; read: 'newsletterPage'" | ||
class="flex flex-col items-center justify-center py-5 text-center" | ||
[cdkTrapFocusAutoCapture]="true" | ||
cdkTrapFocus | ||
> | ||
<fast-svg name="circle-check" size="80" /> | ||
<h2 class="my-2 text-2xl font-bold"> | ||
{{ t('title') }} | ||
</h2> | ||
<p class="my-3"> | ||
{{ t('description') }} | ||
</p> | ||
<a [routerLink]="['/'] | alLocalize"> | ||
<button al-button type="button" cdkFocusInitial> | ||
{{ t('button') }} | ||
</button> | ||
</a> | ||
</div> | ||
`, | ||
templateUrl: './newsletter-page.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class NewsletterPageComponent {} | ||
export class NewsletterPageComponent { | ||
private route = inject(ActivatedRoute); | ||
private params = toSignal(this.route.queryParams); | ||
|
||
protected readonly isConfirmationPage = computed( | ||
() => this.params()?.['nm'] === 'confirmed', | ||
); | ||
} |
19 changes: 19 additions & 0 deletions
19
...letter/feature-newsletter/src/lib/page/newsletter-succes/newsletter-succes.component.html
This file contains hidden or 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,19 @@ | ||
<div | ||
*transloco="let t; read: 'newsletterPage'" | ||
class="flex flex-col items-center justify-center py-5 text-center" | ||
[cdkTrapFocusAutoCapture]="true" | ||
cdkTrapFocus | ||
> | ||
<fast-svg name="circle-check" size="80" /> | ||
<h2 class="my-2 text-2xl font-bold"> | ||
{{ t('success.title') }} | ||
</h2> | ||
<p class="my-3"> | ||
{{ t('success.description') }} | ||
</p> | ||
<a class="mt-4" [routerLink]="['/'] | alLocalize"> | ||
<button al-button type="button" cdkFocusInitial> | ||
{{ t('success.button') }} | ||
</button> | ||
</a> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
...wsletter/feature-newsletter/src/lib/page/newsletter-succes/newsletter-succes.component.ts
This file contains hidden or 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,23 @@ | ||
import { A11yModule } from '@angular/cdk/a11y'; | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { RouterLink } from '@angular/router'; | ||
import { TranslocoDirective } from '@jsverse/transloco'; | ||
import { FastSvgComponent } from '@push-based/ngx-fast-svg'; | ||
|
||
import { AlLocalizePipe } from '@angular-love/blog/i18n/util'; | ||
import { ButtonComponent } from '@angular-love/blog/shared/ui-button'; | ||
|
||
@Component({ | ||
selector: 'al-newsletter-success', | ||
imports: [ | ||
TranslocoDirective, | ||
A11yModule, | ||
FastSvgComponent, | ||
RouterLink, | ||
AlLocalizePipe, | ||
ButtonComponent, | ||
], | ||
templateUrl: './newsletter-succes.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class NewsletterSuccesComponent {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spelling error in template filename.
The template filename contains a spelling error:
newsletter-succes.component.html
should benewsletter-success.component.html
. This affects both the file reference and likely the actual filename.Apply this diff to fix the spelling:
Also ensure the actual template file is renamed accordingly.
📝 Committable suggestion
🤖 Prompt for AI Agents