Skip to content

Commit

Permalink
nodejs bump + next + antd bump
Browse files Browse the repository at this point in the history
  • Loading branch information
rostaklein committed Dec 27, 2023
1 parent b47d5bf commit 0d68113
Show file tree
Hide file tree
Showing 8 changed files with 2,900 additions and 11,569 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Modern order management system built with the latest tech stack.

## Requirements

- installed [Node.js v16](https://nodejs.org/en/download/) (includes NPM)
- installed [Node.js v20](https://nodejs.org/en/download/) (includes NPM)
- basic knowledge of [Git](https://git-scm.com/downloads)
- [MongoDB](https://www.mongodb.com/atlas) url (recommended hosting on MongoDB Atlas - free tier is enough)

Expand Down
9 changes: 9 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ const { i18n } = require("./next-i18next.config");

module.exports = {
i18n,
transpilePackages: [
"rc-util",
"@ant-design",
"antd",
"rc-pagination",
"rc-picker",
"rc-tree",
"rc-table",
],
};
14,423 changes: 2,868 additions & 11,555 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mayoor",
"description": "",
"engines": {
"node": "^16.0.0"
"node": "20.x"
},
"scripts": {
"dev": "next dev",
Expand Down Expand Up @@ -45,9 +45,11 @@
"tsconfig-paths": "^4.1.0"
},
"dependencies": {
"@ant-design/cssinjs": "^1.18.2",
"@ant-design/icons": "^5.2.6",
"@apollo/client": "^3.6.9",
"@prisma/client": "^3.15.2",
"antd": "^4.22.7",
"antd": "^5.12.5",
"apollo-server-micro": "^3.10.1",
"bcrypt": "^5.0.1",
"cookies-next": "^2.1.1",
Expand All @@ -59,7 +61,7 @@
"i18next-localstorage-backend": "^3.1.3",
"jsonwebtoken": "^9.0.2",
"micro": "^9.4.1",
"next": "^12.2.5",
"next": "^14.0.4",
"next-i18next": "^12.0.0",
"nexus": "^1.3.0",
"nexus-prisma": "^0.35.0",
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslation, appWithTranslation } from "next-i18next";
import { Alert, message } from "antd";
import { AppProps } from "next/app";

import "antd/dist/antd.css";
import "antd/dist/reset.css";
import "@client/index.css";

import nextI18nConfig from "../next-i18next.config";
Expand Down
10 changes: 9 additions & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
import Document, { Head, Html, Main, NextScript } from "next/document";
import { ServerStyleSheet } from "styled-components";
import { createCache, extractStyle, StyleProvider } from "@ant-design/cssinjs";

export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const cache = createCache();
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;

try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) =>
sheet.collectStyles(<App {...props} />),
sheet.collectStyles(
<StyleProvider cache={cache}>
<App {...props} />
</StyleProvider>
),
});

// @ts-ignore
const initialProps = await Document.getInitialProps(ctx);
const style = extractStyle(cache, true);
return {
...initialProps,
styles: (
<>
{initialProps.styles}
<style dangerouslySetInnerHTML={{ __html: style }} />
{sheet.getStyleElement()}
</>
),
Expand Down
13 changes: 6 additions & 7 deletions src/client/components/MainMenu/LinkItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from "next/link";

import { Colors } from "../../themeVariables";

const MenuLinkItem = styled.a`
const MenuLinkItem = styled(Link)`
width: 100%;
display: flex;
align-items: center;
Expand All @@ -16,6 +16,7 @@ const MenuLinkItem = styled.a`
border-right: solid transparent 5px;
transition: all 0.2s;
color: ${Colors.DARK_GRAY3};
font-size: 14px;
&.active {
background: ${Colors.LIGHT_GRAY4};
border-color: ${Colors.BLUE4};
Expand All @@ -38,11 +39,9 @@ interface Props {

export const LinkItem: React.FC<Props> = ({ icon, name, to }) => {
return (
<Link href={to} passHref>
<MenuLinkItem href={to} data-test-id={`menu-link-item-${to}`}>
{icon}
{name}
</MenuLinkItem>
</Link>
<MenuLinkItem href={to} data-test-id={`menu-link-item-${to}`}>
{icon}
{name}
</MenuLinkItem>
);
};

0 comments on commit 0d68113

Please sign in to comment.