diff --git a/src/@chakra-ui/gatsby-plugin/theme.ts b/src/@chakra-ui/gatsby-plugin/theme.ts
index 63abf3595b3..d9b2b116818 100644
--- a/src/@chakra-ui/gatsby-plugin/theme.ts
+++ b/src/@chakra-ui/gatsby-plugin/theme.ts
@@ -1,8 +1,4 @@
-import {
- extendBaseTheme,
- type ThemeConfig,
- type ThemeOverride,
-} from "@chakra-ui/react"
+import { extendBaseTheme, type ThemeConfig } from "@chakra-ui/react"
// Global style overrides
import styles from "./styles"
@@ -27,7 +23,7 @@ const config: ThemeConfig = {
* The complete list of default Chakra styles can be found here:
* https://github.com/chakra-ui/chakra-ui/tree/main/packages/theme/src
*/
-const theme: ThemeOverride = {
+const theme = {
config,
styles,
...foundations,
diff --git a/src/components/Banners/Implementations/WritersCohortBanner.tsx b/src/components/Banners/Implementations/WritersCohortBanner.tsx
index a6423f217c3..87380b716bd 100644
--- a/src/components/Banners/Implementations/WritersCohortBanner.tsx
+++ b/src/components/Banners/Implementations/WritersCohortBanner.tsx
@@ -4,15 +4,20 @@ import { Text } from "@chakra-ui/react"
import DismissableBanner from "../DismissableBanner"
import Link from "../../Link"
+import { supportedLanguages } from "../../../utils/languages"
+
interface IProps {
pathname: string
}
const WritersCohortBanner: React.FC = ({ pathname }) => {
+ const pattern = supportedLanguages.join("|")
+ const strippedPathname = pathname.replace(new RegExp(`^/(${pattern})/`), "/")
+
if (
pathname.includes("contributing") ||
pathname.includes("community") ||
- pathname === "/"
+ strippedPathname === "/"
) {
return (
diff --git a/src/components/BeaconChainActions.tsx b/src/components/BeaconChainActions.tsx
index c11e2e1ff8e..026fae94968 100644
--- a/src/components/BeaconChainActions.tsx
+++ b/src/components/BeaconChainActions.tsx
@@ -118,11 +118,11 @@ const BeaconChainActions: React.FC = () => {
-
+
-
+
)
}
diff --git a/src/components/CardList.tsx b/src/components/CardList.tsx
index 789dc3f5f2a..b5f859ba7c7 100644
--- a/src/components/CardList.tsx
+++ b/src/components/CardList.tsx
@@ -26,7 +26,7 @@ export type CardListItem = {
}
export interface IProps extends BoxProps {
- content: Array
+ items: Array
clickHandler?: (idx: string | number) => void
}
@@ -92,12 +92,12 @@ const Card = (props: CardListItem & Omit) => {
}
const CardList: React.FC = ({
- content,
+ items,
clickHandler = () => null,
...rest
}) => (
- {content.map((listItem, idx) => {
+ {items.map((listItem, idx) => {
const { link, id } = listItem
const isLink = !!link
diff --git a/src/components/Codeblock.tsx b/src/components/Codeblock.tsx
index 809bf6cd81c..5d916ebd33f 100644
--- a/src/components/Codeblock.tsx
+++ b/src/components/Codeblock.tsx
@@ -204,7 +204,7 @@ export interface IProps {
allowCollapse?: boolean
codeLanguage: string
fromHomepage?: boolean
- children: React.ReactChild
+ children: React.ReactNode
}
const Codeblock: React.FC = ({
@@ -215,13 +215,16 @@ const Codeblock: React.FC = ({
}) => {
const selectedTheme = useColorModeValue(codeTheme.light, codeTheme.dark)
- const codeText = React.Children.map(children, (child) => {
- return getValidChildrenForCodeblock(child)
- }).join("")
+ const codeText = React.Children.toArray(children)
+ .map((child) => {
+ if (!child) return
+ return getValidChildrenForCodeblock(child)
+ })
+ .join("")
const [isCollapsed, setIsCollapsed] = useState(allowCollapse)
- let className
+ let className: string
if (React.isValidElement(children)) {
className = children?.props?.className
} else {
diff --git a/src/components/EnergyConsumptionChart.tsx b/src/components/EnergyConsumptionChart.tsx
index 70101737c89..e46c98dfbb7 100644
--- a/src/components/EnergyConsumptionChart.tsx
+++ b/src/components/EnergyConsumptionChart.tsx
@@ -1,9 +1,16 @@
import React from "react"
-import { Box, Center, useBreakpointValue, useToken } from "@chakra-ui/react"
+import {
+ Box,
+ Center,
+ chakra,
+ useBreakpointValue,
+ useToken,
+} from "@chakra-ui/react"
import {
BarChart,
Bar,
Cell,
+ Text,
XAxis,
LabelList,
ResponsiveContainer,
@@ -12,7 +19,6 @@ import {
import { useTranslation } from "gatsby-plugin-react-i18next"
import Translation from "./Translation"
-import Text from "./OldText"
interface ITickProps {
x: number
@@ -26,23 +32,43 @@ type Data = Array<{
color: string
}>
-const CustomTick: React.FC = ({ x, y, payload }) => {
- const textColor = useToken("colors", "text")
+const RechartText = chakra(Text, {
+ shouldForwardProp: (prop) => {
+ const isValidRechartProp = [
+ "width",
+ "children",
+ "x",
+ "y",
+ "dy",
+ "angle",
+ "scaleToFit",
+ "textAnchor",
+ "verticalAnchor",
+ "breakAll",
+ "maxLines",
+ ].includes(prop)
+ if (isValidRechartProp) return true
+
+ return false
+ },
+})
+
+const CustomTick: React.FC = ({ x, y, payload }) => {
return (
-
{payload.value}
-
+
)
}
@@ -175,8 +201,7 @@ const EnergyConsumptionChart: React.FC = () => {
dataKey="name"
tickLine={false}
axisLine={false}
- // @ts-ignore
- tick={}
+ tick={(props) => }
interval={0}
/>
-
+
@@ -167,7 +167,7 @@ const StablecoinAccordion: React.FC = () => {
-
+
@@ -193,7 +193,7 @@ const StablecoinAccordion: React.FC = () => {
-
+
@@ -237,7 +237,7 @@ const StablecoinAccordion: React.FC = () => {
-
+
diff --git a/src/components/Staking/StakingGuides.tsx b/src/components/Staking/StakingGuides.tsx
index af7a9d58ecd..059195c694e 100644
--- a/src/components/Staking/StakingGuides.tsx
+++ b/src/components/Staking/StakingGuides.tsx
@@ -2,7 +2,7 @@
import React from "react"
// Components
-import CardList from "../CardList"
+import CardList, { CardListItem } from "../CardList"
import { Stack } from "@chakra-ui/react"
import { useTranslation } from "gatsby-plugin-react-i18next"
@@ -10,7 +10,7 @@ export interface IProps {}
const StakingGuides: React.FC = () => {
const { t } = useTranslation()
- const guides = [
+ const guides: CardListItem[] = [
{
title: t("page-staking-guide-title-coincashew-ethereum"),
link: "https://www.coincashew.com/coins/overview-eth/guide-or-how-to-setup-a-validator-on-eth2-mainnet",
@@ -28,7 +28,7 @@ const StakingGuides: React.FC = () => {
},
]
- return
+ return
}
export default StakingGuides
diff --git a/src/content/translations/sl/nft/index.md b/src/content/translations/sl/nft/index.md
index 45e29de3f58..c32a223ad81 100644
--- a/src/content/translations/sl/nft/index.md
+++ b/src/content/translations/sl/nft/index.md
@@ -12,7 +12,7 @@ summaryPoint2: NFT-ji dajejo ustvarjalcem vsebin več moči, kot so jo imeli kad
summaryPoint3: Podprto s pametnimi pogodbami na Ethereumovi verigi blokov.
---
-## What are NFTs? {#what-are-nfts}
+## Kaj je NFT? {#what-are-nfts}
NFT-ji so žetoni, ki so individualno unikatni. Vsak NFT ima drugačne lastnosti (nezamenljive) in je dokazljivo redek. To je drugače od žetonov, kot so ERC-20, kjer je vsak žeton v setu identičen in ima enake lastnosti (je zamenljiv). Vseeno vam je, kateri specifični bankovec imate v denarnici, zato ker so vsi identični in imajo enako vrednost. Vendar, vam _je_ pomembno, kateri specifični NFT imate, saj imajo vsi svoje individualne lastnosti, s katerimi jih lahko ločite od drugih (so nezamenljivi).
diff --git a/src/data/NetworkUpgradeSummaryData.ts b/src/data/NetworkUpgradeSummaryData.ts
index a5a610a2752..7b6a4578b82 100644
--- a/src/data/NetworkUpgradeSummaryData.ts
+++ b/src/data/NetworkUpgradeSummaryData.ts
@@ -1,7 +1,7 @@
interface NetworkUpgradeProps {
- dateTimeAsString?: string
- ethPriceInUSD?: number
- waybackLink?: string
+ dateTimeAsString: string
+ ethPriceInUSD: number
+ waybackLink: string
blockNumber?: number
epochNumber?: number
slotNumber?: number
diff --git a/src/pages-conditional/dapps.tsx b/src/pages-conditional/dapps.tsx
index a9b583677e2..1b9c0cbb747 100644
--- a/src/pages-conditional/dapps.tsx
+++ b/src/pages-conditional/dapps.tsx
@@ -40,7 +40,7 @@ import FeedbackCard from "../components/FeedbackCard"
import Text from "../components/OldText"
import OldHeading from "../components/OldHeading"
import GlossaryTooltip from "../components/Glossary/GlossaryTooltip"
-import GatsbyImage from "../components/GatsbyImage"
+import GatsbyImage, { GatsbyImageType } from "../components/GatsbyImage"
import { getImage, getSrc } from "../utils/image"
import { trackCustomEvent } from "../utils/matomo"
@@ -129,7 +129,7 @@ const ButtonSecondary = (props: Pick) => (
)
-const MagiciansImage = () => (
+const MagiciansImage: GatsbyImageType = (props) => (
(
maxW="300px"
my="8"
mx={{ base: 0, sm: "8", md: "24" }}
+ {...props}
/>
)
@@ -1400,11 +1401,7 @@ const DappsPage = ({
{" "}
-
+
@@ -1525,7 +1522,7 @@ const DappsPage = ({
{" "}
-
+
@@ -1555,7 +1552,7 @@ const DappsPage = ({
{" "}
-
+
@@ -1661,7 +1658,11 @@ const DappsPage = ({
{" "}
-
+
@@ -1696,7 +1697,7 @@ const DappsPage = ({
{" "}
-
+
diff --git a/src/pages-conditional/eth.tsx b/src/pages-conditional/eth.tsx
index 501971e3711..3c4c1761255 100644
--- a/src/pages-conditional/eth.tsx
+++ b/src/pages-conditional/eth.tsx
@@ -555,7 +555,7 @@ const EthPage = (props: PageProps) => {
-
+
@@ -572,7 +572,7 @@ const EthPage = (props: PageProps) => {
-
+
diff --git a/src/pages-conditional/wallets.tsx b/src/pages-conditional/wallets.tsx
index f441b978e7f..e16ab923a06 100644
--- a/src/pages-conditional/wallets.tsx
+++ b/src/pages-conditional/wallets.tsx
@@ -259,7 +259,7 @@ const WalletsPage = ({
{" "}
-
+
@@ -449,7 +449,7 @@ const WalletsPage = ({
-
+
diff --git a/src/pages/bug-bounty.tsx b/src/pages/bug-bounty.tsx
index 1743c9a2717..cf0e49aac6d 100644
--- a/src/pages/bug-bounty.tsx
+++ b/src/pages/bug-bounty.tsx
@@ -581,7 +581,7 @@ const BugBountiesPage = ({
>
-
+
-
+
) => {
-
+
@@ -349,7 +349,7 @@ const GetETHPage = ({ data }: PageProps) => {
>
-
+
diff --git a/src/pages/staking/deposit-contract.tsx b/src/pages/staking/deposit-contract.tsx
index 365d435378f..537e5851b97 100644
--- a/src/pages/staking/deposit-contract.tsx
+++ b/src/pages/staking/deposit-contract.tsx
@@ -342,7 +342,7 @@ const DepositContractPage = ({
-
+
diff --git a/src/utils/image.ts b/src/utils/image.ts
index e264e679add..a3aa3ae3fda 100644
--- a/src/utils/image.ts
+++ b/src/utils/image.ts
@@ -28,7 +28,7 @@ const isFileNodeNull = (
* but it still does not accept null values which are generated by GraphQL Typegen
*/
export function getImage(
- node: ImageDataLike | null
+ node: ImageDataLike | null | undefined
): IGatsbyImageData | undefined {
if (!node) {
return
diff --git a/src/utils/mergeObjects.ts b/src/utils/mergeObjects.ts
index d6871238d44..9712361d4f3 100644
--- a/src/utils/mergeObjects.ts
+++ b/src/utils/mergeObjects.ts
@@ -1,5 +1,8 @@
// Wrapper on `Object.assign` to throw error if keys clash
-const mergeObjects = (target: T, newObject: U): T & U => {
+const mergeObjects = (
+ target: T,
+ newObject: U
+): T & U => {
const targetKeys = Object.keys(target)
for (const key of Object.keys(newObject)) {
if (targetKeys.includes(key)) {