@xyo-network/react-footer 2.25.52
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/LICENSE +165 -0
- package/README.md +69 -0
- package/babel.config.json +5 -0
- package/dist/cjs/Copyright.d.ts +6 -0
- package/dist/cjs/Copyright.js +36 -0
- package/dist/cjs/Copyright.js.map +1 -0
- package/dist/cjs/DeveloperLinks.d.ts +3 -0
- package/dist/cjs/DeveloperLinks.js +9 -0
- package/dist/cjs/DeveloperLinks.js.map +1 -0
- package/dist/cjs/Footer.d.ts +7 -0
- package/dist/cjs/Footer.js +27 -0
- package/dist/cjs/Footer.js.map +1 -0
- package/dist/cjs/Link.d.ts +3 -0
- package/dist/cjs/Link.js +41 -0
- package/dist/cjs/Link.js.map +1 -0
- package/dist/cjs/Links.d.ts +3 -0
- package/dist/cjs/Links.js +13 -0
- package/dist/cjs/Links.js.map +1 -0
- package/dist/cjs/MoreLinks.d.ts +3 -0
- package/dist/cjs/MoreLinks.js +9 -0
- package/dist/cjs/MoreLinks.js.map +1 -0
- package/dist/cjs/NetworkLinks.d.ts +3 -0
- package/dist/cjs/NetworkLinks.js +9 -0
- package/dist/cjs/NetworkLinks.js.map +1 -0
- package/dist/cjs/SocialLinks.d.ts +3 -0
- package/dist/cjs/SocialLinks.js +14 -0
- package/dist/cjs/SocialLinks.js.map +1 -0
- package/dist/cjs/SupportLinks.d.ts +3 -0
- package/dist/cjs/SupportLinks.js +9 -0
- package/dist/cjs/SupportLinks.js.map +1 -0
- package/dist/cjs/XyoTokens.d.ts +3 -0
- package/dist/cjs/XyoTokens.js +9 -0
- package/dist/cjs/XyoTokens.js.map +1 -0
- package/dist/cjs/index.d.ts +10 -0
- package/dist/cjs/index.js +14 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/docs.json +50061 -0
- package/dist/esm/Copyright.d.ts +6 -0
- package/dist/esm/Copyright.js +28 -0
- package/dist/esm/Copyright.js.map +1 -0
- package/dist/esm/DeveloperLinks.d.ts +3 -0
- package/dist/esm/DeveloperLinks.js +5 -0
- package/dist/esm/DeveloperLinks.js.map +1 -0
- package/dist/esm/Footer.d.ts +7 -0
- package/dist/esm/Footer.js +21 -0
- package/dist/esm/Footer.js.map +1 -0
- package/dist/esm/Link.d.ts +3 -0
- package/dist/esm/Link.js +35 -0
- package/dist/esm/Link.js.map +1 -0
- package/dist/esm/Links.d.ts +3 -0
- package/dist/esm/Links.js +7 -0
- package/dist/esm/Links.js.map +1 -0
- package/dist/esm/MoreLinks.d.ts +3 -0
- package/dist/esm/MoreLinks.js +5 -0
- package/dist/esm/MoreLinks.js.map +1 -0
- package/dist/esm/NetworkLinks.d.ts +3 -0
- package/dist/esm/NetworkLinks.js +5 -0
- package/dist/esm/NetworkLinks.js.map +1 -0
- package/dist/esm/SocialLinks.d.ts +3 -0
- package/dist/esm/SocialLinks.js +10 -0
- package/dist/esm/SocialLinks.js.map +1 -0
- package/dist/esm/SupportLinks.d.ts +3 -0
- package/dist/esm/SupportLinks.js +5 -0
- package/dist/esm/SupportLinks.js.map +1 -0
- package/dist/esm/XyoTokens.d.ts +3 -0
- package/dist/esm/XyoTokens.js +5 -0
- package/dist/esm/XyoTokens.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +84 -0
- package/src/Copyright.tsx +47 -0
- package/src/DeveloperLinks.tsx +14 -0
- package/src/Footer.stories.tsx +32 -0
- package/src/Footer.tsx +64 -0
- package/src/Link.tsx +35 -0
- package/src/Links.tsx +13 -0
- package/src/MoreLinks.tsx +12 -0
- package/src/NetworkLinks.tsx +13 -0
- package/src/SocialLinks.tsx +39 -0
- package/src/SupportLinks.tsx +11 -0
- package/src/XyoTokens.tsx +15 -0
- package/src/index.ts +10 -0
- package/typedoc.json +18 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
|
3
|
+
import { FlexRow } from '@xylabs/react-flexbox';
|
|
4
|
+
import { FooterLink } from './Link';
|
|
5
|
+
const footerLinks = [
|
|
6
|
+
{
|
|
7
|
+
href: 'https://xylabs.com/',
|
|
8
|
+
title: `Copyright © ${new Date().getFullYear()} XY Labs, Inc.`,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
href: 'https://xyo.network/',
|
|
12
|
+
title: 'XYO Foundation',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
href: 'https://xylabs.com/privacy/',
|
|
16
|
+
title: 'Privacy',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
href: 'https://xylabs.com/terms/',
|
|
20
|
+
title: 'Terms',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
href: 'https://xylabs.com/jobs',
|
|
24
|
+
title: 'Careers',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
export const Copyright = ({ style, onMore, ...props }) => (_jsxs(FlexRow, { flexWrap: "wrap", textTransform: "uppercase", style: { opacity: 0.6, ...style }, ...props, children: [footerLinks.map((footerLink, index) => (_jsx(FooterLink, { noWrap: true, paddingX: 1, margin: 0, ...footerLink, children: _jsx("small", { children: footerLink.title }) }, index))), onMore ? (_jsx(FlexRow, { style: { cursor: 'pointer' }, paddingX: 0.5, onClick: onMore, children: _jsx(MoreHorizIcon, { color: "primary", fontSize: "small" }) })) : null] }));
|
|
28
|
+
//# sourceMappingURL=Copyright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Copyright.js","sourceRoot":"","sources":["../../src/Copyright.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAA;AAEzD,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAMnC,MAAM,WAAW,GAAk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|
|
3
|
+
import { FooterLinks } from './Links';
|
|
4
|
+
export const DeveloperLinks = (props) => (_jsxs(FooterLinks, { title: "Developer", ...props, children: [_jsx(FooterLink, { href: "https://xyo.network/developer", children: "Overview" }), _jsx(FooterLink, { href: "https://xyo.network/developer/get-started", children: "Get Started" }), _jsx(FooterLink, { href: "https://xyo.network/developer", children: "SDKs" }), _jsx(FooterLink, { href: "https://github.com/xyoraclenetwork", children: "Open Source Github" }), _jsx(FooterLink, { href: "https://xyo.network/docs/sdk/js", children: "Documentation" })] }));
|
|
5
|
+
//# sourceMappingURL=DeveloperLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeveloperLinks.js","sourceRoot":"","sources":["../../src/DeveloperLinks.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,CAAC,MAAM,cAAc,GAA2B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/D,MAAC,WAAW,IAAC,KAAK,EAAC,WAAW,KAAK,KAAK,aACtC,KAAC,UAAU,IAAC,IAAI,EAAC,+BAA+B,yBAAsB,EACtE,KAAC,UAAU,IAAC,IAAI,EAAC,2CAA2C,4BAAyB,EACrF,KAAC,UAAU,IAAC,IAAI,EAAC,+BAA+B,qBAAkB,EAClE,KAAC,UAAU,IAAC,IAAI,EAAC,oCAAoC,mCAAgC,EACrF,KAAC,UAAU,IAAC,IAAI,EAAC,iCAAiC,8BAA2B,IACjE,CACf,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Container, Grid } from '@mui/material';
|
|
3
|
+
import { FlexCol, FlexRow } from '@xylabs/react-flexbox';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { Copyright } from './Copyright';
|
|
6
|
+
import { DeveloperLinks } from './DeveloperLinks';
|
|
7
|
+
import { MoreLinks } from './MoreLinks';
|
|
8
|
+
import { NetworkLinks } from './NetworkLinks';
|
|
9
|
+
import { SocialLinks } from './SocialLinks';
|
|
10
|
+
import { SupportLinks } from './SupportLinks';
|
|
11
|
+
import { XyoTokens } from './XyoTokens';
|
|
12
|
+
export const Footer = ({ dynamicHeight = false, ...props }) => {
|
|
13
|
+
const [more, setMore] = useState(false);
|
|
14
|
+
const onMore = () => {
|
|
15
|
+
setMore(!more);
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs(FlexCol, { onMouseLeave: () => {
|
|
18
|
+
setMore(false);
|
|
19
|
+
}, alignItems: "stretch", ...props, children: [more || !dynamicHeight ? (_jsx(FlexRow, { alignItems: "flex-start", children: _jsx(Container, { children: _jsxs(Grid, { container: true, justifyContent: "space-between", alignItems: "flex-start", children: [_jsx(Grid, { item: true, xs: 12, md: 2, children: _jsx(SocialLinks, { alignItems: "flex-start" }) }), _jsx(Grid, { item: true, xs: 6, md: 2, children: _jsx(NetworkLinks, { alignItems: "flex-start" }) }), _jsx(Grid, { item: true, xs: 6, md: 2, children: _jsx(XyoTokens, { alignItems: "flex-start" }) }), _jsx(Grid, { item: true, xs: 6, md: 2, children: _jsx(DeveloperLinks, { alignItems: "flex-start" }) }), _jsx(Grid, { item: true, xs: 6, md: 2, children: _jsx(MoreLinks, { alignItems: "flex-start" }) }), _jsx(Grid, { item: true, xs: 6, md: 2, children: _jsx(SupportLinks, { alignItems: "flex-start" }) })] }) }) })) : null, _jsx(FlexRow, { children: _jsx(Container, { children: _jsx(Copyright, { onMore: onMore }) }) })] }));
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/Footer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,E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,CAAC,EAAE,EAAE,EAAE,CAAC,YACrB,KAAC,YAAY,IAAC,UAAU,EAAC,YAAY,GAAG,GACnC,EACP,KAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACrB,KAAC,SAAS,IAAC,UAAU,EAAC,YAAY,GAAG,GAChC,EACP,KAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACrB,KAAC,cAAc,IAAC,UAAU,EAAC,YAAY,GAAG,GACrC,EACP,KAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACrB,KAAC,SAAS,IAAC,UAAU,EAAC,YAAY,GAAG,GAChC,EACP,KAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACrB,KAAC,YAAY,IAAC,UAAU,EAAC,YAAY,GAAG,GACnC,IACF,GACG,GACJ,CACX,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,OAAO,cACN,KAAC,SAAS,cACR,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,GAAI,GACnB,GACJ,IACF,CACX,CAAA;AACH,CAAC,CAAA"}
|
package/dist/esm/Link.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LinkEx } from '@xylabs/react-common';
|
|
3
|
+
import { assertEx } from '@xylabs/sdk-js';
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* FooterLink automatically uses a local To if the link is to the current domain
|
|
7
|
+
* If the link is not local, it defaults to target being _blank
|
|
8
|
+
* In the case of 'beta' domains, it navigates correctly
|
|
9
|
+
*/
|
|
10
|
+
const convertToBetaIfNeeded = (url, currentUrl = new URL(document.location.href)) => {
|
|
11
|
+
const urlObj = typeof url === 'string' ? new URL(url) : url;
|
|
12
|
+
const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl;
|
|
13
|
+
const currentHostnameParts = currentUrlObj.hostname.split('.');
|
|
14
|
+
const beta = currentHostnameParts.shift() === 'beta';
|
|
15
|
+
if (beta) {
|
|
16
|
+
const currentHostnameWithoutBeta = currentHostnameParts.join('.');
|
|
17
|
+
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
18
|
+
urlObj.hostname = currentUrlObj.hostname;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return urlObj;
|
|
22
|
+
};
|
|
23
|
+
export const FooterLink = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {
|
|
24
|
+
const url = new URL(assertEx(href, 'href not set'));
|
|
25
|
+
assertEx(url.hostname, 'Hostname is required in href');
|
|
26
|
+
const convertedUrl = convertToBetaIfNeeded(url);
|
|
27
|
+
if (document.location.hostname === convertedUrl.hostname) {
|
|
28
|
+
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname;
|
|
29
|
+
return _jsx(LinkEx, { margin: margin, to: to, target: target, variant: variant, ...props });
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return _jsx(LinkEx, { margin: margin, href: href, target: target ?? '_blank', variant: variant, ...props });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/Link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;;;GAKG;AAEH,MAAM,qBAAqB,GAAG,CAAC,GAAiB,EAAE,UAAU,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE;IAChG,MAAM,MAAM,GAAG,OAAO,GAAG,KAAK,QAAQ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,CAAA;QAClG,OAAO,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAM,KAAK,GAAI,CAAA;KACvF;SAAM;QACL,OAAO,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,QAAQ,EAAE,OAAO,EAAE,OAAO,KAAM,KAAK,GAAI,CAAA;KACvG;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from '@mui/material';
|
|
3
|
+
import { FlexCol } from '@xylabs/react-flexbox';
|
|
4
|
+
export const FooterLinks = ({ children, title, ...props }) => {
|
|
5
|
+
return (_jsxs(FlexCol, { margin: 1, justifyContent: "flex-start", title: title, ...props, children: [_jsx(Typography, { margin: 0.5, variant: "h6", noWrap: true, children: title }), children] }));
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=Links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Links.js","sourceRoot":"","sources":["../../src/Links.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE7D,MAAM,CAAC,MAAM,WAAW,GAA2B,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACnF,OAAO,CACL,MAAC,OAAO,IAAC,MAAM,EAAE,CAAC,EAAE,cAAc,EAAC,YAAY,EAAC,KAAK,EAAE,KAAK,KAAM,KAAK,aACrE,KAAC,UAAU,IAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAC,IAAI,EAAC,MAAM,kBACzC,KAAK,GACK,EACZ,QAAQ,IACD,CACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FooterLink } from './Link';
|
|
3
|
+
import { FooterLinks } from './Links';
|
|
4
|
+
export const MoreLinks = (props) => (_jsxs(FooterLinks, { title: "More", ...props, children: [_jsx(FooterLink, { href: "https://xyo.network/partners", children: "Partners" }), _jsx(FooterLink, { href: "https://xyo.network/fhr", children: "FHR" }), _jsx(FooterLink, { href: "https://xyo.network/brand", children: "Brand" })] }));
|
|
5
|
+
//# sourceMappingURL=MoreLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoreLinks.js","sourceRoot":"","sources":["../../src/MoreLinks.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,CAAC,MAAM,SAAS,GAA2B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1D,MAAC,WAAW,IAAC,KAAK,EAAC,MAAM,KAAK,KAAK,aACjC,KAAC,UAAU,IAAC,IAAI,EAAC,8BAA8B,yBAAsB,EACrE,KAAC,UAAU,IAAC,IAAI,EAAC,yBAAyB,oBAAiB,EAC3D,KAAC,UAAU,IAAC,IAAI,EAAC,2BAA2B,sBAAmB,IACnD,CACf,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FooterLink } from './Link';
|
|
3
|
+
import { FooterLinks } from './Links';
|
|
4
|
+
export const NetworkLinks = (props) => (_jsxs(FooterLinks, { title: "Network", ...props, children: [_jsx(FooterLink, { href: "https://xyo.network/network", children: "Overview" }), _jsx(FooterLink, { href: "https://xyo.network/network/bound-witness", children: "Bound Witness" }), _jsx(FooterLink, { href: "https://xyo.network/network/proof-of-origin", children: "Proof Of Origin" }), _jsx(FooterLink, { href: "https://xyo.network/papers", children: "White Paper" })] }));
|
|
5
|
+
//# sourceMappingURL=NetworkLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkLinks.js","sourceRoot":"","sources":["../../src/NetworkLinks.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,CAAC,MAAM,YAAY,GAA2B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC7D,MAAC,WAAW,IAAC,KAAK,EAAC,SAAS,KAAK,KAAK,aACpC,KAAC,UAAU,IAAC,IAAI,EAAC,6BAA6B,yBAAsB,EACpE,KAAC,UAAU,IAAC,IAAI,EAAC,2CAA2C,8BAA2B,EACvF,KAAC,UAAU,IAAC,IAAI,EAAC,6CAA6C,gCAA6B,EAC3F,KAAC,UAAU,IAAC,IAAI,EAAC,4BAA4B,4BAAyB,IAC1D,CACf,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Facebook, Instagram, LinkedIn, Reddit, Telegram, Twitter, YouTube } from '@mui/icons-material';
|
|
3
|
+
import { FlexRow } from '@xylabs/react-flexbox';
|
|
4
|
+
import { FaDiscord } from 'react-icons/fa';
|
|
5
|
+
import { FooterLink } from './Link';
|
|
6
|
+
import { FooterLinks } from './Links';
|
|
7
|
+
export const SocialLinks = (props) => {
|
|
8
|
+
return (_jsx(FooterLinks, { title: "XYO Socials", ...props, children: _jsxs(FlexRow, { flexWrap: "wrap", justifyContent: "flex-start", children: [_jsx(FooterLink, { href: "https://business.facebook.com/OfficialXYO/", children: _jsx(Facebook, {}) }), _jsx(FooterLink, { href: "https://twitter.com/OfficialXYO", children: _jsx(Twitter, {}) }), _jsx(FooterLink, { href: "https://www.instagram.com/officialxyo/", children: _jsx(Instagram, {}) }), _jsx(FooterLink, { href: "https://t.me/xyonetwork", children: _jsx(Telegram, {}) }), _jsx(FooterLink, { href: "https://www.reddit.com/r/XYONetwork/", children: _jsx(Reddit, {}) }), _jsx(FooterLink, { href: "https://www.youtube.com/channel/UCyZDqb9pgntVHJVt1pxXtsw", children: _jsx(YouTube, {}) }), _jsx(FooterLink, { href: "https://www.linkedin.com/company/officialxyo/", children: _jsx(LinkedIn, {}) }), _jsx(FooterLink, { href: "https://discord.com/channels/935586624392298547/935586625101103227", children: _jsx(FaDiscord, {}) })] }) }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=SocialLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialLinks.js","sourceRoot":"","sources":["../../src/SocialLinks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACvG,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,CAAC,MAAM,WAAW,GAA2B,CAAC,KAAK,EAAE,EAAE;IAC3D,OAAO,CACL,KAAC,WAAW,IAAC,KAAK,EAAC,aAAa,KAAK,KAAK,YACxC,MAAC,OAAO,IAAC,QAAQ,EAAC,MAAM,EAAC,cAAc,EAAC,YAAY,aAClD,KAAC,UAAU,IAAC,IAAI,EAAC,4CAA4C,YAC3D,KAAC,QAAQ,KAAG,GACD,EACb,KAAC,UAAU,IAAC,IAAI,EAAC,iCAAiC,YAChD,KAAC,OAAO,KAAG,GACA,EACb,KAAC,UAAU,IAAC,IAAI,EAAC,wCAAwC,YACvD,KAAC,SAAS,KAAG,GACF,EACb,KAAC,UAAU,IAAC,IAAI,EAAC,yBAAyB,YACxC,KAAC,QAAQ,KAAG,GACD,EACb,KAAC,UAAU,IAAC,IAAI,EAAC,sCAAsC,YACrD,KAAC,MAAM,KAAG,GACC,EACb,KAAC,UAAU,IAAC,IAAI,EAAC,0DAA0D,YACzE,KAAC,OAAO,KAAG,GACA,EACb,KAAC,UAAU,IAAC,IAAI,EAAC,+CAA+C,YAC9D,KAAC,QAAQ,KAAG,GACD,EACb,KAAC,UAAU,IAAC,IAAI,EAAC,oEAAoE,YACnF,KAAC,SAAS,KAAG,GACF,IACL,GACE,CACf,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FooterLink } from './Link';
|
|
3
|
+
import { FooterLinks } from './Links';
|
|
4
|
+
export const SupportLinks = (props) => (_jsxs(FooterLinks, { title: "Support", ...props, children: [_jsx(FooterLink, { href: "https://support.xy.company/hc/en-us/categories/360001417734", children: "Help Center" }), _jsx(FooterLink, { href: "https://support.xy.company/hc/en-us/requests/new", children: "Contact Support" })] }));
|
|
5
|
+
//# sourceMappingURL=SupportLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportLinks.js","sourceRoot":"","sources":["../../src/SupportLinks.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,CAAC,MAAM,YAAY,GAA2B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC7D,MAAC,WAAW,IAAC,KAAK,EAAC,SAAS,KAAK,KAAK,aACpC,KAAC,UAAU,IAAC,IAAI,EAAC,6DAA6D,4BAAyB,EACvG,KAAC,UAAU,IAAC,IAAI,EAAC,kDAAkD,gCAA6B,IACpF,CACf,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FooterLink } from './Link';
|
|
3
|
+
import { FooterLinks } from './Links';
|
|
4
|
+
export const XyoTokens = (props) => (_jsxs(FooterLinks, { title: "XYO Tokens", ...props, children: [_jsx(FooterLink, { href: "https://xyo.network/token", children: "About" }), _jsx(FooterLink, { href: "https://xyo.network/token/exchange", children: "Exchanges" }), _jsx(FooterLink, { href: "https://xyo.network/token/price", children: "Prices" }), _jsx(FooterLink, { href: "https://xyo.network/token/wallet", children: "Wallets" }), _jsx(FooterLink, { href: "https://etherscan.io/address/0x55296f69f40ea6d20e478533c15a6b08b654e758", children: "Contract" })] }));
|
|
5
|
+
//# sourceMappingURL=XyoTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XyoTokens.js","sourceRoot":"","sources":["../../src/XyoTokens.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,CAAC,MAAM,SAAS,GAA2B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1D,MAAC,WAAW,IAAC,KAAK,EAAC,YAAY,KAAK,KAAK,aACvC,KAAC,UAAU,IAAC,IAAI,EAAC,2BAA2B,sBAAmB,EAC/D,KAAC,UAAU,IAAC,IAAI,EAAC,oCAAoC,0BAAuB,EAC5E,KAAC,UAAU,IAAC,IAAI,EAAC,iCAAiC,uBAAoB,EACtE,KAAC,UAAU,IAAC,IAAI,EAAC,kCAAkC,wBAAqB,EACxE,KAAC,UAAU,IAAC,IAAI,EAAC,yEAAyE,yBAAsB,IACpG,CACf,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './Copyright';
|
|
2
|
+
export * from './DeveloperLinks';
|
|
3
|
+
export * from './Footer';
|
|
4
|
+
export * from './Link';
|
|
5
|
+
export * from './Links';
|
|
6
|
+
export * from './MoreLinks';
|
|
7
|
+
export * from './NetworkLinks';
|
|
8
|
+
export * from './SocialLinks';
|
|
9
|
+
export * from './SupportLinks';
|
|
10
|
+
export * from './XyoTokens';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './Copyright';
|
|
2
|
+
export * from './DeveloperLinks';
|
|
3
|
+
export * from './Footer';
|
|
4
|
+
export * from './Link';
|
|
5
|
+
export * from './Links';
|
|
6
|
+
export * from './MoreLinks';
|
|
7
|
+
export * from './NetworkLinks';
|
|
8
|
+
export * from './SocialLinks';
|
|
9
|
+
export * from './SupportLinks';
|
|
10
|
+
export * from './XyoTokens';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xyo-network/react-footer",
|
|
3
|
+
"author": {
|
|
4
|
+
"email": "support@xyo.network",
|
|
5
|
+
"name": "XYO Development Team",
|
|
6
|
+
"url": "https://xyo.network"
|
|
7
|
+
},
|
|
8
|
+
"bugs": {
|
|
9
|
+
"email": "support@xyo.network",
|
|
10
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@emotion/react": "^11.9.0",
|
|
14
|
+
"@emotion/styled": "^11.8.1",
|
|
15
|
+
"@mui/icons-material": "^5.8.3",
|
|
16
|
+
"@mui/material": "^5.8.3",
|
|
17
|
+
"@xylabs/react-common": "^2.12.23",
|
|
18
|
+
"@xylabs/react-flexbox": "^2.12.23",
|
|
19
|
+
"@xylabs/sdk-js": "^2.5.7",
|
|
20
|
+
"react": "^18.1.0",
|
|
21
|
+
"react-dom": "^18.1.0",
|
|
22
|
+
"react-icons": "^4.4.0",
|
|
23
|
+
"tslib": "^2.4.0"
|
|
24
|
+
},
|
|
25
|
+
"description": "Common React library for all XYO projects that use React",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/core": "^7.18.2",
|
|
28
|
+
"@babel/preset-env": "^7.18.2",
|
|
29
|
+
"@storybook/react": "^6.5.8",
|
|
30
|
+
"@xylabs/sdk-js": "^2.5.7",
|
|
31
|
+
"@xylabs/tsconfig": "^1.0.13"
|
|
32
|
+
},
|
|
33
|
+
"browser": "dist/esm/index.js",
|
|
34
|
+
"docs": "dist/docs.json",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"node": {
|
|
38
|
+
"import": "./dist/esm/index.js",
|
|
39
|
+
"require": "./dist/cjs/index.js"
|
|
40
|
+
},
|
|
41
|
+
"browser": {
|
|
42
|
+
"import": "./dist/esm/index.js",
|
|
43
|
+
"require": "./dist/cjs/index.js"
|
|
44
|
+
},
|
|
45
|
+
"default": "./dist/esm/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./dist/docs.json": {
|
|
48
|
+
"default": "./dist/docs.json"
|
|
49
|
+
},
|
|
50
|
+
"./package.json": "./package.json"
|
|
51
|
+
},
|
|
52
|
+
"main": "dist/cjs/index.js",
|
|
53
|
+
"module": "dist/esm/index.js",
|
|
54
|
+
"homepage": "https://xyo.network",
|
|
55
|
+
"keywords": [
|
|
56
|
+
"xyo",
|
|
57
|
+
"utility",
|
|
58
|
+
"typescript",
|
|
59
|
+
"react"
|
|
60
|
+
],
|
|
61
|
+
"license": "LGPL-3.0",
|
|
62
|
+
"resolutions": {
|
|
63
|
+
"@storybook/react/webpack": "^5",
|
|
64
|
+
"bn.js": "^5.2.0",
|
|
65
|
+
"react": "^18.1.0",
|
|
66
|
+
"react-dom": "^18.1.0",
|
|
67
|
+
"webpack": "^5"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"repository": {
|
|
73
|
+
"type": "git",
|
|
74
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"lint-pkg": "npmPkgJsonLint .",
|
|
78
|
+
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
|
|
79
|
+
},
|
|
80
|
+
"sideEffects": false,
|
|
81
|
+
"types": "dist/esm/index.d.ts",
|
|
82
|
+
"version": "2.25.52",
|
|
83
|
+
"packageManager": "yarn@3.1.1"
|
|
84
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import MoreHorizIcon from '@mui/icons-material/MoreHoriz'
|
|
2
|
+
import { LinkExProps } from '@xylabs/react-common'
|
|
3
|
+
import { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'
|
|
4
|
+
|
|
5
|
+
import { FooterLink } from './Link'
|
|
6
|
+
|
|
7
|
+
export interface CopyrightProps extends FlexBoxProps {
|
|
8
|
+
onMore?: () => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const footerLinks: LinkExProps[] = [
|
|
12
|
+
{
|
|
13
|
+
href: 'https://xylabs.com/',
|
|
14
|
+
title: `Copyright © ${new Date().getFullYear()} XY Labs, Inc.`,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
href: 'https://xyo.network/',
|
|
18
|
+
title: 'XYO Foundation',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
href: 'https://xylabs.com/privacy/',
|
|
22
|
+
title: 'Privacy',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
href: 'https://xylabs.com/terms/',
|
|
26
|
+
title: 'Terms',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
href: 'https://xylabs.com/jobs',
|
|
30
|
+
title: 'Careers',
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
export const Copyright: React.FC<CopyrightProps> = ({ style, onMore, ...props }) => (
|
|
35
|
+
<FlexRow flexWrap="wrap" textTransform="uppercase" style={{ opacity: 0.6, ...style }} {...props}>
|
|
36
|
+
{footerLinks.map((footerLink, index) => (
|
|
37
|
+
<FooterLink noWrap key={index} paddingX={1} margin={0} {...footerLink}>
|
|
38
|
+
<small>{footerLink.title}</small>
|
|
39
|
+
</FooterLink>
|
|
40
|
+
))}
|
|
41
|
+
{onMore ? (
|
|
42
|
+
<FlexRow style={{ cursor: 'pointer' }} paddingX={0.5} onClick={onMore}>
|
|
43
|
+
<MoreHorizIcon color="primary" fontSize="small" />
|
|
44
|
+
</FlexRow>
|
|
45
|
+
) : null}
|
|
46
|
+
</FlexRow>
|
|
47
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
|
+
|
|
3
|
+
import { FooterLink } from './Link'
|
|
4
|
+
import { FooterLinks } from './Links'
|
|
5
|
+
|
|
6
|
+
export const DeveloperLinks: React.FC<FlexBoxProps> = (props) => (
|
|
7
|
+
<FooterLinks title="Developer" {...props}>
|
|
8
|
+
<FooterLink href="https://xyo.network/developer">Overview</FooterLink>
|
|
9
|
+
<FooterLink href="https://xyo.network/developer/get-started">Get Started</FooterLink>
|
|
10
|
+
<FooterLink href="https://xyo.network/developer">SDKs</FooterLink>
|
|
11
|
+
<FooterLink href="https://github.com/xyoraclenetwork">Open Source Github</FooterLink>
|
|
12
|
+
<FooterLink href="https://xyo.network/docs/sdk/js">Documentation</FooterLink>
|
|
13
|
+
</FooterLinks>
|
|
14
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
2
|
+
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
|
+
|
|
4
|
+
import { Footer } from './Footer'
|
|
5
|
+
|
|
6
|
+
const StorybookEntry = {
|
|
7
|
+
argTypes: {},
|
|
8
|
+
component: Footer,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
page: null,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
title: 'footer/Footer',
|
|
15
|
+
} as ComponentMeta<typeof Footer>
|
|
16
|
+
|
|
17
|
+
const Template: ComponentStory<typeof Footer> = (args) => (
|
|
18
|
+
<FlexCol minHeight="80vh" justifyContent="flex-end">
|
|
19
|
+
<Footer {...args}></Footer>
|
|
20
|
+
</FlexCol>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const Default = Template.bind({})
|
|
24
|
+
Default.args = {}
|
|
25
|
+
|
|
26
|
+
const DynamicHeight = Template.bind({})
|
|
27
|
+
DynamicHeight.args = { dynamicHeight: true }
|
|
28
|
+
|
|
29
|
+
export { Default, DynamicHeight }
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line import/no-default-export
|
|
32
|
+
export default StorybookEntry
|
package/src/Footer.tsx
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Container, Grid } from '@mui/material'
|
|
2
|
+
import { FlexBoxProps, FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { Copyright } from './Copyright'
|
|
6
|
+
import { DeveloperLinks } from './DeveloperLinks'
|
|
7
|
+
import { MoreLinks } from './MoreLinks'
|
|
8
|
+
import { NetworkLinks } from './NetworkLinks'
|
|
9
|
+
import { SocialLinks } from './SocialLinks'
|
|
10
|
+
import { SupportLinks } from './SupportLinks'
|
|
11
|
+
import { XyoTokens } from './XyoTokens'
|
|
12
|
+
|
|
13
|
+
export interface FooterProps extends FlexBoxProps {
|
|
14
|
+
dynamicHeight?: boolean
|
|
15
|
+
footerHtmlElement?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Footer: React.FC<FooterProps> = ({ dynamicHeight = false, ...props }) => {
|
|
19
|
+
const [more, setMore] = useState(false)
|
|
20
|
+
const onMore = () => {
|
|
21
|
+
setMore(!more)
|
|
22
|
+
}
|
|
23
|
+
return (
|
|
24
|
+
<FlexCol
|
|
25
|
+
onMouseLeave={() => {
|
|
26
|
+
setMore(false)
|
|
27
|
+
}}
|
|
28
|
+
alignItems="stretch"
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
{more || !dynamicHeight ? (
|
|
32
|
+
<FlexRow alignItems="flex-start">
|
|
33
|
+
<Container>
|
|
34
|
+
<Grid container justifyContent="space-between" alignItems="flex-start">
|
|
35
|
+
<Grid item xs={12} md={2}>
|
|
36
|
+
<SocialLinks alignItems="flex-start" />
|
|
37
|
+
</Grid>
|
|
38
|
+
<Grid item xs={6} md={2}>
|
|
39
|
+
<NetworkLinks alignItems="flex-start" />
|
|
40
|
+
</Grid>
|
|
41
|
+
<Grid item xs={6} md={2}>
|
|
42
|
+
<XyoTokens alignItems="flex-start" />
|
|
43
|
+
</Grid>
|
|
44
|
+
<Grid item xs={6} md={2}>
|
|
45
|
+
<DeveloperLinks alignItems="flex-start" />
|
|
46
|
+
</Grid>
|
|
47
|
+
<Grid item xs={6} md={2}>
|
|
48
|
+
<MoreLinks alignItems="flex-start" />
|
|
49
|
+
</Grid>
|
|
50
|
+
<Grid item xs={6} md={2}>
|
|
51
|
+
<SupportLinks alignItems="flex-start" />
|
|
52
|
+
</Grid>
|
|
53
|
+
</Grid>
|
|
54
|
+
</Container>
|
|
55
|
+
</FlexRow>
|
|
56
|
+
) : null}
|
|
57
|
+
<FlexRow>
|
|
58
|
+
<Container>
|
|
59
|
+
<Copyright onMore={onMore} />
|
|
60
|
+
</Container>
|
|
61
|
+
</FlexRow>
|
|
62
|
+
</FlexCol>
|
|
63
|
+
)
|
|
64
|
+
}
|
package/src/Link.tsx
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LinkEx, LinkExProps } from '@xylabs/react-common'
|
|
2
|
+
import { assertEx } from '@xylabs/sdk-js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* FooterLink automatically uses a local To if the link is to the current domain
|
|
7
|
+
* If the link is not local, it defaults to target being _blank
|
|
8
|
+
* In the case of 'beta' domains, it navigates correctly
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const convertToBetaIfNeeded = (url: string | URL, currentUrl = new URL(document.location.href)) => {
|
|
12
|
+
const urlObj = typeof url === 'string' ? new URL(url) : url
|
|
13
|
+
const currentUrlObj = typeof currentUrl === 'string' ? new URL(currentUrl) : currentUrl
|
|
14
|
+
const currentHostnameParts = currentUrlObj.hostname.split('.')
|
|
15
|
+
const beta = currentHostnameParts.shift() === 'beta'
|
|
16
|
+
if (beta) {
|
|
17
|
+
const currentHostnameWithoutBeta = currentHostnameParts.join('.')
|
|
18
|
+
if (currentHostnameWithoutBeta === urlObj.hostname) {
|
|
19
|
+
urlObj.hostname = currentUrlObj.hostname
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return urlObj
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const FooterLink: React.FC<LinkExProps> = ({ target, href, margin = 0.5, variant = 'body2', ...props }) => {
|
|
26
|
+
const url = new URL(assertEx(href, 'href not set'))
|
|
27
|
+
assertEx(url.hostname, 'Hostname is required in href')
|
|
28
|
+
const convertedUrl = convertToBetaIfNeeded(url)
|
|
29
|
+
if (document.location.hostname === convertedUrl.hostname) {
|
|
30
|
+
const to = url.search.length > 0 ? `${convertedUrl.pathname}${convertedUrl.search}` : url.pathname
|
|
31
|
+
return <LinkEx margin={margin} to={to} target={target} variant={variant} {...props} />
|
|
32
|
+
} else {
|
|
33
|
+
return <LinkEx margin={margin} href={href} target={target ?? '_blank'} variant={variant} {...props} />
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/Links.tsx
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Typography } from '@mui/material'
|
|
2
|
+
import { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'
|
|
3
|
+
|
|
4
|
+
export const FooterLinks: React.FC<FlexBoxProps> = ({ children, title, ...props }) => {
|
|
5
|
+
return (
|
|
6
|
+
<FlexCol margin={1} justifyContent="flex-start" title={title} {...props}>
|
|
7
|
+
<Typography margin={0.5} variant="h6" noWrap>
|
|
8
|
+
{title}
|
|
9
|
+
</Typography>
|
|
10
|
+
{children}
|
|
11
|
+
</FlexCol>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
|
+
|
|
3
|
+
import { FooterLink } from './Link'
|
|
4
|
+
import { FooterLinks } from './Links'
|
|
5
|
+
|
|
6
|
+
export const MoreLinks: React.FC<FlexBoxProps> = (props) => (
|
|
7
|
+
<FooterLinks title="More" {...props}>
|
|
8
|
+
<FooterLink href="https://xyo.network/partners">Partners</FooterLink>
|
|
9
|
+
<FooterLink href="https://xyo.network/fhr">FHR</FooterLink>
|
|
10
|
+
<FooterLink href="https://xyo.network/brand">Brand</FooterLink>
|
|
11
|
+
</FooterLinks>
|
|
12
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
|
+
|
|
3
|
+
import { FooterLink } from './Link'
|
|
4
|
+
import { FooterLinks } from './Links'
|
|
5
|
+
|
|
6
|
+
export const NetworkLinks: React.FC<FlexBoxProps> = (props) => (
|
|
7
|
+
<FooterLinks title="Network" {...props}>
|
|
8
|
+
<FooterLink href="https://xyo.network/network">Overview</FooterLink>
|
|
9
|
+
<FooterLink href="https://xyo.network/network/bound-witness">Bound Witness</FooterLink>
|
|
10
|
+
<FooterLink href="https://xyo.network/network/proof-of-origin">Proof Of Origin</FooterLink>
|
|
11
|
+
<FooterLink href="https://xyo.network/papers">White Paper</FooterLink>
|
|
12
|
+
</FooterLinks>
|
|
13
|
+
)
|