From dbe43d648763e8eaee9ba1d40cc1f4b56e6607bc Mon Sep 17 00:00:00 2001 From: Marc Melchor Date: Wed, 1 Nov 2023 21:13:02 +0100 Subject: [PATCH 1/5] feat: Image optimization. --- src/app/Domain/state/cloth/cloth.effect.ts | 1 - src/app/UI/main/main.component.html | 8 ++++++-- src/app/UI/main/main.component.scss | 19 +++++++++++++++++++ src/app/UI/widgets/card/card.component.html | 8 +++++++- src/app/UI/widgets/card/card.component.scss | 13 +++++++++---- src/app/app.module.ts | 8 +++++--- src/index.html | 1 + 7 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/app/Domain/state/cloth/cloth.effect.ts b/src/app/Domain/state/cloth/cloth.effect.ts index 288cbc3..bc197b8 100644 --- a/src/app/Domain/state/cloth/cloth.effect.ts +++ b/src/app/Domain/state/cloth/cloth.effect.ts @@ -17,7 +17,6 @@ export class ClothEffect { .getSpreadsheet() .pipe( map((spreadsheetData: Spreadsheet) => { - console.log('xxxx', spreadsheetData); return ({ type: ClothActions.GET_CLOTHES, spreadsheet: spreadsheetData, diff --git a/src/app/UI/main/main.component.html b/src/app/UI/main/main.component.html index 97fe7e3..9a5f985 100644 --- a/src/app/UI/main/main.component.html +++ b/src/app/UI/main/main.component.html @@ -1,3 +1,7 @@ -
- +
+
+ +
diff --git a/src/app/UI/main/main.component.scss b/src/app/UI/main/main.component.scss index e69de29..858553e 100644 --- a/src/app/UI/main/main.component.scss +++ b/src/app/UI/main/main.component.scss @@ -0,0 +1,19 @@ +.container { + display: flex; + flex-direction: column; + align-items: center; + align-content: center; +} + +@media only screen and (min-width: 600px) { + .container { + display: grid; + grid-template-columns: repeat(2, 1fr); + + &--card { + display: flex; + align-items: center; + justify-content: center; + } + } +} diff --git a/src/app/UI/widgets/card/card.component.html b/src/app/UI/widgets/card/card.component.html index 6b7d4b9..45c68ff 100644 --- a/src/app/UI/widgets/card/card.component.html +++ b/src/app/UI/widgets/card/card.component.html @@ -1,7 +1,13 @@
- +

{{ data.cloth}}

diff --git a/src/app/UI/widgets/card/card.component.scss b/src/app/UI/widgets/card/card.component.scss index e93de2d..98742d3 100644 --- a/src/app/UI/widgets/card/card.component.scss +++ b/src/app/UI/widgets/card/card.component.scss @@ -13,10 +13,15 @@ $primary-violet: #7370F4; max-width: clamp(320px, 45vw, 740px); min-width: 320px; min-height: 280px; + margin-top: 10px; &:hover { box-shadow: rgba(0, 0, 0, 0.3) - 0px 5px 15px; + 0 5px 15px; + } + + &:last-child { + margin-bottom: 10px; } } @@ -37,9 +42,9 @@ $primary-violet: #7370F4; padding: 16px; &--h2 { - font-size: clamp (1.3rem, 2.5vw, 1.8rem); + font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 700; - margin-bottom: clamp (0.35rem, 2vw, 0.55rem); + margin-bottom: clamp(0.35rem, 2vw, 0.55rem); } &--p { @@ -54,7 +59,7 @@ $primary-violet: #7370F4; gap: 12px; flex-wrap: wrap; list-style-type: none; - padding: 12px 0px 16px 0px; + padding: 12px 0 16px 0; } .chip { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 76cd2ca..8ea39f4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -12,6 +12,7 @@ import { AppRoutingModule } from './app-routing.module'; import { CardComponent } from './UI/widgets/card/card.component'; import { ClothEffect } from './Domain/state/cloth/cloth.effect'; import { MainComponent } from './UI/main/main.component'; +import { NgOptimizedImage } from '@angular/common'; @NgModule({ declarations: [ @@ -20,12 +21,13 @@ import { MainComponent } from './UI/main/main.component'; MainComponent ], imports: [ - BrowserModule, AppRoutingModule, + BrowserModule, + EffectsModule.forRoot([ ClothEffect ]), HttpClientModule, + NgOptimizedImage, + StoreDevtoolsModule.instrument({ maxAge: 25, logOnly: !isDevMode() }), StoreModule.forRoot(appReducer, {}), - EffectsModule.forRoot([ ClothEffect ]), - StoreDevtoolsModule.instrument({ maxAge: 25, logOnly: !isDevMode() }) ], providers: [], bootstrap: [AppComponent] diff --git a/src/index.html b/src/index.html index e3666e4..339732d 100644 --- a/src/index.html +++ b/src/index.html @@ -6,6 +6,7 @@ + From 2cd3d910a728bfa9e383eec95d2fbf5925f91c22 Mon Sep 17 00:00:00 2001 From: Marc Melchor Date: Wed, 1 Nov 2023 21:16:21 +0100 Subject: [PATCH 2/5] fix: Github workflow. --- .github/workflows/deploy.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b88e583..7abc19b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,10 +12,10 @@ on: # A workflow run id made up one or more jobs that can run sequentially or in parallel jobs: build-and-deploy: - # The type of runner that the job will run on + # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job - steps: + # Steps represent a sequence of tasks that will be executed as part of the job + steps: # Checks-out your repository under $GITHUB_WORKSPACE, so the job can access it - name: Checkout uses: actions/checkout@v4.1.0 @@ -29,7 +29,7 @@ jobs: run: npm i # Build app por production - name: Build app bundle - run: npm run build:prod + run: npm run build #Replace the secret variables - name: Replace secret uses: cschleiden/replace-tokens@v1.2 @@ -49,7 +49,7 @@ jobs: build_dir: dist/clothes-catalog env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - - + + + + From a0049c6131209c8114b5d459113b1573bc100cf0 Mon Sep 17 00:00:00 2001 From: Marc Melchor Date: Wed, 1 Nov 2023 21:20:18 +0100 Subject: [PATCH 3/5] fix: Github workflow, create environment file. --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7abc19b..3b005f1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,9 +27,9 @@ jobs: # Install dependencies - name: Install Dependencies run: npm i - # Build app por production + # Build app por production and create environment file - name: Build app bundle - run: npm run build + run: npm run build && touch src/environments/environment.ts #Replace the secret variables - name: Replace secret uses: cschleiden/replace-tokens@v1.2 From 464a979592b579105b549a53414ceff9dadc0e91 Mon Sep 17 00:00:00 2001 From: Marc Melchor Date: Wed, 1 Nov 2023 21:33:24 +0100 Subject: [PATCH 4/5] fix: Github workflow, list files. --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3b005f1..32b329c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,7 +29,7 @@ jobs: run: npm i # Build app por production and create environment file - name: Build app bundle - run: npm run build && touch src/environments/environment.ts + run: npm run build && touch src/environments/environment.ts && ls #Replace the secret variables - name: Replace secret uses: cschleiden/replace-tokens@v1.2 From 6fd57b39d1adde3cc3d950c90aa10e977484fb59 Mon Sep 17 00:00:00 2001 From: Marc Melchor Date: Wed, 1 Nov 2023 21:35:39 +0100 Subject: [PATCH 5/5] fix: Github workflow, list files. --- .github/workflows/deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 32b329c..30dee19 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,12 +24,15 @@ jobs: uses: actions/setup-node@v3.8.1 with: node-version: "18" + # Create environment file + - name: Create environment file + run: touch src/environments/environment.ts # Install dependencies - name: Install Dependencies run: npm i # Build app por production and create environment file - name: Build app bundle - run: npm run build && touch src/environments/environment.ts && ls + run: npm run build #Replace the secret variables - name: Replace secret uses: cschleiden/replace-tokens@v1.2