Skip to content
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

Create search component #38

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions base-client/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ main {
}

.content-container {
margin-top: 24px;
max-width: calc(100vw - 32px);

@media (min-width: $breakpoint-tablet) {
margin-top: 33px;
max-width: calc(100vw - 50px);
}

@media (min-width: $breakpoint-desktop) {
margin-top: 64px;
margin-top: 32px;
max-width: calc(100vw - 191px);
}
}
4 changes: 4 additions & 0 deletions base-client/src/app/components/search/search.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="search-container">
<img class="search-icon" src="./assets/icon-search.svg" alt="Search icon">
<input class="search-box" type="search" placeholder="Search for movies or TV series">
</div>
53 changes: 53 additions & 0 deletions base-client/src/app/components/search/search.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@import "_variables";

.search-container {
background-color: $mango-semi-dark-blue;
box-shadow: 1px 0px 3px rgba(0, 0, 0, .2);
border-radius: 5px;
padding: 2px;
margin-bottom: 24px;

@media (min-width: $breakpoint-tablet) {
box-shadow: 3px 0px 3px rgba(0, 0, 0, .2);
}

@media (min-width: $breakpoint-desktop) {
padding: 4px;
}
}

.search-icon {
margin-right: 2px;
height: 24px;
width: 24px;

@media (min-width: $breakpoint-tablet) {
height: 28px;
width: 28px;
margin-left: 2px;
margin-bottom: 2px;
}

@media (min-width: $breakpoint-desktop) {
height: 32px;
width: 32px;
}
}

.search-box {
all: unset;
width: calc(100% - 28px);
text-align: center;
font-size: 16px;
margin-top: 2px;

@media (min-width: $breakpoint-tablet) {
font-size: 24px;
width: calc(100% - 34px);
}

@media (min-width: $breakpoint-desktop) {
width: calc(100% - 42px);
margin-top: 4px;
}
}
23 changes: 23 additions & 0 deletions base-client/src/app/components/search/search.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SearchComponent } from './search.component';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SearchComponent]
})
.compileComponents();

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions base-client/src/app/components/search/search.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-search',
standalone: true,
imports: [],
templateUrl: './search.component.html',
styleUrl: './search.component.scss'
})
export class SearchComponent {

}
1 change: 1 addition & 0 deletions base-client/src/app/pages/homepage/homepage.component.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<app-search />
<app-trending-section />
<app-regular-section sectionTitle="Recommended for you" [sectionData]="recommendedDataList" />
3 changes: 2 additions & 1 deletion base-client/src/app/pages/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { SelectionsService } from '../../lib/selections.service';
import { Subscription } from 'rxjs';
import { TrendingSectionComponent } from '../../components/trending-section/trending-section.component';
import { RegularSectionComponent } from '../../components/regular-section/regular-section.component';
import { SearchComponent } from '../../components/search/search.component';

@Component({
selector: 'app-homepage',
standalone: true,
imports: [AsyncPipe, TrendingSectionComponent, RegularSectionComponent],
imports: [AsyncPipe, SearchComponent, TrendingSectionComponent, RegularSectionComponent],
templateUrl: './homepage.component.html',
styleUrl: './homepage.component.scss',
})
Expand Down
Loading