Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/ts-node-10.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
valerymelou committed Jul 25, 2024
2 parents 0559834 + d9b0fdb commit 3f0a689
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 23 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
on:
workflow_call:
repository_dispatch:
types: [publish-event]

jobs:
build:
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}
environment: ${{ (github.event.client_payload.env && github.event_name == 'repository_dispatch') && github.event.client_payload.env || (github.ref == 'refs/heads/master' && 'production' || 'staging') }}
env:
VM_CONTENTFUL_SPACE: ${{ secrets.VM_CONTENTFUL_SPACE }}
VM_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.VM_CONTENTFUL_ACCESS_TOKEN }}
VM_CONTENTFUL_ENVIRONMENT: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}
VM_CONTENTFUL_ENVIRONMENT: ${{ (github.event.client_payload.env && github.event_name == 'repository_dispatch') && github.event.client_payload.env || (github.ref == 'refs/heads/master' && 'production' || 'staging') }}
outputs:
ENVIRONMENT: ${{ env.VM_CONTENTFUL_ENVIRONMENT }}
steps:
Expand Down Expand Up @@ -95,3 +97,5 @@ jobs:
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
channelId: live
projectId: ${{ secrets.FIREBASE_PROJECT_ID }}
target: ${{ secrets.FIREBASE_SITE_TARGET }}

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
deploy:
if: >
(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || (github.event.pull_request.base.ref == 'develop' && github.event.pull_request.head.repo.full_name == github.repository))
(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || (github.event.pull_request.base.ref == 'develop' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login == 'valerymelou'))
needs: test
uses: ./.github/workflows/cd.yml
secrets: inherit
2 changes: 1 addition & 1 deletion libs/blog/feature-home/src/lib/blog-home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h2 class="text-xl lg:max-w-2xl">
</dl>
</div>
<a
class="text-accent-base group-hover:text-accent-base flex items-center text-sm dark:text-white dark:group-hover:text-white"
ui-link
[routerLink]="[
'/blog',
(article.createdAt | date: 'YYYY-MM-dd') + '-' + article.slug,
Expand Down
13 changes: 13 additions & 0 deletions libs/shared/layout/src/lib/logo/logo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<a href="/" class="relative flex items-center">
@if (loading) {
<div class="loader absolute"></div>
}

<img
src="/assets/images/valerymelou.jpg"
class="border-dark rounded-full border-2 dark:border-white"
alt="Valery Melou"
width="40"
height="40"
/>
</a>
21 changes: 21 additions & 0 deletions libs/shared/layout/src/lib/logo/logo.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LogoComponent } from './logo.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
143 changes: 143 additions & 0 deletions libs/shared/layout/src/lib/logo/logo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
NavigationEnd,
NavigationStart,
RouteConfigLoadEnd,
RouteConfigLoadStart,
Router,
} from '@angular/router';

