Skip to content

Commit 5202158

Browse files
Merge remote-tracking branch 'upstream/dev' into refactor/what-is-ethereum-shadcn
2 parents d40bbe4 + f04e8de commit 5202158

File tree

69 files changed

+4464
-1998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4464
-1998
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
// Other relative imports. Put same-folder imports and `.` last.
4343
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
4444
// Style imports.
45-
["^.+s?css$"],
45+
["^.+\\.s?css$"],
4646
// Side effect imports.
4747
["^\\u0000"]
4848
]

public/content/contributing/translation-program/content-buckets/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ Below is a breakdown of the website pages each content bucket contains.
178178
- [Programming languages](/developers/docs/programming-languages/)
179179
- [Delphi](/developers/docs/programming-languages/delphi/)
180180
- [.NET](/developers/docs/programming-languages/dot-net/)
181+
- [Elixir](/developers/docs/programming-languages/elixir/)
181182
- [Golang](/developers/docs/programming-languages/golang/)
182183
- [Java](/developers/docs/programming-languages/java/)
183184
- [JavaScript](/developers/docs/programming-languages/javascript/)

public/content/contributing/translation-program/translatathon/details/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ EthStaker
123123
- https://crowdin.com/project/ethstaker-website
124124
- https://crowdin.com/project/ethstaker-knowledge-base
125125

126+
Solidity Language Docs
127+
- https://crowdin.com/project/solidity-language-docs
128+
126129
### Evaluation process
127130

128131
All translations will be subject to QA and feedback, where professional linguists will evaluate submissions based on quality and accuracy.

public/content/developers/docs/gas/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Layer 2 scaling is a primary initiative to greatly improve gas costs, user exper
124124
If you want to monitor gas prices, so you can send your ETH for less, you can use many different tools such as:
125125

