@xyo-network/react-gas-price 2.64.0 → 2.64.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/components/Avatar/EthereumGasPriceAvatar.js +3 -2
- package/dist/browser/components/Avatar/EthereumGasPriceAvatar.js.map +1 -1
- package/dist/browser/components/Avatar/index.js +10 -1
- package/dist/browser/components/Avatar/index.js.map +1 -1
- package/dist/browser/components/CardHeader/CardHeader.js +61 -6
- package/dist/browser/components/CardHeader/CardHeader.js.map +1 -1
- package/dist/browser/components/CardHeader/index.js +81 -1
- package/dist/browser/components/CardHeader/index.js.map +1 -1
- package/dist/browser/components/GasFees/Card.js +63 -10
- package/dist/browser/components/GasFees/Card.js.map +1 -1
- package/dist/browser/components/GasFees/components/GasPriceBox.js +12 -5
- package/dist/browser/components/GasFees/components/GasPriceBox.js.map +1 -1
- package/dist/browser/components/GasFees/components/GweiLabelTypography.js +3 -2
- package/dist/browser/components/GasFees/components/GweiLabelTypography.js.map +1 -1
- package/dist/browser/components/GasFees/components/PriorityFeeBox.js +14 -7
- package/dist/browser/components/GasFees/components/PriorityFeeBox.js.map +1 -1
- package/dist/browser/components/GasFees/components/SpeedBox.js +3 -2
- package/dist/browser/components/GasFees/components/SpeedBox.js.map +1 -1
- package/dist/browser/components/GasFees/components/index.js +55 -3
- package/dist/browser/components/GasFees/components/index.js.map +1 -1
- package/dist/browser/components/GasFees/index.js +71 -1
- package/dist/browser/components/GasFees/index.js.map +1 -1
- package/dist/browser/components/HeaderBox.js +65 -6
- package/dist/browser/components/HeaderBox.js.map +1 -1
- package/dist/browser/components/HeaderComponents/Actions.js +3 -2
- package/dist/browser/components/HeaderComponents/Actions.js.map +1 -1
- package/dist/browser/components/HeaderComponents/Header/Header.js +21 -4
- package/dist/browser/components/HeaderComponents/Header/Header.js.map +1 -1
- package/dist/browser/components/HeaderComponents/Header/Heading.js +3 -2
- package/dist/browser/components/HeaderComponents/Header/Heading.js.map +1 -1
- package/dist/browser/components/HeaderComponents/Header/index.js +31 -2
- package/dist/browser/components/HeaderComponents/Header/index.js.map +1 -1
- package/dist/browser/components/HeaderComponents/index.js +51 -2
- package/dist/browser/components/HeaderComponents/index.js.map +1 -1
- package/dist/browser/components/RawPayload/ToggleRawPayloadBox.js +3 -2
- package/dist/browser/components/RawPayload/ToggleRawPayloadBox.js.map +1 -1
- package/dist/browser/components/RawPayload/index.js +15 -1
- package/dist/browser/components/RawPayload/index.js.map +1 -1
- package/dist/browser/components/index.js +211 -7
- package/dist/browser/components/index.js.map +1 -1
- package/dist/browser/components/layout/Header.js +2 -1
- package/dist/browser/components/layout/Header.js.map +1 -1
- package/dist/browser/components/layout/StyledCardHeader.js +2 -1
- package/dist/browser/components/layout/StyledCardHeader.js.map +1 -1
- package/dist/browser/components/layout/index.js +23 -2
- package/dist/browser/components/layout/index.js.map +1 -1
- package/dist/browser/index.js +211 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/types/index.js +0 -1
- package/dist/browser/types/index.js.map +1 -1
- package/dist/docs.json +49 -49
- package/package.json +7 -7
|
@@ -1,2 +1,72 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/GasFees/Card.tsx
|
|
2
|
+
import { Card, Paper, useTheme as useTheme4 } from "@mui/material";
|
|
3
|
+
import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
|
|
4
|
+
import { CardContentEx } from "@xyo-network/react-card";
|
|
5
|
+
|
|
6
|
+
// src/components/GasFees/components/GasPriceBox.tsx
|
|
7
|
+
import { useTheme } from "@mui/material";
|
|
8
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
9
|
+
import { TypographyEx as TypographyEx2 } from "@xyo-network/react-shared";
|
|
10
|
+
|
|
11
|
+
// src/components/GasFees/components/GweiLabelTypography.tsx
|
|
12
|
+
import { TypographyEx } from "@xyo-network/react-shared";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var GweiLabelTypography = (props) => /* @__PURE__ */ jsx(TypographyEx, { variant: "caption", ...props, children: "GWEI" });
|
|
15
|
+
|
|
16
|
+
// src/components/GasFees/components/GasPriceBox.tsx
|
|
17
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var GasPriceBox = ({ gasPrice, ...props }) => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
return /* @__PURE__ */ jsxs(FlexRow, { columnGap: 1.5, rowGap: 1.5, alignItems: "end", ...props, children: [
|
|
21
|
+
/* @__PURE__ */ jsx2(TypographyEx2, { lineHeight: 1, fontWeight: "200", fontSize: theme.spacing(6), title: gasPrice?.toString() ?? "", children: gasPrice?.toFixed(2) }),
|
|
22
|
+
/* @__PURE__ */ jsx2(GweiLabelTypography, { fontSize: theme.spacing(2) })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/components/GasFees/components/PriorityFeeBox.tsx
|
|
27
|
+
import { LocalGasStationRounded as LocalGasStationRoundedIcon } from "@mui/icons-material";
|
|
28
|
+
import { useTheme as useTheme2 } from "@mui/material";
|
|
29
|
+
import { FlexCol, FlexGrowRow } from "@xylabs/react-flexbox";
|
|
30
|
+
import { TypographyEx as TypographyEx3 } from "@xyo-network/react-shared";
|
|
31
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
32
|
+
var PriorityFeeBox = ({ priorityFee, priorityFeeLabel = "Priority Fee", ...props }) => {
|
|
33
|
+
const theme = useTheme2();
|
|
34
|
+
return /* @__PURE__ */ jsxs2(FlexGrowRow, { width: "100%", justifyContent: "space-between", alignItems: "end", ...props, children: [
|
|
35
|
+
/* @__PURE__ */ jsxs2(FlexCol, { alignItems: "start", children: [
|
|
36
|
+
/* @__PURE__ */ jsx3(TypographyEx3, { children: priorityFeeLabel }),
|
|
37
|
+
/* @__PURE__ */ jsxs2(TypographyEx3, { title: priorityFee?.toString() ?? "", children: [
|
|
38
|
+
priorityFee?.toFixed(2),
|
|
39
|
+
" ",
|
|
40
|
+
/* @__PURE__ */ jsx3(GweiLabelTypography, { fontSize: theme.spacing(1) })
|
|
41
|
+
] })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx3(LocalGasStationRoundedIcon, {})
|
|
44
|
+
] });
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/components/GasFees/components/SpeedBox.tsx
|
|
48
|
+
import { useTheme as useTheme3 } from "@mui/material";
|
|
49
|
+
import { FlexGrowCol } from "@xylabs/react-flexbox";
|
|
50
|
+
import { TypographyEx as TypographyEx4 } from "@xyo-network/react-shared";
|
|
51
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
52
|
+
var SpeedBox = ({ speed, ...props }) => {
|
|
53
|
+
const theme = useTheme3();
|
|
54
|
+
return speed ? /* @__PURE__ */ jsx4(FlexGrowCol, { ...props, children: /* @__PURE__ */ jsx4(TypographyEx4, { fontSize: theme.spacing(3), fontWeight: "200", p: 1, children: speed }) }) : null;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/components/GasFees/Card.tsx
|
|
58
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
59
|
+
var GasFeeCard = ({ gasPrice, speedPaperElevation, priorityFee, priorityFeeLabel, speed = "low", ...props }) => {
|
|
60
|
+
const theme = useTheme4();
|
|
61
|
+
return /* @__PURE__ */ jsx5(Card, { sx: { p: 0 }, ...props, children: /* @__PURE__ */ jsxs3(CardContentEx, { removePadding: true, sx: { flexDirection: "column", flexGrow: 1, p: 0, rowGap: 2 }, children: [
|
|
62
|
+
/* @__PURE__ */ jsxs3(FlexGrowCol2, { bgcolor: theme.palette.secondary.dark, alignItems: "start", p: 2, rowGap: 1.5, color: theme.palette.common.white, children: [
|
|
63
|
+
/* @__PURE__ */ jsx5(GasPriceBox, { gasPrice }),
|
|
64
|
+
priorityFee ? /* @__PURE__ */ jsx5(PriorityFeeBox, { priorityFee, priorityFeeLabel }) : null
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsx5(Paper, { elevation: speedPaperElevation, sx: { borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px` }, children: /* @__PURE__ */ jsx5(SpeedBox, { speed }) })
|
|
67
|
+
] }) });
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
GasFeeCard
|
|
71
|
+
};
|
|
2
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/GasFees/
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/GasFees/Card.tsx","../../../../src/components/GasFees/components/GasPriceBox.tsx","../../../../src/components/GasFees/components/GweiLabelTypography.tsx","../../../../src/components/GasFees/components/PriorityFeeBox.tsx","../../../../src/components/GasFees/components/SpeedBox.tsx"],"sourcesContent":["import { Card, CardProps, Paper, useTheme } from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { CardContentEx } from '@xyo-network/react-card'\n\nimport { GasPriceBox, PriorityFeeBox, SpeedBox } from './components'\n\nexport interface GasFeeCardProps extends CardProps {\n gasPrice?: number\n priorityFee?: number\n priorityFeeLabel?: string\n speed?: string\n speedPaperElevation?: number\n}\n\nexport const GasFeeCard: React.FC<GasFeeCardProps> = ({ gasPrice, speedPaperElevation, priorityFee, priorityFeeLabel, speed = 'low', ...props }) => {\n const theme = useTheme()\n\n return (\n <Card sx={{ p: 0 }} {...props}>\n <CardContentEx removePadding sx={{ flexDirection: 'column', flexGrow: 1, p: 0, rowGap: 2 }}>\n <FlexGrowCol bgcolor={theme.palette.secondary.dark} alignItems=\"start\" p={2} rowGap={1.5} color={theme.palette.common.white}>\n <GasPriceBox gasPrice={gasPrice} />\n {priorityFee ? <PriorityFeeBox priorityFee={priorityFee} priorityFeeLabel={priorityFeeLabel} /> : null}\n </FlexGrowCol>\n <Paper elevation={speedPaperElevation} sx={{ borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px` }}>\n <SpeedBox speed={speed} />\n </Paper>\n </CardContentEx>\n </Card>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nimport { GweiLabelTypography } from './GweiLabelTypography'\n\nexport interface GasPriceBoxProps extends FlexBoxProps {\n gasPrice?: number\n}\n\nexport const GasPriceBox: React.FC<GasPriceBoxProps> = ({ gasPrice, ...props }) => {\n const theme = useTheme()\n return (\n <FlexRow columnGap={1.5} rowGap={1.5} alignItems=\"end\" {...props}>\n <TypographyEx lineHeight={1} fontWeight=\"200\" fontSize={theme.spacing(6)} title={gasPrice?.toString() ?? ''}>\n {gasPrice?.toFixed(2)}\n </TypographyEx>\n <GweiLabelTypography fontSize={theme.spacing(2)} />\n </FlexRow>\n )\n}\n","import { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\n\nexport const GweiLabelTypography: React.FC<TypographyExProps> = (props) => (\n <TypographyEx variant=\"caption\" {...props}>\n GWEI\n </TypographyEx>\n)\n","import { LocalGasStationRounded as LocalGasStationRoundedIcon } from '@mui/icons-material'\nimport { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexCol, FlexGrowRow } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nimport { GweiLabelTypography } from './GweiLabelTypography'\n\nexport interface PriorityFeeBoxProps extends FlexBoxProps {\n priorityFee?: number\n priorityFeeLabel?: string\n}\n\nexport const PriorityFeeBox: React.FC<PriorityFeeBoxProps> = ({ priorityFee, priorityFeeLabel = 'Priority Fee', ...props }) => {\n const theme = useTheme()\n\n return (\n <FlexGrowRow width=\"100%\" justifyContent=\"space-between\" alignItems=\"end\" {...props}>\n <FlexCol alignItems=\"start\">\n <TypographyEx>{priorityFeeLabel}</TypographyEx>\n <TypographyEx title={priorityFee?.toString() ?? ''}>\n {priorityFee?.toFixed(2)} <GweiLabelTypography fontSize={theme.spacing(1)} />\n </TypographyEx>\n </FlexCol>\n <LocalGasStationRoundedIcon />\n </FlexGrowRow>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nexport interface SpeedBoxProps extends FlexBoxProps {\n speed?: string\n}\n\nexport const SpeedBox: React.FC<SpeedBoxProps> = ({ speed, ...props }) => {\n const theme = useTheme()\n\n return speed ? (\n <FlexGrowCol {...props}>\n <TypographyEx fontSize={theme.spacing(3)} fontWeight=\"200\" p={1}>\n {speed}\n </TypographyEx>\n </FlexGrowCol>\n ) : null\n}\n"],"mappings":";AAAA,SAAS,MAAiB,OAAO,YAAAA,iBAAgB;AACjD,SAAS,eAAAC,oBAAmB;AAC5B,SAAS,qBAAqB;;;ACF9B,SAAS,gBAAgB;AACzB,SAAuB,eAAe;AACtC,SAAS,gBAAAC,qBAAoB;;;ACF7B,SAAS,oBAAuC;AAG9C;AADK,IAAM,sBAAmD,CAAC,UAC/D,oBAAC,gBAAa,SAAQ,WAAW,GAAG,OAAO,kBAE3C;;;ADQE,SACE,OAAAC,MADF;AAHG,IAAM,cAA0C,CAAC,EAAE,UAAU,GAAG,MAAM,MAAM;AACjF,QAAM,QAAQ,SAAS;AACvB,SACE,qBAAC,WAAQ,WAAW,KAAK,QAAQ,KAAK,YAAW,OAAO,GAAG,OACzD;AAAA,oBAAAA,KAACC,eAAA,EAAa,YAAY,GAAG,YAAW,OAAM,UAAU,MAAM,QAAQ,CAAC,GAAG,OAAO,UAAU,SAAS,KAAK,IACtG,oBAAU,QAAQ,CAAC,GACtB;AAAA,IACA,gBAAAD,KAAC,uBAAoB,UAAU,MAAM,QAAQ,CAAC,GAAG;AAAA,KACnD;AAEJ;;;AEpBA,SAAS,0BAA0B,kCAAkC;AACrE,SAAS,YAAAE,iBAAgB;AACzB,SAAuB,SAAS,mBAAmB;AACnD,SAAS,gBAAAC,qBAAoB;AAerB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,cAAA,EAAY,SAAS,MAAM,QAAQ,UAAU,MAAM,YAAW,SAAQ,GAAG,GAAG,QAAQ,KAAK,OAAO,MAAM,QAAQ,OAAO,OACpH;AAAA,sBAAAH,KAAC,eAAY,UAAoB;AAAA,MAChC,cAAc,gBAAAA,KAAC,kBAAe,aAA0B,kBAAoC,IAAK;AAAA,OACpG;AAAA,IACA,gBAAAA,KAAC,SAAM,WAAW,qBAAqB,IAAI,EAAE,cAAc,OAAO,MAAM,MAAM,YAAY,MAAM,MAAM,MAAM,YAAY,KAAK,GAC3H,0BAAAA,KAAC,YAAS,OAAc,GAC1B;AAAA,KACF,GACF;AAEJ;","names":["useTheme","FlexGrowCol","TypographyEx","jsx","TypographyEx","useTheme","TypographyEx","jsx","jsxs","useTheme","TypographyEx","useTheme","TypographyEx","jsx","jsx","jsxs","useTheme","FlexGrowCol"]}
|
|
@@ -1,10 +1,69 @@
|
|
|
1
|
+
// src/components/HeaderComponents/Actions.tsx
|
|
2
|
+
import { Chip } from "@mui/material";
|
|
3
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
1
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
var GasPriceHeaderActionsBox = ({
|
|
6
|
+
baseFee,
|
|
7
|
+
baseFeeLabel = "Base Fee",
|
|
8
|
+
blockNumber,
|
|
9
|
+
blockNumberLabel = "Block Number",
|
|
10
|
+
timestamp,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
13
|
+
return /* @__PURE__ */ jsxs(FlexRow, { columnGap: 1, rowGap: 1, flexWrap: "wrap", ...props, children: [
|
|
14
|
+
timestamp ? /* @__PURE__ */ jsx(Chip, { label: new Date(timestamp).toLocaleString() }) : null,
|
|
15
|
+
baseFee ? /* @__PURE__ */ jsx(Chip, { label: `${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI` }) : null,
|
|
16
|
+
blockNumber ? /* @__PURE__ */ jsx(Chip, { label: `${blockNumberLabel} - ${blockNumber}` }) : null
|
|
17
|
+
] });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
21
|
+
import { useTheme as useTheme2 } from "@mui/material";
|
|
22
|
+
import { useGetTokenData } from "@xyo-network/react-shared";
|
|
23
|
+
|
|
24
|
+
// src/components/HeaderComponents/Header/Heading.tsx
|
|
25
|
+
import { useTheme } from "@mui/material";
|
|
26
|
+
import { TypographyEx } from "@xyo-network/react-shared";
|
|
27
|
+
import { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
28
|
+
var GasPriceHeadingTypography = ({ children, heading, networkIcon, ...props }) => {
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
return /* @__PURE__ */ jsxs2(TypographyEx, { fontSize: theme.spacing(6), lineHeight: 1, ...props, children: [
|
|
31
|
+
heading,
|
|
32
|
+
" ",
|
|
33
|
+
networkIcon,
|
|
34
|
+
" ",
|
|
35
|
+
children
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
40
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
41
|
+
var GasPriceHeaderTypography = ({ heading, children, ...props }) => {
|
|
42
|
+
const theme = useTheme2();
|
|
43
|
+
const [ethData] = useGetTokenData(["eth"]);
|
|
44
|
+
const networkIcon = /* @__PURE__ */ jsx2("img", { height: theme.spacing(4), src: ethData.icon });
|
|
45
|
+
return /* @__PURE__ */ jsx2(GasPriceHeadingTypography, { heading, networkIcon, ...props, children });
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// src/components/layout/Header.tsx
|
|
49
|
+
import { styled } from "@mui/material";
|
|
50
|
+
import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
51
|
+
var StyledGasPriceHeaderBox = styled(FlexRow2, { name: "StyledGasPriceEstimateBox" })(({ theme }) => ({
|
|
52
|
+
alignItems: "end",
|
|
53
|
+
columnGap: theme.spacing(2),
|
|
54
|
+
flexWrap: "wrap",
|
|
55
|
+
justifyContent: "space-between",
|
|
56
|
+
justifyItems: "space-between",
|
|
57
|
+
rowGap: theme.spacing(2),
|
|
58
|
+
width: "100%"
|
|
59
|
+
}));
|
|
60
|
+
|
|
61
|
+
// src/components/HeaderBox.tsx
|
|
62
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
63
|
+
var GasPriceWitnessHeaderBox = ({ heading, parsedPayload, ...props }) => {
|
|
64
|
+
return /* @__PURE__ */ jsxs3(StyledGasPriceHeaderBox, { ...props, children: [
|
|
65
|
+
/* @__PURE__ */ jsx3(GasPriceHeaderTypography, { heading }),
|
|
66
|
+
/* @__PURE__ */ jsx3(
|
|
8
67
|
GasPriceHeaderActionsBox,
|
|
9
68
|
{
|
|
10
69
|
timestamp: parsedPayload?.timestamp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/HeaderBox.tsx"],"sourcesContent":["import { FlexBoxProps } from '@xylabs/react-flexbox'\n\nimport { GasPriceWitnessUIBasePayload } from '../types'\nimport { GasPriceHeaderActionsBox, GasPriceHeaderTypography } from './HeaderComponents'\nimport { StyledGasPriceHeaderBox } from './layout'\n\nexport interface GasPriceWitnessHeaderBoxProps extends FlexBoxProps {\n heading?: string\n parsedPayload?: GasPriceWitnessUIBasePayload\n}\n\nexport const GasPriceWitnessHeaderBox: React.FC<GasPriceWitnessHeaderBoxProps> = ({ heading, parsedPayload, ...props }) => {\n return (\n <StyledGasPriceHeaderBox {...props}>\n <GasPriceHeaderTypography heading={heading} />\n <GasPriceHeaderActionsBox\n timestamp={parsedPayload?.timestamp}\n baseFee={parsedPayload?.baseFee?.value}\n baseFeeLabel={parsedPayload?.baseFee?.label}\n blockNumber={parsedPayload?.blockNumber?.value}\n blockNumberLabel={parsedPayload?.blockNumber?.label}\n />\n </StyledGasPriceHeaderBox>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/HeaderComponents/Actions.tsx","../../../src/components/HeaderComponents/Header/Header.tsx","../../../src/components/HeaderComponents/Header/Heading.tsx","../../../src/components/layout/Header.tsx","../../../src/components/HeaderBox.tsx"],"sourcesContent":["import { Chip } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nexport interface GasPriceEstimateActionsBoxProps extends FlexBoxProps {\n baseFee?: number\n baseFeeLabel?: string\n blockNumber?: number\n blockNumberLabel?: string\n timestamp?: number\n}\n\nexport const GasPriceHeaderActionsBox: React.FC<GasPriceEstimateActionsBoxProps> = ({\n baseFee,\n baseFeeLabel = 'Base Fee',\n blockNumber,\n blockNumberLabel = 'Block Number',\n timestamp,\n ...props\n}) => {\n return (\n <FlexRow columnGap={1} rowGap={1} flexWrap=\"wrap\" {...props}>\n {timestamp ? <Chip label={new Date(timestamp).toLocaleString()} /> : null}\n {baseFee ? <Chip label={`${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI`} /> : null}\n {blockNumber ? <Chip label={`${blockNumberLabel} - ${blockNumber}`} /> : null}\n </FlexRow>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { TypographyExProps, useGetTokenData } from '@xyo-network/react-shared'\n\nimport { GasPriceHeadingTypography } from './Heading'\n\nexport interface GasPriceHeaderTypographyProps extends TypographyExProps, WithChildren {\n heading?: string\n}\n\nexport const GasPriceHeaderTypography: React.FC<GasPriceHeaderTypographyProps> = ({ heading, children, ...props }) => {\n const theme = useTheme()\n const [ethData] = useGetTokenData(['eth'])\n const networkIcon = <img height={theme.spacing(4)} src={ethData.icon} />\n\n return (\n <GasPriceHeadingTypography heading={heading} networkIcon={networkIcon} {...props}>\n {children}\n </GasPriceHeadingTypography>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n","import { styled } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\n\nexport const StyledGasPriceHeaderBox = styled(FlexRow, { name: 'StyledGasPriceEstimateBox' })(({ theme }) => ({\n alignItems: 'end',\n columnGap: theme.spacing(2),\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n justifyItems: 'space-between',\n rowGap: theme.spacing(2),\n width: '100%',\n}))\n","import { FlexBoxProps } from '@xylabs/react-flexbox'\n\nimport { GasPriceWitnessUIBasePayload } from '../types'\nimport { GasPriceHeaderActionsBox, GasPriceHeaderTypography } from './HeaderComponents'\nimport { StyledGasPriceHeaderBox } from './layout'\n\nexport interface GasPriceWitnessHeaderBoxProps extends FlexBoxProps {\n heading?: string\n parsedPayload?: GasPriceWitnessUIBasePayload\n}\n\nexport const GasPriceWitnessHeaderBox: React.FC<GasPriceWitnessHeaderBoxProps> = ({ heading, parsedPayload, ...props }) => {\n return (\n <StyledGasPriceHeaderBox {...props}>\n <GasPriceHeaderTypography heading={heading} />\n <GasPriceHeaderActionsBox\n timestamp={parsedPayload?.timestamp}\n baseFee={parsedPayload?.baseFee?.value}\n baseFeeLabel={parsedPayload?.baseFee?.label}\n blockNumber={parsedPayload?.blockNumber?.value}\n blockNumberLabel={parsedPayload?.blockNumber?.label}\n />\n </StyledGasPriceHeaderBox>\n )\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAuB,eAAe;AAmBlC,SACe,KADf;AATG,IAAM,2BAAsE,CAAC;AAAA,EAClF;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,mBA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AAO;AAAA,EAC5G,YAAY;AAAA,EACZ,WAAW,MAAM,QAAQ,CAAC;AAAA,EAC1B,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,QAAQ,MAAM,QAAQ,CAAC;AAAA,EACvB,OAAO;AACT,EAAE;;;ACEE,SACE,OAAAC,MADF,QAAAC,aAAA;AAFG,IAAM,2BAAoE,CAAC,EAAE,SAAS,eAAe,GAAG,MAAM,MAAM;AACzH,SACE,gBAAAA,MAAC,2BAAyB,GAAG,OAC3B;AAAA,oBAAAD,KAAC,4BAAyB,SAAkB;AAAA,IAC5C,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,eAAe;AAAA,QAC1B,SAAS,eAAe,SAAS;AAAA,QACjC,cAAc,eAAe,SAAS;AAAA,QACtC,aAAa,eAAe,aAAa;AAAA,QACzC,kBAAkB,eAAe,aAAa;AAAA;AAAA,IAChD;AAAA,KACF;AAEJ;","names":["useTheme","jsxs","jsx","useTheme","FlexRow","jsx","jsxs"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/HeaderComponents/Actions.tsx
|
|
2
2
|
import { Chip } from "@mui/material";
|
|
3
3
|
import { FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
-
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var GasPriceHeaderActionsBox = ({
|
|
5
6
|
baseFee,
|
|
6
7
|
baseFeeLabel = "Base Fee",
|
|
7
8
|
blockNumber,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/HeaderComponents/Actions.tsx"],"sourcesContent":["import { Chip } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nexport interface GasPriceEstimateActionsBoxProps extends FlexBoxProps {\n baseFee?: number\n baseFeeLabel?: string\n blockNumber?: number\n blockNumberLabel?: string\n timestamp?: number\n}\n\nexport const GasPriceHeaderActionsBox: React.FC<GasPriceEstimateActionsBoxProps> = ({\n baseFee,\n baseFeeLabel = 'Base Fee',\n blockNumber,\n blockNumberLabel = 'Block Number',\n timestamp,\n ...props\n}) => {\n return (\n <FlexRow columnGap={1} rowGap={1} flexWrap=\"wrap\" {...props}>\n {timestamp ? <Chip label={new Date(timestamp).toLocaleString()} /> : null}\n {baseFee ? <Chip label={`${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI`} /> : null}\n {blockNumber ? <Chip label={`${blockNumberLabel} - ${blockNumber}`} /> : null}\n </FlexRow>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/HeaderComponents/Actions.tsx"],"sourcesContent":["import { Chip } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nexport interface GasPriceEstimateActionsBoxProps extends FlexBoxProps {\n baseFee?: number\n baseFeeLabel?: string\n blockNumber?: number\n blockNumberLabel?: string\n timestamp?: number\n}\n\nexport const GasPriceHeaderActionsBox: React.FC<GasPriceEstimateActionsBoxProps> = ({\n baseFee,\n baseFeeLabel = 'Base Fee',\n blockNumber,\n blockNumberLabel = 'Block Number',\n timestamp,\n ...props\n}) => {\n return (\n <FlexRow columnGap={1} rowGap={1} flexWrap=\"wrap\" {...props}>\n {timestamp ? <Chip label={new Date(timestamp).toLocaleString()} /> : null}\n {baseFee ? <Chip label={`${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI`} /> : null}\n {blockNumber ? <Chip label={`${blockNumberLabel} - ${blockNumber}`} /> : null}\n </FlexRow>\n )\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAuB,eAAe;AAmBlC,SACe,KADf;AATG,IAAM,2BAAsE,CAAC;AAAA,EAClF;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE,qBAAC,WAAQ,WAAW,GAAG,QAAQ,GAAG,UAAS,QAAQ,GAAG,OACnD;AAAA,gBAAY,oBAAC,QAAK,OAAO,IAAI,KAAK,SAAS,EAAE,eAAe,GAAG,IAAK;AAAA,IACpE,UAAU,oBAAC,QAAK,OAAO,GAAG,YAAY,MAAM,QAAQ,QAAQ,CAAC,CAAC,SAAS,IAAK;AAAA,IAC5E,cAAc,oBAAC,QAAK,OAAO,GAAG,gBAAgB,MAAM,WAAW,IAAI,IAAK;AAAA,KAC3E;AAEJ;","names":[]}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import { useTheme } from "@mui/material";
|
|
1
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
2
|
+
import { useTheme as useTheme2 } from "@mui/material";
|
|
3
3
|
import { useGetTokenData } from "@xyo-network/react-shared";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
// src/components/HeaderComponents/Header/Heading.tsx
|
|
6
|
+
import { useTheme } from "@mui/material";
|
|
7
|
+
import { TypographyEx } from "@xyo-network/react-shared";
|
|
8
|
+
import { jsxs } from "react/jsx-runtime";
|
|
9
|
+
var GasPriceHeadingTypography = ({ children, heading, networkIcon, ...props }) => {
|
|
6
10
|
const theme = useTheme();
|
|
11
|
+
return /* @__PURE__ */ jsxs(TypographyEx, { fontSize: theme.spacing(6), lineHeight: 1, ...props, children: [
|
|
12
|
+
heading,
|
|
13
|
+
" ",
|
|
14
|
+
networkIcon,
|
|
15
|
+
" ",
|
|
16
|
+
children
|
|
17
|
+
] });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
21
|
+
import { jsx } from "react/jsx-runtime";
|
|
22
|
+
var GasPriceHeaderTypography = ({ heading, children, ...props }) => {
|
|
23
|
+
const theme = useTheme2();
|
|
7
24
|
const [ethData] = useGetTokenData(["eth"]);
|
|
8
25
|
const networkIcon = /* @__PURE__ */ jsx("img", { height: theme.spacing(4), src: ethData.icon });
|
|
9
26
|
return /* @__PURE__ */ jsx(GasPriceHeadingTypography, { heading, networkIcon, ...props, children });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/HeaderComponents/Header/Header.tsx"],"sourcesContent":["import { useTheme } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { TypographyExProps, useGetTokenData } from '@xyo-network/react-shared'\n\nimport { GasPriceHeadingTypography } from './Heading'\n\nexport interface GasPriceHeaderTypographyProps extends TypographyExProps, WithChildren {\n heading?: string\n}\n\nexport const GasPriceHeaderTypography: React.FC<GasPriceHeaderTypographyProps> = ({ heading, children, ...props }) => {\n const theme = useTheme()\n const [ethData] = useGetTokenData(['eth'])\n const networkIcon = <img height={theme.spacing(4)} src={ethData.icon} />\n\n return (\n <GasPriceHeadingTypography heading={heading} networkIcon={networkIcon} {...props}>\n {children}\n </GasPriceHeadingTypography>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/HeaderComponents/Header/Header.tsx","../../../../../src/components/HeaderComponents/Header/Heading.tsx"],"sourcesContent":["import { useTheme } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { TypographyExProps, useGetTokenData } from '@xyo-network/react-shared'\n\nimport { GasPriceHeadingTypography } from './Heading'\n\nexport interface GasPriceHeaderTypographyProps extends TypographyExProps, WithChildren {\n heading?: string\n}\n\nexport const GasPriceHeaderTypography: React.FC<GasPriceHeaderTypographyProps> = ({ heading, children, ...props }) => {\n const theme = useTheme()\n const [ethData] = useGetTokenData(['eth'])\n const networkIcon = <img height={theme.spacing(4)} src={ethData.icon} />\n\n return (\n <GasPriceHeadingTypography heading={heading} networkIcon={networkIcon} {...props}>\n {children}\n </GasPriceHeadingTypography>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n"],"mappings":";AAAA,SAAS,YAAAA,iBAAgB;AAEzB,SAA4B,uBAAuB;;;ACFnD,SAAS,gBAAgB;AACzB,SAAS,oBAAuC;AAY5C;AAHG,IAAM,4BAAsE,CAAC,EAAE,UAAU,SAAS,aAAa,GAAG,MAAM,MAAM;AACnI,QAAM,QAAQ,SAAS;AACvB,SACE,qBAAC,gBAAa,UAAU,MAAM,QAAQ,CAAC,GAAG,YAAY,GAAI,GAAG,OAC1D;AAAA;AAAA,IAAQ;AAAA,IAAE;AAAA,IAAY;AAAA,IAAE;AAAA,KAC3B;AAEJ;;;ADJsB;AAHf,IAAM,2BAAoE,CAAC,EAAE,SAAS,UAAU,GAAG,MAAM,MAAM;AACpH,QAAM,QAAQC,UAAS;AACvB,QAAM,CAAC,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC;AACzC,QAAM,cAAc,oBAAC,SAAI,QAAQ,MAAM,QAAQ,CAAC,GAAG,KAAK,QAAQ,MAAM;AAEtE,SACE,oBAAC,6BAA0B,SAAkB,aAA2B,GAAG,OACxE,UACH;AAEJ;","names":["useTheme","useTheme"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/HeaderComponents/Header/Heading.tsx
|
|
2
2
|
import { useTheme } from "@mui/material";
|
|
3
3
|
import { TypographyEx } from "@xyo-network/react-shared";
|
|
4
|
-
|
|
4
|
+
import { jsxs } from "react/jsx-runtime";
|
|
5
|
+
var GasPriceHeadingTypography = ({ children, heading, networkIcon, ...props }) => {
|
|
5
6
|
const theme = useTheme();
|
|
6
7
|
return /* @__PURE__ */ jsxs(TypographyEx, { fontSize: theme.spacing(6), lineHeight: 1, ...props, children: [
|
|
7
8
|
heading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/HeaderComponents/Header/Heading.tsx"],"sourcesContent":["import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/HeaderComponents/Header/Heading.tsx"],"sourcesContent":["import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,oBAAuC;AAY5C;AAHG,IAAM,4BAAsE,CAAC,EAAE,UAAU,SAAS,aAAa,GAAG,MAAM,MAAM;AACnI,QAAM,QAAQ,SAAS;AACvB,SACE,qBAAC,gBAAa,UAAU,MAAM,QAAQ,CAAC,GAAG,YAAY,GAAI,GAAG,OAC1D;AAAA;AAAA,IAAQ;AAAA,IAAE;AAAA,IAAY;AAAA,IAAE;AAAA,KAC3B;AAEJ;","names":[]}
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
2
|
+
import { useTheme as useTheme2 } from "@mui/material";
|
|
3
|
+
import { useGetTokenData } from "@xyo-network/react-shared";
|
|
4
|
+
|
|
5
|
+
// src/components/HeaderComponents/Header/Heading.tsx
|
|
6
|
+
import { useTheme } from "@mui/material";
|
|
7
|
+
import { TypographyEx } from "@xyo-network/react-shared";
|
|
8
|
+
import { jsxs } from "react/jsx-runtime";
|
|
9
|
+
var GasPriceHeadingTypography = ({ children, heading, networkIcon, ...props }) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
return /* @__PURE__ */ jsxs(TypographyEx, { fontSize: theme.spacing(6), lineHeight: 1, ...props, children: [
|
|
12
|
+
heading,
|
|
13
|
+
" ",
|
|
14
|
+
networkIcon,
|
|
15
|
+
" ",
|
|
16
|
+
children
|
|
17
|
+
] });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
21
|
+
import { jsx } from "react/jsx-runtime";
|
|
22
|
+
var GasPriceHeaderTypography = ({ heading, children, ...props }) => {
|
|
23
|
+
const theme = useTheme2();
|
|
24
|
+
const [ethData] = useGetTokenData(["eth"]);
|
|
25
|
+
const networkIcon = /* @__PURE__ */ jsx("img", { height: theme.spacing(4), src: ethData.icon });
|
|
26
|
+
return /* @__PURE__ */ jsx(GasPriceHeadingTypography, { heading, networkIcon, ...props, children });
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
GasPriceHeaderTypography,
|
|
30
|
+
GasPriceHeadingTypography
|
|
31
|
+
};
|
|
3
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/HeaderComponents/Header/
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/HeaderComponents/Header/Header.tsx","../../../../../src/components/HeaderComponents/Header/Heading.tsx"],"sourcesContent":["import { useTheme } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { TypographyExProps, useGetTokenData } from '@xyo-network/react-shared'\n\nimport { GasPriceHeadingTypography } from './Heading'\n\nexport interface GasPriceHeaderTypographyProps extends TypographyExProps, WithChildren {\n heading?: string\n}\n\nexport const GasPriceHeaderTypography: React.FC<GasPriceHeaderTypographyProps> = ({ heading, children, ...props }) => {\n const theme = useTheme()\n const [ethData] = useGetTokenData(['eth'])\n const networkIcon = <img height={theme.spacing(4)} src={ethData.icon} />\n\n return (\n <GasPriceHeadingTypography heading={heading} networkIcon={networkIcon} {...props}>\n {children}\n </GasPriceHeadingTypography>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n"],"mappings":";AAAA,SAAS,YAAAA,iBAAgB;AAEzB,SAA4B,uBAAuB;;;ACFnD,SAAS,gBAAgB;AACzB,SAAS,oBAAuC;AAY5C;AAHG,IAAM,4BAAsE,CAAC,EAAE,UAAU,SAAS,aAAa,GAAG,MAAM,MAAM;AACnI,QAAM,QAAQ,SAAS;AACvB,SACE,qBAAC,gBAAa,UAAU,MAAM,QAAQ,CAAC,GAAG,YAAY,GAAI,GAAG,OAC1D;AAAA;AAAA,IAAQ;AAAA,IAAE;AAAA,IAAY;AAAA,IAAE;AAAA,KAC3B;AAEJ;;;ADJsB;AAHf,IAAM,2BAAoE,CAAC,EAAE,SAAS,UAAU,GAAG,MAAM,MAAM;AACpH,QAAM,QAAQC,UAAS;AACvB,QAAM,CAAC,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC;AACzC,QAAM,cAAc,oBAAC,SAAI,QAAQ,MAAM,QAAQ,CAAC,GAAG,KAAK,QAAQ,MAAM;AAEtE,SACE,oBAAC,6BAA0B,SAAkB,aAA2B,GAAG,OACxE,UACH;AAEJ;","names":["useTheme","useTheme"]}
|
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/components/HeaderComponents/Actions.tsx
|
|
2
|
+
import { Chip } from "@mui/material";
|
|
3
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var GasPriceHeaderActionsBox = ({
|
|
6
|
+
baseFee,
|
|
7
|
+
baseFeeLabel = "Base Fee",
|
|
8
|
+
blockNumber,
|
|
9
|
+
blockNumberLabel = "Block Number",
|
|
10
|
+
timestamp,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
13
|
+
return /* @__PURE__ */ jsxs(FlexRow, { columnGap: 1, rowGap: 1, flexWrap: "wrap", ...props, children: [
|
|
14
|
+
timestamp ? /* @__PURE__ */ jsx(Chip, { label: new Date(timestamp).toLocaleString() }) : null,
|
|
15
|
+
baseFee ? /* @__PURE__ */ jsx(Chip, { label: `${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI` }) : null,
|
|
16
|
+
blockNumber ? /* @__PURE__ */ jsx(Chip, { label: `${blockNumberLabel} - ${blockNumber}` }) : null
|
|
17
|
+
] });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
21
|
+
import { useTheme as useTheme2 } from "@mui/material";
|
|
22
|
+
import { useGetTokenData } from "@xyo-network/react-shared";
|
|
23
|
+
|
|
24
|
+
// src/components/HeaderComponents/Header/Heading.tsx
|
|
25
|
+
import { useTheme } from "@mui/material";
|
|
26
|
+
import { TypographyEx } from "@xyo-network/react-shared";
|
|
27
|
+
import { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
28
|
+
var GasPriceHeadingTypography = ({ children, heading, networkIcon, ...props }) => {
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
return /* @__PURE__ */ jsxs2(TypographyEx, { fontSize: theme.spacing(6), lineHeight: 1, ...props, children: [
|
|
31
|
+
heading,
|
|
32
|
+
" ",
|
|
33
|
+
networkIcon,
|
|
34
|
+
" ",
|
|
35
|
+
children
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
40
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
41
|
+
var GasPriceHeaderTypography = ({ heading, children, ...props }) => {
|
|
42
|
+
const theme = useTheme2();
|
|
43
|
+
const [ethData] = useGetTokenData(["eth"]);
|
|
44
|
+
const networkIcon = /* @__PURE__ */ jsx2("img", { height: theme.spacing(4), src: ethData.icon });
|
|
45
|
+
return /* @__PURE__ */ jsx2(GasPriceHeadingTypography, { heading, networkIcon, ...props, children });
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
GasPriceHeaderActionsBox,
|
|
49
|
+
GasPriceHeaderTypography,
|
|
50
|
+
GasPriceHeadingTypography
|
|
51
|
+
};
|
|
3
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/HeaderComponents/
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/HeaderComponents/Actions.tsx","../../../../src/components/HeaderComponents/Header/Header.tsx","../../../../src/components/HeaderComponents/Header/Heading.tsx"],"sourcesContent":["import { Chip } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nexport interface GasPriceEstimateActionsBoxProps extends FlexBoxProps {\n baseFee?: number\n baseFeeLabel?: string\n blockNumber?: number\n blockNumberLabel?: string\n timestamp?: number\n}\n\nexport const GasPriceHeaderActionsBox: React.FC<GasPriceEstimateActionsBoxProps> = ({\n baseFee,\n baseFeeLabel = 'Base Fee',\n blockNumber,\n blockNumberLabel = 'Block Number',\n timestamp,\n ...props\n}) => {\n return (\n <FlexRow columnGap={1} rowGap={1} flexWrap=\"wrap\" {...props}>\n {timestamp ? <Chip label={new Date(timestamp).toLocaleString()} /> : null}\n {baseFee ? <Chip label={`${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI`} /> : null}\n {blockNumber ? <Chip label={`${blockNumberLabel} - ${blockNumber}`} /> : null}\n </FlexRow>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { TypographyExProps, useGetTokenData } from '@xyo-network/react-shared'\n\nimport { GasPriceHeadingTypography } from './Heading'\n\nexport interface GasPriceHeaderTypographyProps extends TypographyExProps, WithChildren {\n heading?: string\n}\n\nexport const GasPriceHeaderTypography: React.FC<GasPriceHeaderTypographyProps> = ({ heading, children, ...props }) => {\n const theme = useTheme()\n const [ethData] = useGetTokenData(['eth'])\n const networkIcon = <img height={theme.spacing(4)} src={ethData.icon} />\n\n return (\n <GasPriceHeadingTypography heading={heading} networkIcon={networkIcon} {...props}>\n {children}\n </GasPriceHeadingTypography>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAuB,eAAe;AAmBlC,SACe,KADf;AATG,IAAM,2BAAsE,CAAC;AAAA,EAClF;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA,GAAG;AACL,MAAM;AACJ,S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react-flexbox";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
-
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var ToggleRawPayloadBox = ({ gasPricePayload, ...props }) => {
|
|
6
7
|
const [collapse, setCollapse] = useState(false);
|
|
7
8
|
return gasPricePayload ? /* @__PURE__ */ jsxs(FlexCol, { rowGap: 1, ...props, children: [
|
|
8
9
|
/* @__PURE__ */ jsx(Button, { color: "secondary", sx: { bgcolor: "secondary.dark", color: "white" }, variant: "contained", onClick: () => setCollapse(!collapse), children: "Raw Payload" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/RawPayload/ToggleRawPayloadBox.tsx"],"sourcesContent":["import { Button, Collapse, Paper } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nexport interface ToggleRawPayloadBoxProps extends FlexBoxProps {\n gasPricePayload?: object\n}\n\nexport const ToggleRawPayloadBox: React.FC<ToggleRawPayloadBoxProps> = ({ gasPricePayload, ...props }) => {\n const [collapse, setCollapse] = useState(false)\n return gasPricePayload ? (\n <FlexCol rowGap={1} {...props}>\n <Button color=\"secondary\" sx={{ bgcolor: 'secondary.dark', color: 'white' }} variant=\"contained\" onClick={() => setCollapse(!collapse)}>\n Raw Payload\n </Button>\n <Collapse in={collapse}>\n <Paper elevation={4} sx={{ p: 2 }}>\n <pre>{JSON.stringify(gasPricePayload, null, 2)}</pre>\n </Paper>\n </Collapse>\n </FlexCol>\n ) : null\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/RawPayload/ToggleRawPayloadBox.tsx"],"sourcesContent":["import { Button, Collapse, Paper } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nexport interface ToggleRawPayloadBoxProps extends FlexBoxProps {\n gasPricePayload?: object\n}\n\nexport const ToggleRawPayloadBox: React.FC<ToggleRawPayloadBoxProps> = ({ gasPricePayload, ...props }) => {\n const [collapse, setCollapse] = useState(false)\n return gasPricePayload ? (\n <FlexCol rowGap={1} {...props}>\n <Button color=\"secondary\" sx={{ bgcolor: 'secondary.dark', color: 'white' }} variant=\"contained\" onClick={() => setCollapse(!collapse)}>\n Raw Payload\n </Button>\n <Collapse in={collapse}>\n <Paper elevation={4} sx={{ p: 2 }}>\n <pre>{JSON.stringify(gasPricePayload, null, 2)}</pre>\n </Paper>\n </Collapse>\n </FlexCol>\n ) : null\n}\n"],"mappings":";AAAA,SAAS,QAAQ,UAAU,aAAa;AACxC,SAAuB,eAAe;AACtC,SAAS,gBAAgB;AASrB,SACE,KADF;AAHG,IAAM,sBAA0D,CAAC,EAAE,iBAAiB,GAAG,MAAM,MAAM;AACxG,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,SAAO,kBACL,qBAAC,WAAQ,QAAQ,GAAI,GAAG,OACtB;AAAA,wBAAC,UAAO,OAAM,aAAY,IAAI,EAAE,SAAS,kBAAkB,OAAO,QAAQ,GAAG,SAAQ,aAAY,SAAS,MAAM,YAAY,CAAC,QAAQ,GAAG,yBAExI;AAAA,IACA,oBAAC,YAAS,IAAI,UACZ,8BAAC,SAAM,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,GAC9B,8BAAC,SAAK,eAAK,UAAU,iBAAiB,MAAM,CAAC,GAAE,GACjD,GACF;AAAA,KACF,IACE;AACN;","names":[]}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/RawPayload/ToggleRawPayloadBox.tsx
|
|
2
|
+
import { Button, Collapse, Paper } from "@mui/material";
|
|
3
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var ToggleRawPayloadBox = ({ gasPricePayload, ...props }) => {
|
|
7
|
+
const [collapse, setCollapse] = useState(false);
|
|
8
|
+
return gasPricePayload ? /* @__PURE__ */ jsxs(FlexCol, { rowGap: 1, ...props, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Button, { color: "secondary", sx: { bgcolor: "secondary.dark", color: "white" }, variant: "contained", onClick: () => setCollapse(!collapse), children: "Raw Payload" }),
|
|
10
|
+
/* @__PURE__ */ jsx(Collapse, { in: collapse, children: /* @__PURE__ */ jsx(Paper, { elevation: 4, sx: { p: 2 }, children: /* @__PURE__ */ jsx("pre", { children: JSON.stringify(gasPricePayload, null, 2) }) }) })
|
|
11
|
+
] }) : null;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
ToggleRawPayloadBox
|
|
15
|
+
};
|
|
2
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/RawPayload/
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/RawPayload/ToggleRawPayloadBox.tsx"],"sourcesContent":["import { Button, Collapse, Paper } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nexport interface ToggleRawPayloadBoxProps extends FlexBoxProps {\n gasPricePayload?: object\n}\n\nexport const ToggleRawPayloadBox: React.FC<ToggleRawPayloadBoxProps> = ({ gasPricePayload, ...props }) => {\n const [collapse, setCollapse] = useState(false)\n return gasPricePayload ? (\n <FlexCol rowGap={1} {...props}>\n <Button color=\"secondary\" sx={{ bgcolor: 'secondary.dark', color: 'white' }} variant=\"contained\" onClick={() => setCollapse(!collapse)}>\n Raw Payload\n </Button>\n <Collapse in={collapse}>\n <Paper elevation={4} sx={{ p: 2 }}>\n <pre>{JSON.stringify(gasPricePayload, null, 2)}</pre>\n </Paper>\n </Collapse>\n </FlexCol>\n ) : null\n}\n"],"mappings":";AAAA,SAAS,QAAQ,UAAU,aAAa;AACxC,SAAuB,eAAe;AACtC,SAAS,gBAAgB;AASrB,SACE,KADF;AAHG,IAAM,sBAA0D,CAAC,EAAE,iBAAiB,GAAG,MAAM,MAAM;AACxG,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,SAAO,kBACL,qBAAC,WAAQ,QAAQ,GAAI,GAAG,OACtB;AAAA,wBAAC,UAAO,OAAM,aAAY,IAAI,EAAE,SAAS,kBAAkB,OAAO,QAAQ,GAAG,SAAQ,aAAY,SAAS,MAAM,YAAY,CAAC,QAAQ,GAAG,yBAExI;AAAA,IACA,oBAAC,YAAS,IAAI,UACZ,8BAAC,SAAM,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,GAC9B,8BAAC,SAAK,eAAK,UAAU,iBAAiB,MAAM,CAAC,GAAE,GACjD,GACF;AAAA,KACF,IACE;AACN;","names":[]}
|