Skip to content

Commit 9fae16d

Browse files
user pushed
1 parent ac07262 commit 9fae16d

15 files changed

+281
-66
lines changed

src/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const routes: Routes = [
2626
),
2727
},
2828
{
29-
path: 'user/username',
29+
path: 'users/:username',
3030
loadChildren: () =>
3131
import('./pages/user-profile/user-profile.module').then(
3232
(m) => m.UserProfileModule

src/app/pages/article-detail/user/user-detail/user-detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<aside>
22
<div class="aside-card">
33
<div class="aside-username">
4-
<a href="/{{user.username}}" class="flex">
4+
<a href="/users/{{user.username}}" class="flex">
55
<span class="aside-avatar">
66
<img [src]="user.profile_image" alt="" loading="lazy">
77
</span>

src/app/pages/home/articles/article-card/article-card.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { Component, Input, OnChanges, OnInit } from '@angular/core';
22
import { Article } from 'src/app/models/articles';
33

4+
import { NgModule } from '@angular/core';
5+
import { CommonModule } from '@angular/common';
6+
import { DateagoPipe } from 'src/app/global/pipes/dateago/dateago.pipe';
7+
import { RouterLink, RouterModule } from '@angular/router';
8+
49
@Component({
510
selector: 'app-article-card',
611
templateUrl: './article-card.component.html',
@@ -16,3 +21,10 @@ export class ArticleCardComponent implements OnChanges {
1621
this.article?.organization?.slug || this.article.user.username;
1722
}
1823
}
24+
25+
@NgModule({
26+
declarations: [ArticleCardComponent, DateagoPipe],
27+
imports: [CommonModule,RouterModule.forChild([])],
28+
exports: [ArticleCardComponent],
29+
})
30+
export class ArticleCardModule {}

src/app/pages/home/articles/article-card/article-card.module.ts

Whitespace-only changes.

src/app/pages/home/home.module.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import { SidebarTagsComponent } from './sidebar/sidebar-tags/sidebar-tags.compon
66
import { SidebarAdvertisementComponent } from './sidebar/sidebar-advertisement/sidebar-advertisement.component';
77
import { SidebarSocialLinksComponent } from './sidebar/sidebar-social-links/sidebar-social-links.component';
88
import { FeaturedArticleComponent } from './articles/featured-article/featured-article.component';
9-
import { ArticleCardComponent } from './articles/article-card/article-card.component';
9+
import { ArticleCardComponent, ArticleCardModule } from './articles/article-card/article-card.component';
1010
import { ArticleContainerComponent } from './articles/article-container/article-container.component';
1111
import { ArticleHeaderComponent } from './articles/article-header/article-header.component';
1212
import { HomeComponent } from './home.component';
1313
import { LetModule, PushModule } from '@rx-angular/template';
14-
import { DateagoPipe } from 'src/app/global/pipes/dateago/dateago.pipe';
1514
import { ListingsComponent } from './rightbar/listings/listings.component';
1615
import { RightbarContainerComponent } from './rightbar/rightbar-container/rightbar-container.component';
1716
import { TagArticleComponent } from './rightbar/tag-article/tag-article.component';
@@ -22,17 +21,17 @@ import { TagArticleComponent } from './rightbar/tag-article/tag-article.componen
2221
SidebarAdvertisementComponent,
2322
SidebarSocialLinksComponent,
2423
FeaturedArticleComponent,
25-
ArticleCardComponent,
2624
ArticleContainerComponent,
2725
ArticleHeaderComponent,
2826
HomeComponent,
29-
DateagoPipe,
27+
3028
ListingsComponent,
3129
RightbarContainerComponent,
3230
TagArticleComponent,
3331
],
3432
imports: [
3533
LetModule,
34+
ArticleCardModule,
3635
PushModule,
3736
CommonModule,
3837
RouterModule.forChild([

src/app/pages/home/sidebar/sidebar/sidebar.component.html

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -79,42 +79,6 @@
7979
Listings
8080
</a>
8181

82-
<a href="/pod" class="sidebar-nav-link">
83-
<span class="sidebar-link-icon">
84-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="24" height="24">
85-
<g class="nc-icon-wrapper">
86-
<path fill="#292F33"
87-
d="M10 19h24v2H10zm15 15c0 2.208-.792 4-3 4-2.209 0-3-1.792-3-4s.791-2 3-2c2.208 0 3-.208 3 2z">
88-
</path>
89-
<path fill="#66757F" d="M22 35c-6.627 0-10 1.343-10 3v2h20v-2c0-1.657-3.373-3-10-3z">
90-
</path>
91-
<path fill="#99AAB5" d="M22 4a9 9 0 00-9 9v7h18v-7a9 9 0 00-9-9z"></path>
92-
<g fill="#292F33" transform="translate(4 4)">
93-
<circle cx="15.5" cy="2.5" r="1.5"></circle>
94-
<circle cx="20.5" cy="2.5" r="1.5"></circle>
95-
<circle cx="17.5" cy="6.5" r="1.5"></circle>
96-
<circle cx="22.5" cy="6.5" r="1.5"></circle>
97-
<circle cx="12.5" cy="6.5" r="1.5"></circle>
98-
<circle cx="15.5" cy="10.5" r="1.5"></circle>
99-
<circle cx="10.5" cy="10.5" r="1.5"></circle>
100-
<circle cx="20.5" cy="10.5" r="1.5"></circle>
101-
<circle cx="25.5" cy="10.5" r="1.5"></circle>
102-
<circle cx="17.5" cy="14.5" r="1.5"></circle>
103-
<circle cx="22.5" cy="14.5" r="1.5"></circle>
104-
<circle cx="12.5" cy="14.5" r="1.5"></circle>
105-
</g>
106-
<path fill="#66757F" d="M13 19.062V21c0 4.971 4.029 9 9 9s9-4.029 9-9v-1.938H13z">
107-
</path>
108-
<path fill="#66757F"
109-
d="M34 18a1 1 0 00-1 1v2c0 6.074-4.925 11-11 11s-11-4.926-11-11v-2a1 1 0 00-2 0v2c0 7.18 5.82 13 13 13s13-5.82 13-13v-2a1 1 0 00-1-1z">
110-
</path>
111-
</g>
112-
</svg>
113-
114-
</span>
115-
Podcasts
116-
</a>
117-
11882
<a href="/videos" class="sidebar-nav-link">
11983
<span class="sidebar-link-icon">
12084
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="24" height="24">
@@ -152,12 +116,7 @@
152116
</span>
153117
Tags
154118
</a>
155-
156-
157-
<a *ngIf="!showMore" (click)="showMore=true" href="javascript:void(0)"
158-
class="more-link">More...</a>
159-
160-
<div *ngIf="showMore">
119+
<div>
161120
<a href="/code-of-conduct" class="sidebar-nav-link">
162121
<span class="sidebar-link-icon">
163122
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="24" height="24">
@@ -199,24 +158,6 @@
199158
FAQ
200159
</a>
201160

202-
<a href="https://shop.dev.to/" class="sidebar-nav-link">
203-
<span class="sidebar-link-icon">
204-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="24" height="24">
205-
<g class="nc-icon-wrapper">
206-
<path fill="#F4900C" d="M15 4a8 8 0 00-8 8v8h2v-8a6 6 0 0112 0v8h2v-8a8 8 0 00-8-8z">
207-
</path>
208-
<path fill="#DD2E44" d="M5 12l2 2 2-2 2 2 2-2 2 2 2-2 2 2 2-2 2 2 2-2v23H5z"></path>
209-
<path fill="#FFCC4D" d="M29 9a8 8 0 00-8 8v8h2v-8a6 6 0 0112 0v8h2v-8a8 8 0 00-8-8z">
210-
</path>
211-
<path fill="#744EAA" d="M19 17l2 2 2-2 2 2 2-2 2 2 2-2 2 2 2-2 2 2 2-2v23H19z">
212-
</path>
213-
</g>
214-
</svg>
215-
216-
</span>
217-
DEV Shop
218-
</a>
219-
220161
<a href="/sponsors" class="sidebar-nav-link">
221162
<span class="sidebar-link-icon">
222163
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="24" height="24">
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<header>
2+
<div class="profile-header">
3+
<span class="img-container">
4+
<img [src]="user.profile_image" class="crayons-avatar__image">
5+
</span>
6+
</div>
7+
8+
<div class="profile-header-details">
9+
<h1>{{user.name}}</h1>
10+
<p class="user-summary">{{user.summary}}</p>
11+
12+
<div class="profile-header-meta">
13+
<span class="item">
14+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" role="img"
15+
aria-labelledby="a3xkbc3f5m10eo7hk1nzp5q1qe2ucrgd" fill="currentColor">
16+
<title id="a3xkbc3f5m10eo7hk1nzp5q1qe2ucrgd">Location</title>
17+
<path d="M18.364 17.364L12 23.728l-6.364-6.364a9 9 0 1112.728 0zM12 13a2 2 0 100-4 2 2 0 000 4z">
18+
</path>
19+
</svg>
20+
21+
{{user.location}}
22+
</span>
23+
24+
<span class="item">
25+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" role="img"
26+
aria-labelledby="akim0j43z2hwtb3thdyfl4p0yzonmkz4" fill="currentColor">
27+
<title id="akim0j43z2hwtb3thdyfl4p0yzonmkz4">Joined</title>
28+
<path
29+
d="M8 6v3.999h3V6h2v3.999h3V6h2v3.999L19 10a3 3 0 012.995 2.824L22 13v1c0 1.014-.377 1.94-.999 2.645L21 21a1 1 0 01-1 1H4a1 1 0 01-1-1v-4.36a4.025 4.025 0 01-.972-2.182l-.022-.253L2 14v-1a3 3 0 012.824-2.995L5 10l1-.001V6h2zm11 6H5a1 1 0 00-.993.883L4 13v.971l.003.147a2 2 0 003.303 1.4c.363-.312.602-.744.674-1.218l.015-.153.005-.176c.036-1.248 1.827-1.293 1.989-.134l.01.134.004.147a2 2 0 003.992.031l.012-.282c.124-1.156 1.862-1.156 1.986 0l.012.282a2 2 0 003.99 0L20 14v-1a1 1 0 00-.883-.993L19 12zM7 1c1.32.871 1.663 2.088 1.449 2.888a1.5 1.5 0 11-2.898-.776C5.85 2.002 7 2.5 7 1zm5 0c1.32.871 1.663 2.088 1.449 2.888a1.5 1.5 0 01-2.898-.776C10.85 2.002 12 2.5 12 1zm5 0c1.32.871 1.663 2.088 1.449 2.888a1.5 1.5 0 01-2.898-.776C15.85 2.002 17 2.5 17 1z">
30+
</path>
31+
</svg>
32+
33+
Joined on&nbsp;
34+
<time datetime="2019-12-22T18:18:27Z" class="date">{{user.joined_at}}</time>
35+
</span>
36+
37+
<a [href]="user.website_url" target="_blank" rel="noopener me" class="item">
38+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" role="img"
39+
aria-labelledby="aebnezdzwf5e4o5wmaxg1njyfr0rjm7f" fill="currentColor">
40+
<title id="aebnezdzwf5e4o5wmaxg1njyfr0rjm7f">Personal website</title>
41+
<path
42+
d="M10 6v2H5v11h11v-5h2v6a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1h6zm11-3v8h-2V6.413l-7.793 7.794-1.414-1.414L17.585 5H13V3h8z">
43+
</path>
44+
</svg>
45+
46+
{{user.website_url}}
47+
</a>
48+
49+
<a href="https://github.com/{{user.github_username}}" target="_blank" rel="noopener me"
50+
class="item p-1">
51+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" role="img"
52+
aria-labelledby="alew5grzyihmlmjw8r3tn7d8qlmmfyuy" class="crayons-icon shrink-0">
53+
<title id="alew5grzyihmlmjw8r3tn7d8qlmmfyuy">github website</title>
54+
<path
55+
d="M12 2C6.475 2 2 6.475 2 12a9.994 9.994 0 006.838 9.488c.5.087.687-.213.687-.476 0-.237-.013-1.024-.013-1.862-2.512.463-3.162-.612-3.362-1.175-.113-.288-.6-1.175-1.025-1.413-.35-.187-.85-.65-.013-.662.788-.013 1.35.725 1.538 1.025.9 1.512 2.338 1.087 2.912.825.088-.65.35-1.087.638-1.337-2.225-.25-4.55-1.113-4.55-4.938 0-1.088.387-1.987 1.025-2.688-.1-.25-.45-1.275.1-2.65 0 0 .837-.262 2.75 1.026a9.28 9.28 0 012.5-.338c.85 0 1.7.112 2.5.337 1.912-1.3 2.75-1.024 2.75-1.024.55 1.375.2 2.4.1 2.65.637.7 1.025 1.587 1.025 2.687 0 3.838-2.337 4.688-4.562 4.938.362.312.675.912.675 1.85 0 1.337-.013 2.412-.013 2.75 0 .262.188.574.688.474A10.016 10.016 0 0022 12c0-5.525-4.475-10-10-10z">
56+
</path>
57+
</svg>
58+
59+
</a>
60+
<a href="https://twitter.com/{{user.twitter_username}}" target="_blank" rel="noopener me"
61+
class="item p-1">
62+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" role="img"
63+
aria-labelledby="ad10oxf6c94z8heubxzlzwcqvveec5dw" class="crayons-icon shrink-0">
64+
<title id="ad10oxf6c94z8heubxzlzwcqvveec5dw">twitter website</title>
65+
<path
66+
d="M22.162 5.656a8.383 8.383 0 01-2.402.658A4.196 4.196 0 0021.6 4c-.82.488-1.719.83-2.656 1.015a4.182 4.182 0 00-7.126 3.814 11.874 11.874 0 01-8.62-4.37 4.168 4.168 0 00-.566 2.103c0 1.45.738 2.731 1.86 3.481a4.168 4.168 0 01-1.894-.523v.052a4.185 4.185 0 003.355 4.101 4.211 4.211 0 01-1.89.072A4.185 4.185 0 007.97 16.65a8.395 8.395 0 01-6.191 1.732 11.83 11.83 0 006.41 1.88c7.693 0 11.9-6.373 11.9-11.9 0-.18-.005-.362-.013-.54a8.495 8.495 0 002.087-2.165l-.001-.001z"
67+
fill="#65bbf2"></path>
68+
</svg>
69+
70+
</a>
71+
</div>
72+
</div>
73+
</header>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
:host {
2+
display: block;
3+
padding: 1rem;
4+
padding-top: 2rem;
5+
margin: 0 auto;
6+
max-width: 1024px;
7+
}
8+
9+
header {
10+
border-radius: 5px;
11+
background: #fff;
12+
color: #08090a;
13+
box-shadow: 0 0 0 1px rgba(8, 9, 10, 0.1);
14+
overflow-wrap: anywhere;
15+
text-align: center;
16+
}
17+
18+
.profile-header {
19+
position: relative;
20+
}
21+
22+
img {
23+
padding: 0.5rem;
24+
width: 8rem;
25+
height: 8rem;
26+
border-radius: 100%;
27+
}
28+
29+
.profile-header-details {
30+
padding: 1.5rem;
31+
h1 {
32+
font-weight: 800;
33+
font-size: 1.875rem;
34+
margin-bottom: 0.5rem;
35+
}
36+
37+
.user-summary {
38+
font-size: 1.125rem;
39+
margin-bottom: 1rem;
40+
color: #202408;
41+
}
42+
}
43+
44+
.profile-header-meta {
45+
font-size: 0.875rem;
46+
color: #64707d;
47+
margin-bottom: 0.5rem;
48+
display: flex;
49+
flex-wrap: wrap;
50+
align-items: center;
51+
justify-content: center;
52+
gap: 1.5rem;
53+
.item {
54+
display: flex;
55+
align-items: center;
56+
}
57+
svg {
58+
margin-right: 0.5rem;
59+
}
60+
}
61+
62+
a {
63+
color: #64707d;
64+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { UserHeaderComponent } from './user-header.component';
4+
5+
describe('UserHeaderComponent', () => {
6+
let component: UserHeaderComponent;
7+
let fixture: ComponentFixture<UserHeaderComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ UserHeaderComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(UserHeaderComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component, Input, } from '@angular/core';
2+
import { UserDetails } from 'src/app/models/user';
3+
4+
@Component({
5+
selector: 'app-user-header',
6+
templateUrl: './user-header.component.html',
7+
styleUrls: ['./user-header.component.scss'],
8+
})
9+
export class UserHeaderComponent {
10+
@Input() user!: UserDetails;
11+
}

0 commit comments

Comments
 (0)