diff --git a/.eslintrc.json b/.eslintrc.json index ebf25b4..c16df4f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -30,7 +30,6 @@ "alphabetize": { "order": "asc", "ignoreCase": true } } ], - "@next/next/no-img-element": "off", "@typescript-eslint/no-explicit-any": "off" } } diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 473feae..4cdac7c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,25 +1,85 @@ -name: deploy +# Sample workflow for building and deploying a Next.js site to GitHub Pages +# +# To get started with Next.js see: https://nextjs.org/docs/getting-started +# +name: Deploy Next.js site to Pages on: + # Runs on pushes targeting the default branch push: branches: - master + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: - deploy: + # Build job + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v3 - - name: Install Dependencies + - name: Detect package manager + id: detect-package-manager run: | - yarn + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + echo "runner=yarn" >> $GITHUB_OUTPUT + exit 0 - - name: Build - run: yarn build + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + cache: yarn + + - name: Setup Pages + uses: actions/configure-pages@v3 - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.1 + - name: Restore cache + uses: actions/cache@v3 with: - branch: release # The branch the action should deploy to. - folder: out # The folder the action should deploy + path: | + .next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + + - name: Install dependencies + run: yarn install + + - name: Build with Next.js + run: yarn next build + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./out + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/next.config.js b/next.config.js index f2dea91..1955c96 100644 --- a/next.config.js +++ b/next.config.js @@ -9,6 +9,10 @@ const withPWA = require("next-pwa")({ const nextConfig = withPWA({ output: "export", + basePath: "/frontend", + images: { + unoptimized: true, + }, eslint: { ignoreDuringBuilds: true, }, diff --git a/public/.nojekyll b/public/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/src/app/(public)/transacao/[transactionId]/TransactionInOut/index.tsx b/src/app/(public)/transacao/[transactionId]/TransactionInOut/index.tsx index ee63099..ee40a8b 100644 --- a/src/app/(public)/transacao/[transactionId]/TransactionInOut/index.tsx +++ b/src/app/(public)/transacao/[transactionId]/TransactionInOut/index.tsx @@ -3,6 +3,7 @@ import { budget, cards, categories } from "assets/data"; import { Icon } from "components/Icon"; import { useCurrentBudget } from "contexts/current-budget"; +import Image from "next/image"; import { CardTypeEnum } from "types/enums/card-type"; import { TransactionInOut as TransactionInOutType } from "types/transaction"; import { formatFullDate } from "utils/date"; @@ -34,7 +35,11 @@ const Card = ({ cardId }: { cardId: string }) => { Cartao
- + {card.name}
{card.name} diff --git a/src/components/Inputs/Select/index.tsx b/src/components/Inputs/Select/index.tsx index 09a6d0e..11656a4 100644 --- a/src/components/Inputs/Select/index.tsx +++ b/src/components/Inputs/Select/index.tsx @@ -1,9 +1,7 @@ -/* eslint-disable @next/next/no-img-element */ -/* eslint-disable @typescript-eslint/no-explicit-any */ - import { Listbox, Transition } from "@headlessui/react"; import { colors } from "assets/colors"; import { Icon } from "components/Icon"; +import Image from "next/image"; import React from "react"; import { Fragment } from "react"; import { BsFillCaretDownFill } from "react-icons/bs"; @@ -90,7 +88,7 @@ export function SelectInput>({ )} {fieldNames.iconUrl && ( - {selected[fieldNames.label]}>({ )} {fieldNames.iconUrl && d[fieldNames.iconUrl] && ( - {d[fieldNames.label]} { return (
- {label} + {label}
{name}