From 3be1255d750e0ce38744c1e31a070eeaecaea2b8 Mon Sep 17 00:00:00 2001 From: Lucas Pirola Date: Wed, 1 Dec 2021 18:18:11 -0300 Subject: [PATCH 1/2] fix: remove no longer needed call after upgrade nextjs Related issue: https://github.com/vercel/next.js/issues/9326 --- lib/withApollo.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/withApollo.tsx b/lib/withApollo.tsx index 1c7430b9..dd8d68a9 100644 --- a/lib/withApollo.tsx +++ b/lib/withApollo.tsx @@ -1,6 +1,5 @@ import React from "react"; // import App from 'next/app'; -import Head from "next/head"; import { ApolloProvider } from "@apollo/react-hooks"; import createApolloClient from "./apolloClient"; // import auth0 from './auth0'; @@ -150,9 +149,6 @@ export const withApollo = ({ ssr = true }: any = {}) => ( // https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error console.error("Error while running `getDataFromTree`", error); } - // getDataFromTree does not call componentWillUnmount - // head side effect therefore need to be cleared manually - Head.rewind(); } } From c56d99ceeefc52cc5c454d7191c31368ecac24ab Mon Sep 17 00:00:00 2001 From: Lucas Pirola Date: Wed, 1 Dec 2021 19:09:38 -0300 Subject: [PATCH 2/2] chore: fix lint; --- .drone.yml | 22 +++++++++++----------- components/Donation/DonationDrawer.tsx | 2 +- components/Employee/index.tsx | 2 +- components/Form/InputField.tsx | 2 +- components/Form/SelectField.tsx | 2 +- components/Form/SubmitFormEntry.tsx | 2 -- components/Navbar/Elements.tsx | 1 + components/Navbar/MenuItemsMobile.tsx | 1 - theme/Button.ts | 4 +++- theme/Heading.ts | 4 +++- theme/Input.ts | 4 +++- theme/Link.ts | 4 +++- theme/Menu.ts | 4 +++- theme/Select.ts | 4 +++- theme/Text.ts | 4 +++- theme/colors.ts | 4 +++- 16 files changed, 40 insertions(+), 26 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9fdd3ce0..51bdc8ff 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,23 +5,23 @@ pipeline: test: image: node:14-alpine environment: - - PORT = 3000 + - PORT=3000 - REDIS_URL=redis://127.0.0.1:6379 - ELASTIC_APM_SERVICE_NAME=nossas-org - ELASTIC_APM_SERVER_URL=http://localhost:9200 - ELASTIC_APM_SECRET_TOKEN=1111 - ELASTIC_APM_ACTIVE=false commands: - - apk --update add curl - - npm i - - npm run build - - npm run lint - - npm run test + - apk --update add curl + - yarn + - yarn run lint + - yarn run test + - yarn run build publish-staging-build: image: plugins/docker repo: nossas/nossas-org dockerfile: Dockerfile - secrets: [ docker_username, docker_password ] + secrets: [docker_username, docker_password] environment: - NEXT_PUBLIC_BONDE_API_GRAPHQL_URL=wss://api-graphql.staging.bonde.org/v1/graphql - NEXT_PUBLIC_DONATION_EN_WIDGET_ID=66736 @@ -79,7 +79,7 @@ pipeline: - NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - NODE_ENV dockerfile: Dockerfile - secrets: [ docker_username, docker_password ] + secrets: [docker_username, docker_password] group: builder tags: - ${DRONE_TAG##v} @@ -87,7 +87,7 @@ pipeline: when: status: success event: [tag] - + nossas-org-staging-deploy: image: peloton/drone-rancher url: http://cluster.bonde.org @@ -96,11 +96,11 @@ pipeline: docker_image: nossas/nossas-org:${DRONE_BRANCH/\//-} timeout: 360 confirm: true - secrets: [ rancher_access_key, rancher_secret_key ] + secrets: [rancher_access_key, rancher_secret_key] when: status: success event: [push] - + nossas-org-production-deploy: image: peloton/drone-rancher url: http://cluster.bonde.org diff --git a/components/Donation/DonationDrawer.tsx b/components/Donation/DonationDrawer.tsx index ba945563..0aa6debd 100644 --- a/components/Donation/DonationDrawer.tsx +++ b/components/Donation/DonationDrawer.tsx @@ -32,7 +32,7 @@ const Donation: React.FC = ({ }) => { const { isOpen, onOpen, onClose } = disclosureOpts; const btnRef = React.useRef(); - const t = (i18nKey: string, _?: any) => i18nKey; + // const t = (i18nKey: string, _?: any) => i18nKey; return (
diff --git a/components/Employee/index.tsx b/components/Employee/index.tsx index 4678ea92..03882ff3 100644 --- a/components/Employee/index.tsx +++ b/components/Employee/index.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Box, Stack, Heading, Text, SimpleGrid, Grid } from "@chakra-ui/react"; +import { Box, Stack, Heading, Text, Grid } from "@chakra-ui/react"; import { EmployeeItem } from "./EmployeeItem"; diff --git a/components/Form/InputField.tsx b/components/Form/InputField.tsx index e9d289fc..701528dc 100644 --- a/components/Form/InputField.tsx +++ b/components/Form/InputField.tsx @@ -37,7 +37,7 @@ const InputField: React.FC = ({ validate, ...props }) => { - const [field, meta, helpers] = useField({ name, validate }); + const [field, meta] = useField({ name, validate }); const borderStyles = { border: "1px solid", borderRadius: 4, diff --git a/components/Form/SelectField.tsx b/components/Form/SelectField.tsx index 827289ad..b5f9c72d 100644 --- a/components/Form/SelectField.tsx +++ b/components/Form/SelectField.tsx @@ -30,7 +30,7 @@ const SelectWidget: React.FC = ({ options: { items, type }, ...props }) => { - const [field, meta, helpers] = useField(name); + const [field, meta] = useField(name); let values = {}; if (type !== "object") items.forEach((v: string) => (values[v] = v)); diff --git a/components/Form/SubmitFormEntry.tsx b/components/Form/SubmitFormEntry.tsx index 28cc1b7a..42df6612 100644 --- a/components/Form/SubmitFormEntry.tsx +++ b/components/Form/SubmitFormEntry.tsx @@ -1,7 +1,5 @@ import React, { useState } from "react"; import { gql, useMutation } from "@apollo/client"; -import { Text } from "@chakra-ui/react"; -import SuccessPanel from "./SuccessPanel"; const CREATE_FORM_ENTRY_GQL = gql` mutation( diff --git a/components/Navbar/Elements.tsx b/components/Navbar/Elements.tsx index 3d8a15c1..d38bdf3c 100644 --- a/components/Navbar/Elements.tsx +++ b/components/Navbar/Elements.tsx @@ -8,6 +8,7 @@ export const Nav = ({ children }) => { const [offset, setOffset] = useState(0); const [scrollUp, setScrollUp] = useState(true); + console.log(offset); useEffect(() => { window.onscroll = () => { setOffset((oldOffset) => { diff --git a/components/Navbar/MenuItemsMobile.tsx b/components/Navbar/MenuItemsMobile.tsx index 8391ac07..dcbb2e70 100644 --- a/components/Navbar/MenuItemsMobile.tsx +++ b/components/Navbar/MenuItemsMobile.tsx @@ -4,7 +4,6 @@ import { AccordionItem, AccordionButton, AccordionPanel, - AccordionIcon, Box, Link as LinkStyled, Stack, diff --git a/theme/Button.ts b/theme/Button.ts index 5c087428..94d23f2e 100644 --- a/theme/Button.ts +++ b/theme/Button.ts @@ -3,7 +3,7 @@ const _disabled = { opacity: "1", }; -export default { +const _default = { baseStyle: { _focus: { boxShadow: "none", @@ -89,3 +89,5 @@ export default { variant: "solid", }, }; + +export default _default; diff --git a/theme/Heading.ts b/theme/Heading.ts index eb1fb264..3eb5f438 100644 --- a/theme/Heading.ts +++ b/theme/Heading.ts @@ -1,4 +1,4 @@ -export default { +const _default = { baseStyle: { fontWeight: 200, }, @@ -30,3 +30,5 @@ export default { size: "lg", }, }; + +export default _default; diff --git a/theme/Input.ts b/theme/Input.ts index 9abc531c..af4e71e6 100644 --- a/theme/Input.ts +++ b/theme/Input.ts @@ -1,4 +1,4 @@ -export default { +const _default = { variants: { outline: { field: { @@ -13,3 +13,5 @@ export default { }, }, }; + +export default _default; diff --git a/theme/Link.ts b/theme/Link.ts index 261aaa43..2cc3608c 100644 --- a/theme/Link.ts +++ b/theme/Link.ts @@ -1,4 +1,4 @@ -export default { +const _default = { baseStyle: { fontWeight: "bold", _focus: { @@ -47,3 +47,5 @@ export default { size: "md", }, }; + +export default _default; diff --git a/theme/Menu.ts b/theme/Menu.ts index 13e6f129..1079751e 100644 --- a/theme/Menu.ts +++ b/theme/Menu.ts @@ -4,7 +4,7 @@ const itemStyle = { color: "white !important", }; -export default { +const _default = { baseStyle: { list: { bg: "blue.main", @@ -24,3 +24,5 @@ export default { }, }, }; + +export default _default; diff --git a/theme/Select.ts b/theme/Select.ts index 9abc531c..af4e71e6 100644 --- a/theme/Select.ts +++ b/theme/Select.ts @@ -1,4 +1,4 @@ -export default { +const _default = { variants: { outline: { field: { @@ -13,3 +13,5 @@ export default { }, }, }; + +export default _default; diff --git a/theme/Text.ts b/theme/Text.ts index 7524b1cf..be7709b3 100644 --- a/theme/Text.ts +++ b/theme/Text.ts @@ -1,4 +1,4 @@ -export default { +const _default = { defaultStyles: { fontWeight: "normal", }, @@ -31,3 +31,5 @@ export default { size: "md", }, }; + +export default _default; diff --git a/theme/colors.ts b/theme/colors.ts index 949870dd..02867fe7 100644 --- a/theme/colors.ts +++ b/theme/colors.ts @@ -1,4 +1,4 @@ -export default { +const _default = { black: "#000000", white: "#FFFFFF", red: "#FF2B4E", @@ -20,3 +20,5 @@ export default { light: "#F10991", }, }; + +export default _default;