126126
- [Etherscan](https://etherscan.io/gastracker) _Transaction gas price estimator_
127+
- [ETH Gas Tracker](https://www.ethgastracker.com/) _Monitor and track the Ethereum, and L2 gas prices to reduce transaction fees and save money_
127128
- [Blocknative ETH Gas Estimator](https://chrome.google.com/webstore/detail/blocknative-eth-gas-estim/ablbagjepecncofimgjmdpnhnfjiecfm) _Gas estimating Chrome extension supporting both Type 0 legacy transactions and Type 2 EIP-1559 transactions._
128129
- [Cryptoneur Gas Fees Calculator](https://www.cryptoneur.xyz/gas-fees-calculator) _Calculate gas fees in your local currency for different transaction types on Mainnet, Arbitrum, and Polygon._
129130

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Ethereum for Elixir Developers
3+
description: Learn how to develop for Ethereum using Elixir-based projects and tooling.
4+
lang: en
5+
incomplete: false
6+
---
7+
8+
<FeaturedText>Learn how to develop for Ethereum using Elixir-based projects and tooling.</FeaturedText>
9+
10+
Use Ethereum to create decentralized applications (or "dapps") that utilize the benefits of cryptocurrency and blockchain technology. These dapps can be trustless, meaning that once they are deployed to Ethereum, they will always run as programmed. They can control digital assets to create new kinds of financial applications. They can be decentralized, meaning that no single entity or person controls them and are nearly impossible to censor.
11+
12+
## Getting started with smart contracts and the Solidity language {#getting-started-with-smart-contracts-and-solidity}
13+
14+
**Take your first steps to integrating Elixir with Ethereum**
15+
16+
Need a more basic primer first? Check out [ethereum.org/learn](/learn/) or [ethereum.org/developers](/developers/).
17+
18+
- [Blockchain Explained](https://kauri.io/article/d55684513211466da7f8cc03987607d5/blockchain-explained)
19+
- [Understanding Smart Contracts](https://kauri.io/article/e4f66c6079e74a4a9b532148d3158188/ethereum-101-part-5-the-smart-contract)
20+
- [Write your First Smart Contract](https://kauri.io/article/124b7db1d0cf4f47b414f8b13c9d66e2/remix-ide-your-first-smart-contract)
21+
- [Learn How to Compile and Deploy Solidity](https://kauri.io/article/973c5f54c4434bb1b0160cff8c695369/understanding-smart-contract-compilation-and-deployment)
22+
23+
## Beginner articles {#beginner-articles}
24+
25+
- [Finally understanding Ethereum accounts](https://dev.to/q9/finally-understanding-ethereum-accounts-1kpe)
26+
- [Ethers — A first-class Ethereum Web3 library for Elixir](https://medium.com/@alisinabh/announcing-ethers-a-first-class-ethereum-web3-library-for-elixir-1d64e9409122)
27+
28+
## Intermediate articles {#intermediate-articles}
29+
30+
- [How to sign raw Ethereum contract transactions with Elixir](https://kohlerjp.medium.com/how-to-sign-raw-ethereum-contract-transactions-with-elixir-f8822bcc813b)
31+
- [Ethereum Smart Contracts and Elixir](https://medium.com/agile-alpha/ethereum-smart-contracts-and-elixir-c7c4b239ddb4)
32+
33+
## Elixir projects and tools {#elixir-projects-and-tools}
34+
35+
### Active {#active}
36+
37+
- [block_keys](https://github.com/ExWeb3/block_keys) - _BIP32 & BIP44 Implementation in Elixir (Multi-Account Hierarchy for Deterministic Wallets)_
38+
- [ethereumex](https://github.com/mana-ethereum/ethereumex) - _Elixir JSON-RPC client for the Ethereum blockchain_
39+
- [ethers](https://github.com/ExWeb3/elixir_ethers) - _A comprehensive Web3 library for interacting with smart contracts on Ethereum using Elixir_
40+
- [ethers_kms](https://github.com/ExWeb3/elixir_ethers_kms) - _A KMS signer library for Ethers (sign transactions with AWS KMS)_
41+
- [ex_abi](https://github.com/poanetwork/ex_abi) - _Ethereum ABI parser/decoder/encoder implementation in Elixir_
42+
- [ex_keccak](https://github.com/ExWeb3/ex_keccak) - _Elixir library for computing Keccak SHA3-256 hashes using a NIF built tiny-keccak Rust crate_
43+
- [ex_rlp](https://github.com/mana-ethereum/ex_rlp) - _Elixir implementation of Ethereum's RLP (Recursive Length Prefix) encoding_
44+
45+
### Archived / No longer maintained {#archived--no-longer-maintained}
46+
47+
- [eth](https://hex.pm/packages/eth) - _Ethereum utilities for Elixir_
48+
- [exw3](https://github.com/hswick/exw3) - _High level Ethereum RPC Client for Elixir_
49+
- [mana](https://github.com/mana-ethereum/mana) - _Ethereum full node implementation written in Elixir_
50+
51+
Looking for more resources? Check out [our Developer's home](/developers/).
52+
53+
## Elixir community contributors {#elixir-community-contributors}
54+
55+
The [Elixir's Slack #ethereum channel](https://elixir-lang.slack.com/archives/C5RPZ3RJL) is a host to a rapidly growing community and is the dedicated resource for discussions on any of the above projects and related topics.

public/content/developers/docs/programming-languages/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Select your programming language of choice to find projects, resources, and virt
1616
- [Ethereum for Dart developers](/developers/docs/programming-languages/dart/)
1717
- [Ethereum for Delphi developers](/developers/docs/programming-languages/delphi/)
1818
- [Ethereum for .NET developers](/developers/docs/programming-languages/dot-net/)
19+
- [Ethereum for Elixir developers](/developers/docs/programming-languages/elixir/)
1920
- [Ethereum for Go developers](/developers/docs/programming-languages/golang/)
2021
- [Ethereum for Java developers](/developers/docs/programming-languages/java/)
2122
- [Ethereum for JavaScript developers](/developers/docs/programming-languages/javascript/)

src/components/AdoptionChart.tsx

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,45 @@
11
import { useTranslation } from "next-i18next"
22
import { useTheme } from "next-themes"
3-
import { Box, type BoxProps, Flex } from "@chakra-ui/react"
43

54
import type { ChildOnlyProp } from "@/lib/types"
65

6+
import { cn } from "@/lib/utils/cn"
7+
8+
import { Flex } from "./ui/flex"
9+
10+
type CellProps = ChildOnlyProp & {
11+
color?: string
12+
className?: string
13+
}
14+
715
const Column = ({ children }: ChildOnlyProp) => (
8-
<Flex
9-
flexDirection="column-reverse"
10-
ms={{ base: 2, md: 4 }}
11-
_first={{ ms: 0 }}
12-
>
13-
{children}
14-
</Flex>
16+
<Flex className="ms-2 flex-col-reverse first:ms-0 md:ms-4">{children}</Flex>
1517
)
1618

17-
const Cell = ({ children, color, ...props }: BoxProps) => (
18-
<Box
19-
border="1px solid"
20-
borderColor={color || "text"}
21-
color={color || "text"}
22-
py="0.8rem"
23-
px={{ base: 2, md: "1.2rem" }}
24-
fontSize="0.9rem"
25-
fontWeight="bold"
26-
lineHeight="none"
27-
textAlign="center"
28-
_last={{
29-
borderTopStartRadius: "2xl",
30-
borderTopEndRadius: "2xl",
31-
}}
32-
sx={{
33-
"&:nth-child(-n + 2)": {
34-
borderBottomStartRadius: "2xl",
35-
borderBottomEndRadius: "2xl",
36-
},
19+
const Cell = ({ children, color, className, ...props }: CellProps) => (
20+
<div
21+
className={cn(
22+
"border border-solid px-2 py-[0.8rem] text-center text-[0.9rem] font-bold leading-none last:rounded-t-2xl md:px-[1.2rem] [&:nth-child(-n+2)]:rounded-bl-2xl [&:nth-child(-n+2)]:rounded-br-2xl",
23+
className
24+
)}
25+
style={{
26+
borderColor: color || "currentcolor",
27+
color: color || "currentcolor",
3728
}}
3829
{...props}
3930
>
4031
{children}
41-
</Box>
32+
</div>
4233
)
4334

4435
const ColumnName = ({ children }: ChildOnlyProp) => (
45-
<Cell border="none" pt={6}>
46-
{children}
47-
</Cell>
36+
<Cell className="border-none pt-6">{children}</Cell>
4837
)
4938

5039
const AdoptionChart = () => {
5140
const { t } = useTranslation("page-what-is-ethereum")
52-
const { theme } = useTheme()
53-
const isDark = theme === "dark"
41+
const { resolvedTheme } = useTheme()
42+
const isDark = resolvedTheme === "dark"
5443

5544
return (
5645
<Flex>

src/components/BannerGrid/index.tsx

Lines changed: 22 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,51 @@
11
import React from "react"
2-
import { Box, Flex, Grid, useToken } from "@chakra-ui/react"
32

43
import { ChildOnlyProp } from "@/lib/types"
54

5+
import { Flex } from "@/components/ui/flex"
6+
7+
import { cn } from "@/lib/utils/cn"
8+
69
export const Banner = ({ children }: ChildOnlyProp) => {
710
return (
8-
<Flex
9-
w="full"
10-
background="bannerGridGradient"
11-
direction={{ base: "column", lg: "row" }}
12-
wrap="nowrap"
13-
sx={{
14-
h2: {
15-
mt: 0,
16-
},
17-
ul: {
18-
mb: 0,
19-
},
20-
}}
21-
>
11+
<Flex className="w-full flex-col flex-nowrap bg-banner-grid-gradient lg:flex-row [&_h2]:mt-0 [&_ul]:mb-0">
2212
{children}
2313
</Flex>
2414
)
2515
}
2616

2717
export const BannerBody = ({ children }: ChildOnlyProp) => {
28-
return (
29-
<Box flex={4} p={10}>
30-
{children}
31-
</Box>
32-
)
18+
return <div className="w-full flex-[4] p-10">{children}</div>
3319
}
3420

3521
export const BannerImage = ({ children }: ChildOnlyProp) => {
36-
return (
37-
<Flex justifyContent="end" flex={2} alignSelf="end">
38-
{children}
39-
</Flex>
40-
)
22+
return <Flex className="flex-[2] justify-end self-end">{children}</Flex>
4123
}
4224

4325
export const BannerGrid = ({ children }: ChildOnlyProp) => {
4426
return (
45-
<Grid
46-
templateColumns={{
47-
base: "repeat(1,1fr)",
48-
md: "repeat(2,1fr)",
49-
lg: "repeat(3,1fr)",
50-
}}
51-
templateRows={{
52-
md: "repeat(3, 1fr)",
53-
lg: "repeat(2, 1fr)",
54-
}}
55-
columnGap={0}
56-
rowGap={0}
57-
>
27+
<div className="md:grid-rows-[repeat(3, 1fr)] lg:grid-rows-[repeat(2, 1fr)] grid w-full grid-cols-[repeat(1,1fr)] gap-0 md:grid-cols-[repeat(2,1fr)] lg:grid-cols-[repeat(3,1fr)]">
5828
{children}
59-
</Grid>
29+
</div>
6030
)
6131
}
6232

6333
export const BannerGridCell = ({ children }: ChildOnlyProp) => {
64-
const [medBp, lgBp] = useToken("breakpoints", ["md", "lg"])
65-
6634
return (
6735
<Flex
68-
px={{ base: 0, md: 12 }}
69-
py={8}
70-
direction="column"
71-
borderTop="1px solid"
72-
borderTopColor="searchBackground"
73-
borderInlineStart={{ base: 0, md: "1px solid" }}
74-
borderInlineStartColor={{ md: "searchBackground" }}
75-
sx={{
76-
"&:first-child": {
77-
borderTop: 0,
78-
},
79-
[`@media (min-width: ${medBp})`]: {
80-
"&:nth-child(-n + 2)": {
81-
borderTop: 0,
82-
},
83-
"&:nth-child(2n + 1)": {
84-
borderInlineStart: 0,
85-
},
86-
},
87-
[`@media (min-width: ${lgBp})`]: {
88-
"&:first-child": {
89-
ps: 0,
90-
borderInlineStart: 0,
91-
},
92-
"&:nth-child(-n + 2)": {
93-
borderTop: "1px solid",
94-
borderTopColor: "searchBackground",
95-
},
96-
"&:nth-child(2n + 1)": {
97-
borderInlineStart: "1px solid",
98-
borderInlineStartColor: "searchBackground",
99-
},
100-
"&:nth-child(-n + 3)": {
101-
borderTop: 0,
102-
justifyContent: "start",
103-
paddingTop: 0,
104-
},
105-
"&:nth-child(3n + 1)": {
106-
ps: 0,
107-
borderInlineStart: 0,
108-
},
109-
"&:nth-child(n + 4)": {
110-
justifyContent: "start",
111-
paddingBottom: 0,
112-
},
113-
},
114-
}}
36+
className={cn(
37+
"px-0 py-8 md:px-12",
38+
"flex-col",
39+
"border-t border-t-search-background",
40+
"md:border-s md:border-s-search-background",
41+
"first:border-t-0",
42+
"lg:[&:first-child]:border-s-0",
43+
"md:[&:nth-child(-n+2)]:border-t-0 lg:[&:nth-child(-n+2)]:border-t lg:[&:nth-child(-n+2)]:border-t-search-background",
44+
"md:[&:nth-child(2n+1)]:border-s-0 lg:[&:nth-child(2n+1)]:border-s lg:[&:nth-child(2n+1)]:border-s-search-background",
45+
"lg:[&:nth-child(-n+3)]:justify-start lg:[&:nth-child(-n+3)]:border-t-0 lg:[&:nth-child(-n+3)]:pt-0",
46+
"lg:[&:nth-child(3n+1)]:border-s-0 lg:[&:nth-child(3n+1)]:ps-0",
47+
"lg:[&:nth-child(n+4)]:justify-start lg:[&:nth-child(n+4)]:pb-0"
48+
)}
11549
>
11650
{children}
11751
</Flex>

src/components/EnergyConsumptionChart/index.tsx

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@ import ChartDataLabels from "chartjs-plugin-datalabels"
1212
import { useRouter } from "next/router"
1313
import { useTranslation } from "next-i18next"
1414
import { Bar } from "react-chartjs-2"
15-
import {
16-
Box,
17-
Center,
18-
Text,
19-
useBreakpointValue,
20-
useColorModeValue,
21-
} from "@chakra-ui/react"
15+
import { useBreakpointValue } from "@chakra-ui/react"
2216

2317
import type { Lang } from "@/lib/types"
2418

19+
import { Center } from "@/components/ui/flex"
20+
2521
import { wrapLabel } from "@/lib/utils/charts"
2622
import { isLangRightToLeft } from "@/lib/utils/translations"
2723

24+
import useColorModeValue from "@/hooks/useColorModeValue"
2825
import { useIsClient } from "@/hooks/useIsClient"
2926

3027
// ChartDataLabels required to display y-labels on top of bars
@@ -237,26 +234,19 @@ const EnergyConsumptionChart = () => {
237234
} satisfies ChartData
238235

239236
return (
240-
<Box my={16}>
241-
<Center w="full" mb={{ base: 4, md: 6 }}>
242-
<Box
243-
position="relative"
244-
maxW="500px"
245-
m="auto"
246-
w="80vw"
247-
h={{ base: "300px", md: "400px" }}
248-
mb={{ base: 4, md: 0 }}
249-
>
237+
<div className="my-16">
238+
<Center className="mb-4 w-full md:mb-6">
239+
<div className="relative m-auto mb-4 h-[300px] w-[80vw] max-w-[500px] md:mb-0 md:h-[400px]">
250240
{isClient && (
251241
<Bar options={chartOptions} data={chartData} updateMode="none" />
252242
)}
253-
</Box>
243+
</div>
254244
</Center>
255245

256-
<Text fontWeight="semibold" textAlign="center">
246+
<p className="text-center font-semibold">
257247
{t("page-what-is-ethereum-energy-consumption-chart-legend")}
258-
</Text>
259-
</Box>
248+
</p>
249+
</div>
260250
)
261251
}
262252

src/components/LanguagePicker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const LanguagePicker = ({
4444
* @param {string} event - The keydown event.
4545
*/
4646
useEventListener("keydown", (e) => {
47-
if (e.key !== "\\") return
47+
if (e.key !== "\\" || e.metaKey || e.ctrlKey) return
4848
e.preventDefault()
4949
onOpen()
5050
})

0 commit comments

Comments
 (0)