From b0112ae7db23ae11984115405013a86d6950c89e Mon Sep 17 00:00:00 2001 From: Gautam Jajoo Date: Thu, 9 Sep 2021 04:15:50 +0530 Subject: [PATCH] Frontend_V2: Add twitter feed section on homepage(#3282) * Add twitter section on homepage * remove load command * remove twitter-feed * add border and fix small screen * change the background color Co-authored-by: Rishabh Jain --- frontend_v2/package.json | 1 - .../app/components/home/home.component.html | 24 +++++++++++--- .../app/components/home/home.component.scss | 16 ++++++++++ .../components/home/home.component.spec.ts | 2 -- .../src/app/components/home/home.module.ts | 6 +--- .../twitter-feed/twitter-feed.component.html | 17 ---------- .../twitter-feed/twitter-feed.component.scss | 13 -------- .../twitter-feed.component.spec.ts | 30 ------------------ .../twitter-feed/twitter-feed.component.ts | 31 ------------------- frontend_v2/src/index.html | 1 + 10 files changed, 38 insertions(+), 103 deletions(-) delete mode 100644 frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.html delete mode 100644 frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.scss delete mode 100644 frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.spec.ts delete mode 100644 frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.ts diff --git a/frontend_v2/package.json b/frontend_v2/package.json index 6404e45c4d..e5fce4819e 100644 --- a/frontend_v2/package.json +++ b/frontend_v2/package.json @@ -42,7 +42,6 @@ "ngx-logger": "^4.1.9", "ngx-quill": "^6.3.1", "ngx-textarea-autosize": "^2.0.3", - "ngx-twitter-timeline": "^0.1.5", "normalize.css": "^8.0.0", "quill": "^1.3.7", "rxjs": "^6.5.2", diff --git a/frontend_v2/src/app/components/home/home.component.html b/frontend_v2/src/app/components/home/home.component.html index 808e1f55b1..c625d4a955 100644 --- a/frontend_v2/src/app/components/home/home.component.html +++ b/frontend_v2/src/app/components/home/home.component.html @@ -385,8 +385,22 @@

Partner Organizations

- + +
+
+
+

Twitter Feed

+
+ +
+
+ + +

Cite our work

@@ -410,7 +424,7 @@
-
+

Sponsors

@@ -429,8 +443,9 @@

Sponsors

+ -
+

Testimonials

@@ -460,8 +475,9 @@
{{ testimonialauthor}}
+ -
+

Subscribe to our newsletter

diff --git a/frontend_v2/src/app/components/home/home.component.scss b/frontend_v2/src/app/components/home/home.component.scss index f357a701ea..27f72359cc 100644 --- a/frontend_v2/src/app/components/home/home.component.scss +++ b/frontend_v2/src/app/components/home/home.component.scss @@ -6,6 +6,22 @@ margin-right: auto; } +.twitter-container { + text-align: center; + margin-left: 23%; + width: 55%; + box-shadow: 0px 0px 12px $shadow-black; + border: 1px solid; + border-radius: 5px; + color: rgb(101, 97, 97); +} + +@media (max-width: 400px) { + .grad-container { + padding: 25px 25px 25px 10px; + } +} + .org-logo { max-width: 100%; height: 120px; diff --git a/frontend_v2/src/app/components/home/home.component.spec.ts b/frontend_v2/src/app/components/home/home.component.spec.ts index a5c303bb68..a2a2f9aea6 100644 --- a/frontend_v2/src/app/components/home/home.component.spec.ts +++ b/frontend_v2/src/app/components/home/home.component.spec.ts @@ -13,7 +13,6 @@ import { HomemainComponent } from './homemain/homemain.component'; import { PartnersComponent } from './partners/partners.component'; import { RulesComponent } from './rules/rules.component'; import { FeaturedChallengesComponent } from './featured-challenges/featured-challenges.component'; -import { TwitterFeedComponent } from './twitter-feed/twitter-feed.component'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { WindowService } from '../../services/window.service'; @@ -34,7 +33,6 @@ describe('HomeComponent', () => { PartnersComponent, RulesComponent, FeaturedChallengesComponent, - TwitterFeedComponent, ], providers: [GlobalService, AuthService, ApiService, EndpointsService, WindowService], imports: [RouterTestingModule, HttpClientModule], diff --git a/frontend_v2/src/app/components/home/home.module.ts b/frontend_v2/src/app/components/home/home.module.ts index a0eb18c4cf..ab713a9fc2 100644 --- a/frontend_v2/src/app/components/home/home.module.ts +++ b/frontend_v2/src/app/components/home/home.module.ts @@ -1,13 +1,11 @@ import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { NgxTwitterTimelineModule } from 'ngx-twitter-timeline'; // import components import { FeaturedChallengesComponent } from './featured-challenges/featured-challenges.component'; import { HomemainComponent } from './homemain/homemain.component'; import { PartnersComponent } from './partners/partners.component'; import { RulesComponent } from './rules/rules.component'; -import { TwitterFeedComponent } from './twitter-feed/twitter-feed.component'; import { HomeComponent } from './home.component'; // import module @@ -17,16 +15,14 @@ import { HomeRoutingModule } from './home-routing.module'; @NgModule({ declarations: [ HomeComponent, - TwitterFeedComponent, PartnersComponent, RulesComponent, HomemainComponent, FeaturedChallengesComponent, ], - imports: [CommonModule, HomeRoutingModule, NgxTwitterTimelineModule, SharedModule], + imports: [CommonModule, HomeRoutingModule, SharedModule], exports: [ HomeComponent, - TwitterFeedComponent, PartnersComponent, RulesComponent, HomemainComponent, diff --git a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.html b/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.html deleted file mode 100644 index 73c4d27213..0000000000 --- a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.html +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.scss b/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.scss deleted file mode 100644 index 234af28c9e..0000000000 --- a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -@import './variables.scss'; -@import './mixins.scss'; - -.twitter-feed-container { - width: 100%; - a { - color: $blue-light; - font-size: $fs-24; - } - .hidden { - display: none; - } -} diff --git a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.spec.ts b/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.spec.ts deleted file mode 100644 index 818ef447fc..0000000000 --- a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TwitterFeedComponent } from './twitter-feed.component'; -import { WindowService } from '../../../services/window.service'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { MockWindowService } from '../../../services/mock.window.service'; - -describe('TwitterFeedComponent', () => { - let component: TwitterFeedComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - const MOCK_SERVICE = new MockWindowService(null); - TestBed.configureTestingModule({ - declarations: [TwitterFeedComponent], - providers: [{ provide: WindowService, useValue: MOCK_SERVICE }], - schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TwitterFeedComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.ts b/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.ts deleted file mode 100644 index ce507a669f..0000000000 --- a/frontend_v2/src/app/components/home/twitter-feed/twitter-feed.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import { DOCUMENT } from '@angular/common'; -import { WindowService } from '../../../services/window.service'; -/** - * Component Class - */ -@Component({ - selector: 'app-twitter-feed', - templateUrl: './twitter-feed.component.html', - styleUrls: ['./twitter-feed.component.scss'], -}) -export class TwitterFeedComponent implements OnInit { - /** - * Component Constructor - * @param windowService Window Service injection - * @param document Window document Injection. - */ - constructor(@Inject(DOCUMENT) private document: Document, private windowService: WindowService) {} - - /** - * Component on initialized - */ - ngOnInit() { - this.windowService.loadJS('https://platform.twitter.com/widgets.js', this.feedLoaded, this.document.body, this); - } - - /** - * Perform Operations when feed loaded - */ - feedLoaded(self) {} -} diff --git a/frontend_v2/src/index.html b/frontend_v2/src/index.html index 1ec0706840..372937d073 100644 --- a/frontend_v2/src/index.html +++ b/frontend_v2/src/index.html @@ -3,6 +3,7 @@ + EvalAI