From b9bb46c216e21f4ab52aa11ebd7e94643c48992e Mon Sep 17 00:00:00 2001 From: Mark Schill Date: Fri, 21 Nov 2025 00:19:49 -0600 Subject: [PATCH] Moving contact modal to components directory --- .../contact-modal/contact-modal.html | 55 +++++++++++++++++++ .../contact-modal/contact-modal.spec.ts | 23 ++++++++ .../components/contact-modal/contact-modal.ts | 26 +++++++++ 3 files changed, 104 insertions(+) create mode 100644 frontend/src/app/components/contact-modal/contact-modal.html create mode 100644 frontend/src/app/components/contact-modal/contact-modal.spec.ts create mode 100644 frontend/src/app/components/contact-modal/contact-modal.ts diff --git a/frontend/src/app/components/contact-modal/contact-modal.html b/frontend/src/app/components/contact-modal/contact-modal.html new file mode 100644 index 0000000..daf5632 --- /dev/null +++ b/frontend/src/app/components/contact-modal/contact-modal.html @@ -0,0 +1,55 @@ +
+
+ + +

+ Get In Touch +

+

+ Let's discuss your next project +

+ +
+
+ + +
+ +
+ + +
+ +
+ + + +
+ + +
+
+
\ No newline at end of file diff --git a/frontend/src/app/components/contact-modal/contact-modal.spec.ts b/frontend/src/app/components/contact-modal/contact-modal.spec.ts new file mode 100644 index 0000000..c0c4fb4 --- /dev/null +++ b/frontend/src/app/components/contact-modal/contact-modal.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ContactModal } from './contact-modal'; + +describe('ContactModal', () => { + let component: ContactModal; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ContactModal] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ContactModal); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/components/contact-modal/contact-modal.ts b/frontend/src/app/components/contact-modal/contact-modal.ts new file mode 100644 index 0000000..93d1014 --- /dev/null +++ b/frontend/src/app/components/contact-modal/contact-modal.ts @@ -0,0 +1,26 @@ +import { Component, model } from '@angular/core'; +import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; + +@Component({ + selector: 'app-contact-modal', + imports: [ReactiveFormsModule], + templateUrl: './contact-modal.html', + styles: ``, +}) +export class ContactModal { + open = model(false); + + contactForm = new FormGroup({ + name: new FormControl(''), + email: new FormControl('', Validators.email), + message: new FormControl(''), + }, { validators: Validators.required }) + + toggleOpen() { + this.open.update(value => !value); + } + + handleSubmit() { + alert(this.contactForm.value); + } +}