Skip to content

Commit

Permalink
feat(planting): remove old new seed component
Browse files Browse the repository at this point in the history
  • Loading branch information
artaommahe committed Aug 25, 2024
1 parent 7ada708 commit e915ab4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 120 deletions.
3 changes: 0 additions & 3 deletions src/app/planting/new-seed/assets/input.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/app/planting/new-seed/assets/multiline-input.svg

This file was deleted.

107 changes: 0 additions & 107 deletions src/app/planting/new-seed/new-seed.component.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/app/planting/planting-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/cor

import { BarnService } from '../barn/barn.service';
import { DialogComponent } from '../ui/dialog/dialog.component';
import { NewSeedComponent } from './new-seed/new-seed.component';
import { SeedDetailsComponent, type SeedDetailsSeed } from './seed-details/seed-details.component';
import { SeedsListComponent } from './seeds-list/seeds-list.component';

@Component({
selector: 'app-planting-page',
template: `
<div class="flex flex-col gap-4">
<app-new-seed (addSeeds)="onAddSeeds($event)" />
<app-seeds-list [seeds]="seeds() ?? []" (showDetails)="seedDetails.set($event)" />
@if (seedDetails(); as seed) {
Expand All @@ -25,7 +23,7 @@ import { SeedsListComponent } from './seeds-list/seeds-list.component';
}
</div>
`,
imports: [NewSeedComponent, SeedsListComponent, SeedDetailsComponent, DialogComponent],
imports: [SeedsListComponent, SeedDetailsComponent, DialogComponent],
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand All @@ -35,10 +33,6 @@ export class PlantingPageComponent {
seeds = this.barnService.seeds;
seedDetails = signal<SeedDetailsSeed | null>(null);

onAddSeeds(names: string[]) {
this.barnService.addSeeds(names);
}

onRemoveSeed(name: string) {
this.barnService.removeSeed(name);
this.seedDetails.set(null);
Expand Down

0 comments on commit e915ab4

Please sign in to comment.