@Component({
selector: 'app-logo',
standalone: true,
imports: [CommonModule],
templateUrl: './logo.component.html',
styles: `
/* HTML: <div class="loader"></div> */
.loader {
width: 40px;
aspect-ratio: 1;
border-radius: 50%;
border: 2px solid #3754ed;
animation:
l20-1 0.8s infinite linear alternate,
l20-2 1.6s infinite linear;
}
@keyframes l20-1 {
0% {
clip-path: polygon(
50% 50%,
0 0,
50% 0%,
50% 0%,
50% 0%,
50% 0%,
50% 0%
);
}
12.5% {
clip-path: polygon(
50% 50%,
0 0,
50% 0%,
100% 0%,
100% 0%,
100% 0%,
100% 0%
);
}
25% {
clip-path: polygon(
50% 50%,
0 0,
50% 0%,
100% 0%,
100% 100%,
100% 100%,
100% 100%
);
}
50% {
clip-path: polygon(
50% 50%,
0 0,
50% 0%,
100% 0%,
100% 100%,
50% 100%,
0% 100%
);
}
62.5% {
clip-path: polygon(
50% 50%,
100% 0,
100% 0%,
100% 0%,
100% 100%,
50% 100%,
0% 100%
);
}
75% {
clip-path: polygon(
50% 50%,
100% 100%,
100% 100%,
100% 100%,
100% 100%,
50% 100%,
0% 100%
);
}
100% {
clip-path: polygon(
50% 50%,
50% 100%,
50% 100%,
50% 100%,
50% 100%,
50% 100%,
0% 100%
);
}
}
@keyframes l20-2 {
0% {
transform: scaleY(1) rotate(0deg);
}
49.99% {
transform: scaleY(1) rotate(135deg);
}
50% {
transform: scaleY(-1) rotate(0deg);
}
100% {
transform: scaleY(-1) rotate(-135deg);
}
}
`,
})
export class LogoComponent {
loading = false;

constructor(router: Router) {
router.events.subscribe({
next: (event) => {
if (
event instanceof NavigationStart ||
event instanceof RouteConfigLoadStart
) {
this.loading = true;
} else if (
event instanceof NavigationEnd ||
event instanceof RouteConfigLoadEnd
) {
this.loading = false;
}
},
});
}
}
10 changes: 1 addition & 9 deletions libs/shared/layout/src/lib/navbar/navbar.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<div class="fixed left-0 right-0 top-0 z-10 flex p-5 lg:hidden">
<a href="/" class="flex items-center">
<img
src="/assets/images/valerymelou.jpg"
class="border-dark rounded-full border-2 dark:border-white"
alt="Valery Melou"
width="40"
height="40"
/>
</a>
<app-logo></app-logo>

<button
class="ml-auto items-center text-black dark:text-white"
Expand Down
2 changes: 2 additions & 0 deletions libs/shared/layout/src/lib/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {

import { MenuComponent, MenuTriggerForDirective } from '@valerymelou/shared/ui';
import { SocialLinksComponent } from '../social-links/social-links.component';
import { LogoComponent } from '../logo/logo.component';

interface NavbarLink {
label: string;
Expand All @@ -27,6 +28,7 @@ interface NavbarLink {
CommonModule,
RouterModule,
NgIconComponent,
LogoComponent,
MenuComponent,
MenuTriggerForDirective,
SocialLinksComponent,
Expand Down
10 changes: 1 addition & 9 deletions libs/shared/layout/src/lib/social-bar/social-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
'lg:dark:bg-dark bg-transparent px-4 lg:bg-white': !isHome,
}"
>
<a href="/" class="flex items-center">
<img
src="/assets/images/valerymelou.jpg"
class="border-dark rounded-full border-2 dark:border-white"
alt="Valery Melou"
width="40"
height="40"
/>
</a>
<app-logo></app-logo>

@if (!isHome) {
<a
Expand Down
2 changes: 2 additions & 0 deletions libs/shared/layout/src/lib/social-bar/social-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {

import { MenuComponent, MenuTriggerForDirective } from '@valerymelou/shared/ui';
import { SocialLinksComponent } from '../social-links/social-links.component';
import { LogoComponent } from '../logo/logo.component';

@Component({
selector: 'app-social-bar',
Expand All @@ -28,6 +29,7 @@ import { SocialLinksComponent } from '../social-links/social-links.component';
CommonModule,
RouterModule,
NgIconComponent,
LogoComponent,
MenuTriggerForDirective,
MenuComponent,
SocialLinksComponent,
Expand Down
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"@nx/angular:library": {
"linter": "eslint",
"unitTestRunner": "jest"
},
"@nx/angular:component": {
"style": "none"
}
},
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {
"@valerymelou/blog-tasks": ["libs/blog/tasks/src/index.ts"],
"@valerymelou/blog/article": ["libs/blog/feature-article/src/index.ts"],
"@valerymelou/blog/data-access": ["libs/blog/data-access/src/index.ts"],
"@valerymelou/blog/home": ["libs/blog/feature-home/src/index.ts"],
"@valerymelou/blog-tasks": ["libs/blog/tasks/src/index.ts"],
"@valerymelou/cms/contentful": ["libs/cms/contentful/src/index.ts"],
"@valerymelou/common/browser": ["libs/common/browser/src/index.ts"],
"@valerymelou/pages/about": ["libs/pages/about/src/index.ts"],
Expand Down

0 comments on commit 3f0a689

Please sign in to comment.