Skip to content

Commit

Permalink
feat: add ads
Browse files Browse the repository at this point in the history
  • Loading branch information
FerranAD committed Jan 9, 2024
1 parent 75d361b commit 9160623
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 1 deletion.
Binary file added app/icons/ad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/src/app/components/banner-ad/banner-ad.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- banner-ad.component.html -->

<div class="banner-ad-container">
<img src="./icons/ad.png" alt="Banner Ad" class="banner-ad-image">
</div>
18 changes: 18 additions & 0 deletions app/src/app/components/banner-ad/banner-ad.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* banner-ad.component.css */

.banner-ad-container {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #f5f5f5;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin: auto; /* Center the container */
}

.banner-ad-image {
max-width: 100%;
height: auto;
border-radius: 5px;
}
24 changes: 24 additions & 0 deletions app/src/app/components/banner-ad/banner-ad.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';

import { BannerAdComponent } from './banner-ad.component';

describe('BannerAdComponent', () => {
let component: BannerAdComponent;
let fixture: ComponentFixture<BannerAdComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ BannerAdComponent ],
imports: [IonicModule.forRoot()]
}).compileComponents();

fixture = TestBed.createComponent(BannerAdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
});
});
21 changes: 21 additions & 0 deletions app/src/app/components/banner-ad/banner-ad.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// banner-ad.component.ts

import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-banner-ad',
templateUrl: './banner-ad.component.html',
styleUrls: ['./banner-ad.component.scss']
})
export class BannerAdComponent implements OnInit {

constructor() { }

ngOnInit(): void {

Check failure on line 14 in app/src/app/components/banner-ad/banner-ad.component.ts

View workflow job for this annotation

GitHub Actions / build

Lifecycle methods should not be empty
}

onButtonClick(): void {
// Handle button click event (you can add your logic here)
console.log('Button clicked! Redirect to the product page or perform other actions.');
}
}
3 changes: 2 additions & 1 deletion app/src/app/pages/reservations/reservations.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ReservationsPageRoutingModule } from './reservations-routing.module';
import { ReservationsPage } from './reservations.page';
import { TranslateModule } from '@ngx-translate/core';
import { ReservationsItemComponent } from '../../components/reservations-item/reservations-item.component';
import {BannerAdComponent} from "../../components/banner-ad/banner-ad.component";

@NgModule({
imports: [
Expand All @@ -18,7 +19,7 @@ import { ReservationsItemComponent } from '../../components/reservations-item/re
ReservationsPageRoutingModule,
TranslateModule,
],
declarations: [ReservationsPage, ReservationsItemComponent],
declarations: [ReservationsPage, ReservationsItemComponent, BannerAdComponent],
exports: [ReservationsItemComponent],
})
export class ReservationsPageModule {}
1 change: 1 addition & 0 deletions app/src/app/pages/reservations/reservations.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
></app-reservations-item>
</ion-item-group>
</ion-list>
<app-banner-ad></app-banner-ad>
</div>
</ion-content>

0 comments on commit 9160623

Please sign in to comment.