-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(home, planting): add AddTermsButtonComponent that wraps both a b…
…utton and a modal, use it also on planting page
- Loading branch information
1 parent
e915ab4
commit 52e9ca1
Showing
5 changed files
with
46 additions
and
34 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/app/home/add-terms-button/add-terms-button.component.ts
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,23 @@ | ||
import { ChangeDetectionStrategy, Component, signal } from '@angular/core'; | ||
|
||
import { IconComponent } from '../../ui/icon/icon'; | ||
import { AddTermsDialogComponent } from '../add-terms-dialog/add-terms-dialog.component'; | ||
|
||
@Component({ | ||
selector: 'app-add-terms-button', | ||
template: ` | ||
<button class="fixed bottom-16 right-6" title="Add" (click)="showAddTermsDialog.set(true)"> | ||
<app-icon class="size-10 text-action-primary" name="plusInCircle" /> | ||
</button> | ||
@if (showAddTermsDialog()) { | ||
<app-add-terms-dialog (close)="showAddTermsDialog.set(false)" /> | ||
} | ||
`, | ||
imports: [IconComponent, AddTermsDialogComponent], | ||
standalone: true, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class AddTermsButtonComponent { | ||
showAddTermsDialog = signal(false); | ||
} |
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