diff --git a/Dockerfile b/Dockerfile index 15161f7..78b2f69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Install dependencies only when needed -FROM node:14-alpine AS deps +FROM node:16-alpine AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat WORKDIR /app @@ -7,14 +7,14 @@ COPY package.json ./ RUN yarn install --frozen-lockfile # Rebuild the source code only when needed -FROM node:14-alpine AS builder +FROM node:16-alpine AS builder WORKDIR /app COPY . . COPY --from=deps /app/node_modules ./node_modules RUN yarn build # Production image, copy all the files and run next -FROM node:14-alpine AS runner +FROM node:16-alpine AS runner WORKDIR /app ENV NODE_ENV production diff --git a/components/Button.tsx b/components/Button.tsx index 2346a43..b9e53be 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -1,18 +1,36 @@ interface ButtonProps { text?: string, icon?: string, - onClick: () => void, + onClick?: () => void, + loading?: boolean, + type?: ButtonType, +} + +export enum ButtonType { + submit = 'submit', + button = 'button', } function Button(props: ButtonProps): JSX.Element { return ( ) diff --git a/components/Form.tsx b/components/Form.tsx index 059c93c..40500ef 100644 --- a/components/Form.tsx +++ b/components/Form.tsx @@ -13,7 +13,7 @@ import {getPayloadBodyFromFile, getPayloadBodyFromQR} from "../src/process"; import {PassData} from "../src/pass"; import {COLORS} from "../src/colors"; import Colors from './Colors'; -import Button from './Button'; +import Button, { ButtonType } from './Button'; function Form(): JSX.Element { const {t} = useTranslation(['index', 'errors', 'common']); @@ -274,19 +274,8 @@ function Form(): JSX.Element { .
-