Skip to content

Commit

Permalink
Merge pull request #157 from forbole/upgrade-deps
Browse files Browse the repository at this point in the history
chore: upgrade dependencies
  • Loading branch information
icfor authored Dec 22, 2023
2 parents 5d5e02c + e737917 commit 770b6a5
Show file tree
Hide file tree
Showing 41 changed files with 677 additions and 475 deletions.
45 changes: 34 additions & 11 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
const path = require("node:path");

const paddingLineBetweenStatements = [
"error",
{ blankLine: "always", prev: "*", next: "return" },
]
.concat(
[
"multiline-block-like",
"multiline-expression",
"multiline-const",
"const",
"type",
"interface",
"if",
]
.map((item) => [
{ blankLine: "always", prev: item, next: "*" },
{ blankLine: "always", prev: "*", next: item },
])
.flat(),
)
.concat([
{
blankLine: "any",
prev: ["singleline-const"],
next: ["singleline-const"],
},
]);

module.exports = {
env: {
browser: true,
Expand Down Expand Up @@ -39,24 +67,19 @@ module.exports = {
"prefer-template": "error",
"quote-props": ["error", "consistent-as-needed"],

"@stylistic/padding-line-between-statements": [
"error",
{ blankLine: "always", prev: "*", next: "return" },
].concat(
["multiline-block-like", "multiline-expression", "multiline-const"]
.map((item) => [
{ blankLine: "always", prev: item, next: "*" },
{ blankLine: "always", prev: "*", next: item },
])
.flat(),
),
"@stylistic/padding-line-between-statements": paddingLineBetweenStatements,

"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-var-requires": "off",

"react/destructuring-assignment": [
"error",
"always",
{ destructureInSignature: "always" },
],
"react/function-component-definition": "off",
"react/jsx-boolean-value": "error",
"react/jsx-filename-extension": "off",
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.0",
"@mui/lab": "^5.0.0-alpha.156",
"@mui/material": "^5.15.0",
"@mui/icons-material": "^5.15.1",
"@mui/lab": "^5.0.0-alpha.157",
"@mui/material": "^5.15.1",
"@n8tb1t/use-scroll-position": "^2.0.3",
"@next/bundle-analyzer": "^14.0.4",
"@socialgouv/matomo-next": "^1.8.0",
Expand All @@ -38,22 +38,22 @@
"dotenv-defaults": "^5.0.2",
"framer-motion": "^10.16.16",
"graphql": "^16.8.1",
"isomorphic-dompurify": "^1.12.0",
"isomorphic-dompurify": "^1.13.0",
"jsdom": "^23.0.1",
"markdown-to-jsx": "^7.3.2",
"million": "^2.6.4",
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
"next": "^14.0.3",
"next": "^14.0.4",
"next-sitemap": "^4.2.3",
"next-translate": "^2.6.2",
"next-translate-plugin": "^2.6.2",
"nodemailer": "^6.7.5",
"nodemailer": "^6.9.7",
"ramda": "^0.29.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-toastify": "^9.1.3",
"sharp": "^0.33.0",
"sharp": "^0.33.1",
"swiper": "^6.8.4",
"validator": "^13.11.0"
},
Expand All @@ -64,17 +64,17 @@
"@stylistic/eslint-plugin": "^1.5.1",
"@svgr/webpack": "^8.1.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^20.10.4",
"@types/node": "^20.10.5",
"@types/nodemailer": "^6.4.14",
"@types/ramda": "^0.29.9",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@types/react-dom": "^18.2.18",
"@types/rss": "^0.0.32",
"@types/validator": "^13.11.7",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"eslint-plugin-playwright": "^0.20.0",
"husky": "^8.0.3",
Expand All @@ -88,7 +88,7 @@
"stylelint-order": "^6.0.4",
"stylelint-scss": "^6.0.0",
"ts-unused-exports": "^10.0.1",
"tsx": "^4.6.2",
"tsx": "^4.7.0",
"typed-scss-modules": "^8.0.0",
"typescript": "^5.3.3"
},
Expand Down
1 change: 1 addition & 0 deletions src/components/Carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type CarouselProps = {

const Carousel = ({ personList }: CarouselProps) => {
let usedList: PersonInfo[] | undefined = personList;

const { t } = useTranslation("common");

if (!personList) {
Expand Down
1 change: 1 addition & 0 deletions src/components/cardSwiper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Arraw, { Direction } from "../arrow";
import { BoxCSS } from "./BoxCSS";

SwiperCore.use([Navigation]);

type Props = {
imagesList: string[];
style?: CSSProperties;
Expand Down
90 changes: 40 additions & 50 deletions src/components/intro_card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,48 @@ type Props = {
disabled?: boolean;
};

const IntroCard = (props: Props) => {
const {
title,
desc,
list,
imageHref = "",
btnName,
disabled,
btnClick,
} = props;

return (
<Box className={styles.wrapper} component="div">
<Box className={styles.imageWrapper}>
{imageHref && (
<Image
alt={title ? `${title} image` : ""}
className={styles.image}
fill
src={imageHref}
/>
)}
</Box>
<Box className={styles.contentWrapper} component="div">
<Box>
<Typography className={styles.title}>{title}</Typography>
const IntroCard = ({
title,
desc,
list,
imageHref = "",
btnName,
disabled,
btnClick,
}: Props) => (
<Box className={styles.wrapper} component="div">
<Box className={styles.imageWrapper}>
{imageHref && (
<Image
alt={title ? `${title} image` : ""}
className={styles.image}
fill
src={imageHref}
/>
)}
</Box>
<Box className={styles.contentWrapper} component="div">
<Box>
<Typography className={styles.title}>{title}</Typography>

{typeof desc && (
<Typography className={styles.desc}>{desc}</Typography>
)}
<ul style={{ listStyle: "none" }}>
{list?.map((item, index) => (
<Typography
className={styles.listItem}
component="li"
key={index}
>
{item}
</Typography>
))}
</ul>
</Box>
<CtaButton
className={styles.ctaButton}
disabled={disabled}
onClick={btnClick}
>
{btnName}
</CtaButton>
{typeof desc && <Typography className={styles.desc}>{desc}</Typography>}
<ul style={{ listStyle: "none" }}>
{list?.map((item, index) => (
<Typography className={styles.listItem} component="li" key={index}>
{item}
</Typography>
))}
</ul>
</Box>
<CtaButton
className={styles.ctaButton}
disabled={disabled}
onClick={btnClick}
>
{btnName}
</CtaButton>
</Box>
);
};
</Box>
);

export default IntroCard;
3 changes: 3 additions & 0 deletions src/components/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ const Layout = ({
const router = useRouter();
const currentPath = router.asPath === "/" ? "/" : `${router.asPath}`;
const url = process.env.NEXT_PUBLIC_URL;

let ogImage = image ?? `${url}/static/icons/favicon-96x96.png`;
let metaTwitterImage = twitterImage ?? ogImage;

const baseKeywords = ["Forbole", "blockchain", "social network"];
const formattedKeyworks = uniq(concat(keywords, baseKeywords));

Expand All @@ -65,6 +67,7 @@ const Layout = ({
useEffect(() => {
if (blueBg) {
const currentColor = document.body.style.background;

document.body.style.background = "rgb(23, 26, 75)";

return () => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/layout_val/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ const LayoutVal = ({
const { t } = useTranslation("staking");
const currentPath = router.asPath === "/" ? "/" : `${router.asPath}`;
const url = process.env.NEXT_PUBLIC_URL;

let ogImage = image ?? `${url}/static/icons/favicon-96x96.png`;
let metaTwitterImage = twitterImage ?? ogImage;

const baseKeywords = ["Forbole", "blockchain", "social network"];
const formattedKeyworks = uniq(concat(keywords, baseKeywords));

Expand Down
3 changes: 1 addition & 2 deletions src/components/tags/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ interface TagsProps {
noPadding?: boolean;
}

const Tags = (props: TagsProps) => {
const Tags = ({ tags, details, noPadding }: TagsProps) => {
const { t } = useTranslation("blog");
const theme = useTheme();
const { tags, details, noPadding } = props;

if (!tags?.length) return null;

Expand Down
2 changes: 2 additions & 0 deletions src/pages/blog/[title]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export const getStaticProps: GetStaticProps<
> = async (context) => {
try {
const { params } = context;

if (!params) throw new Error("No params");

const { title } = params;

const post = await getSinglePost(title);
Expand Down
1 change: 1 addition & 0 deletions src/pages/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export async function getServerSideProps(context: { query: any }) {
try {
const { query } = context;
const fetchQuery: any = {};

let posts: any = [];

if (query.page) {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/staking/[title]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export const getStaticProps: GetStaticProps<

try {
const { params } = context;

if (!params) throw new Error("No params");

const { title } = params;
const post = await getSinglePost(title);

Expand Down
1 change: 0 additions & 1 deletion src/screens/analytics_tools/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const AnalyticsTools = () => {
</Grid>
</Grid>
</Stack>

<Section
desc={t("big_dipper")}
title={t("customizable")}
Expand Down
8 changes: 5 additions & 3 deletions src/screens/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ interface MyAppProps extends AppProps {
const MATOMO_URL = process.env.NEXT_PUBLIC_MATOMO_URL;
const MATOMO_SITE_ID = process.env.NEXT_PUBLIC_MATOMO_SITE_ID;

export default function MyApp(props: MyAppProps) {
const { Component, emotionCache = clientSideEmotionCache, pageProps } = props;

export default function MyApp({
Component,
emotionCache = clientSideEmotionCache,
pageProps,
}: MyAppProps) {
useEffect(() => {
init({
url: MATOMO_URL,
Expand Down
3 changes: 1 addition & 2 deletions src/screens/app/innerApp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import "react-toastify/dist/ReactToastify.css";

import { lightTemplate } from "@src/styles";

const InnerApp = (props: any) => {
const { pageProps, Component } = props;
const InnerApp = ({ pageProps, Component }: any) => {
const muiTheme = createTheme(lightTemplate);

return (
Expand Down
4 changes: 2 additions & 2 deletions src/screens/author/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type Props = {
tags: any;
};

const AuthorTitlePosts = (props: Props) => {
const AuthorTitlePosts = ({ post, tags, author, meta }: Props) => {
const { t } = useTranslation("blog");
const { post, tags, author, meta } = props;

const { featureImage, excerpt, error } = post;

useBlogHook(error, t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import useHKT from "@src/hooks/useHKT";

import * as styles from "./index.module.scss";

const Post = (props: any) => {
const Post = ({ post, main = false, refProp }: any) => {
const { t } = useTranslation("blog");
const { isDesktop, isMobile } = useWindowDimensions();
const { post, main = false, refProp } = props;

const { featureImage, title, excerpt, publishedAt, slug, author } = post;

const cmsLoader = ({ src, width, quality }: any) =>
Expand Down
9 changes: 7 additions & 2 deletions src/screens/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ import TitlePosts from "./components/title_posts";
import { useBlogHook } from "./hooks";
import * as styles from "./index.module.scss";

const Blog = (props: any) => {
const { posts = [], meta = {}, tags = [], sidePosts = [], error } = props;
const Blog = ({
posts = [],
meta = {},
tags = [],
sidePosts = [],
error,
}: any) => {
const { t } = useTranslation("blog");
const topRef = useRef(null);

Expand Down
Loading

0 comments on commit 770b6a5

Please sign in to comment.