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

Feat/faq #63

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 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
19 changes: 19 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FaqComponent } from '@pages/faq/faq.component';
import { MainComponent } from '@pages/main/main.component';

const routes: Routes = [
{ path: '', component: MainComponent },
{ path: 'faq', component: FaqComponent },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FAQ module can be built in a lazy way

{
path: '**',
redirectTo: '',
},
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}
7 changes: 1 addition & 6 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
gdColumns.xs="100% 100% "
>
<ngcommunity-header gdArea="header"></ngcommunity-header>
<ngcommunity-main
*ngIf="(communitie$ | async) as communities"
gdArea="main"
[communities]="communities"
>
</ngcommunity-main>
<router-outlet></router-outlet>
</div>
<ngcommunity-footer></ngcommunity-footer>
6 changes: 1 addition & 5 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ import { CommunityService } from '@shared/services';
selector: 'ngcommunity-root',
templateUrl: './app.component.html',
})
export class AppComponent {
communitie$ = this.communityService.communities;

constructor(private communityService: CommunityService) {}
}
export class AppComponent {}
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { PagesModule } from './pages/pages.module';
import { SharedModule } from './shared/shared.module';
import { RouterModule } from '@angular/router';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';

@NgModule({
declarations: [AppComponent],
Expand All @@ -15,8 +15,8 @@ import { environment } from '../environments/environment';
SharedModule,
PagesModule,
HttpClientModule,
RouterModule.forRoot([]),
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
AppRoutingModule,
],
providers: [],
bootstrap: [AppComponent],
Expand Down
24 changes: 24 additions & 0 deletions src/app/pages/faq/faq.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
h6 {
color: #c10707;
font-size: 20px;
}

a {
color: #c10707;
}

.text-container {
margin-left: 15%;
margin-right: 15%;
color: #333;
}

.text-content {
font-weight: 400;
line-height: 1.5;
font-size: 16px;
}

.question {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make the design responsive

margin: 20px;
}
60 changes: 60 additions & 0 deletions src/app/pages/faq/faq.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<div class="text-container">
<div class="text-content">
<div class="question">
<h6>What is Angular-Communities?</h6>
<p>
Angular-communities in an initiative born in Málaga, Spain. It started as a small
open-source project built by four Angular devs from Málaga (see about us for more info) who
aimed to create a space where every single Angular community out there could be found and
located on the world map. This way, the visibility of all the Angular communities around the
world is increased, which is always a good thing! As more and more community members started
to show interest in Angular-Communities, our small project began to grow. Our goal now is to
create a space where all information regarding Angular can be found: communities,
conferences, events...
</p>
</div>
<div class="question">
<h6>I host an Angular community, can I add it to Angular-Communities?</h6>
<p>Of course! We're looking forwards to adding your community.</p>
</div>
<div class="question">
<h6>Can Angular conferences/events like ngSpain, ngConf etc. be added too?</h6>
<p>
We're working on also adding all the Angular events! Would you like to help us out? You can
find more information
<a target="_blank" href="https://github.com/voidcosmos/angular-communities/issues/42"
>here</a
>.
</p>
</div>
<div class="question">
<h6>How do I add my community to Angular-Communities?</h6>
<p>
All you need to do is open a PR, filling in the required fields with the information about
your community. We'll review it, and if all is well, your community will be added! For more
info, see
<a target="_blank" href="https://github.com/voidcosmos/angular-communities"
>the Angular-Communities README.</a
>
</p>
</div>
<div class="question">
<h6>Can I participate in the Angular-Communities project?</h6>
<p>
Of course you can! Any help at all is very welcome. See the following question for
information on how to contribute.
</p>
</div>
<div class="question">
<h6>How can I contribute to the Angular-Communities project?</h6>
<p>
You can find all the information related to contributing
<a
target="_blank"
href="https://github.com/voidcosmos/angular-communities/blob/master/.github/CONTRIBUTING.md"
>here</a
>.
</p>
</div>
</div>
</div>
8 changes: 8 additions & 0 deletions src/app/pages/faq/faq.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Component } from "@angular/core";

@Component({
selector: "app-faq",
templateUrl: "./faq.component.html",
styleUrls: ["./faq.component.css"]
})
export class FaqComponent {}
14 changes: 14 additions & 0 deletions src/app/pages/faq/faq.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '@shared/shared.module';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FaqComponent } from './faq.component';

const COMPONENTS = [FaqComponent];

@NgModule({
declarations: [COMPONENTS],
imports: [CommonModule, SharedModule, FlexLayoutModule],
exports: [COMPONENTS],
})
export class FaqModule {}
1 change: 1 addition & 0 deletions src/app/pages/main/main.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
gdColumns.xs="100% auto"
gdRows.xs="35% 65%"
fxFlexFill
*ngIf="communitie$ | async as communities"
>
<ngcommunity-map
gdArea="map"
Expand Down
19 changes: 13 additions & 6 deletions src/app/pages/main/main.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ActivatedRoute, Router } from '@angular/router';
import { Community, Communities } from '@shared/interfaces';
import { Community } from '@shared/interfaces';
import { Component, Input } from '@angular/core';
import { map } from 'rxjs/operators';
import { map, withLatestFrom } from 'rxjs/operators';
import { CommunityService } from '@shared/services';

@Component({
selector: 'ngcommunity-main',
Expand All @@ -10,11 +11,17 @@ import { map } from 'rxjs/operators';
})
export class MainComponent {
@Input()
communities: Communities;
communitie$ = this.communityService.communitie$;
community$ = this.route.fragment.pipe(
withLatestFrom(this.communitie$),
map(([community, communities]) => communities[community]),
);

community$ = this.route.fragment.pipe(map(community => this.communities[community]));

constructor(private router: Router, private route: ActivatedRoute) {}
constructor(
private router: Router,
private route: ActivatedRoute,
private communityService: CommunityService,
) {}

changeCommunity(community?: Community) {
this.router.navigate([], {
Expand Down
3 changes: 2 additions & 1 deletion src/app/pages/pages.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { NgModule } from '@angular/core';

import { MainModule } from './main/main.module';
import { FaqModule } from './faq/faq.module';
import { SharedModule } from '../shared/shared.module';

@NgModule({
declarations: [],
imports: [SharedModule, MainModule],
imports: [SharedModule, MainModule, FaqModule],
providers: [],
exports: [MainModule],
})
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
alt="Angular communities logo"
src="assets/images/angular-communities-logo_md.png"
/>
<span>ANGULAR COMMUNITIES</span>
<a routerLink="">ANGULAR COMMUNITIES</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏

</div>
<div>
<a class="menu" routerLink="/faq">FAQ</a>
<a
href="https://www.github.com/voidcosmos/angular-communities"
target="_blank"
Expand Down
5 changes: 5 additions & 0 deletions src/app/shared/components/header/header.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ img {
width: 40px;
height: 40px;
}

a {
padding: 12px 10px;
}

.social-button--github {
margin: 0px;
width: 40px;
Expand Down
13 changes: 7 additions & 6 deletions src/app/shared/services/community.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Communities } from '@shared/interfaces';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { map, shareReplay } from 'rxjs/operators';

@Injectable({
providedIn: 'root',
Expand All @@ -12,11 +12,12 @@ export class CommunityService {

constructor(private httpClient: HttpClient) {}

get communities(): Observable<Communities> {
return this.httpClient
.get<Communities>(this.JSON_COMMUNITIES)
.pipe(map(communities => this.normalizeCommunities(communities)));
}
communitie$: Observable<Communities> = this.httpClient
.get<Communities>(this.JSON_COMMUNITIES)
.pipe(
map(communities => this.normalizeCommunities(communities)),
shareReplay(1),
);

private normalizeCommunities(communities: Communities): Communities {
const communitiesNormalized = Object.entries(communities)
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatToolbarModule } from '@angular/material/toolbar';
import { NgModule } from '@angular/core';
import { ScrollingModule } from '@angular/cdk/scrolling';
import { RouterModule } from '@angular/router';

const CORE_MODULES = [BrowserAnimationsModule, CommonModule, FormsModule, ReactiveFormsModule];

Expand All @@ -49,7 +50,7 @@ const MATERIAL_MODULES = [

@NgModule({
declarations: COMPONENTS,
imports: [MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule],
imports: [MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule, RouterModule],
exports: [COMPONENTS, MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule],
})
export class SharedModule {}