@toptal/picasso-page 5.1.10 → 5.1.11
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-package/src/Page/Page.d.ts.map +1 -1
- package/dist-package/src/Page/Page.js +1 -1
- package/dist-package/src/Page/Page.js.map +1 -1
- package/dist-package/src/PageFooter/PageFooter.d.ts.map +1 -1
- package/dist-package/src/PageFooter/PageFooter.js +6 -14
- package/dist-package/src/PageFooter/PageFooter.js.map +1 -1
- package/dist-package/src/PageFooter/styles.d.ts +2 -3
- package/dist-package/src/PageFooter/styles.d.ts.map +1 -1
- package/dist-package/src/PageFooter/styles.js +9 -53
- package/dist-package/src/PageFooter/styles.js.map +1 -1
- package/package.json +1 -1
- package/src/Page/Page.tsx +7 -2
- package/src/Page/__snapshots__/test.tsx.snap +1 -2
- package/src/PageFooter/PageFooter.tsx +15 -18
- package/src/PageFooter/story/CopyrightContent.example.tsx +2 -2
- package/src/PageFooter/story/Default.example.tsx +2 -2
- package/src/PageFooter/story/RightContent.example.tsx +2 -2
- package/src/PageFooter/styles.ts +10 -57
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/Page/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGlE,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,iBAAiB,CAAA;IACzB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yEAAyE;IACzE,QAAQ,EAAE,SAAS,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,WAAW,iCAA4C,CAAA;AAOpE,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/Page/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGlE,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,iBAAiB,CAAA;IACzB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yEAAyE;IACzE,QAAQ,EAAE,SAAS,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,WAAW,iCAA4C,CAAA;AAOpE,eAAO,MAAM,IAAI,8EAkCf,CAAA;AAIF,eAAe,IAAI,CAAA"}
|
|
@@ -22,7 +22,7 @@ const useStyles = makeStyles(styles, {
|
|
|
22
22
|
export const Page = forwardRef(function Page(props, ref) {
|
|
23
23
|
const { children, className, hamburgerId = 'hamburger', style, width, fullWidth } = props, rest = __rest(props, ["children", "className", "hamburgerId", "style", "width", "fullWidth"]);
|
|
24
24
|
const classes = useStyles();
|
|
25
|
-
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className
|
|
25
|
+
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className, '[--content-padding-horizontal:1em] md:[--content-padding-horizontal:2em]', '[--header-height:3.5rem] [--content-width-wide:90em] [--content-width:75em]'), style: Object.assign({}, style) }),
|
|
26
26
|
React.createElement(PageContext.Provider, { value: { width, fullWidth } },
|
|
27
27
|
React.createElement(PageHamburgerContextProvider, { hamburgerId: hamburgerId }, children))));
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/Page/Page.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,MAAM,MAAM,UAAU,CAAA;AAc7B,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAmB,EAAE,CAAC,CAAA;AAEpE,MAAM,SAAS,GAAG,UAAU,CAAQ,MAAM,EAAE;IAC1C,IAAI,EAAE,MAAM;CACb,CAAC,CAAA;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAwB,SAAS,IAAI,CACjE,KAAK,EACL,GAAG;IAEH,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,GAAG,WAAW,EACzB,KAAK,EACL,KAAK,EACL,SAAS,KAEP,KAAK,EADJ,IAAI,UACL,KAAK,EARH,uEAQL,CAAQ,CAAA;IACT,MAAM,OAAO,GAAG,SAAS,EAAE,CAAA;IAE3B,OAAO,CACL,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/Page/Page.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,MAAM,MAAM,UAAU,CAAA;AAc7B,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAmB,EAAE,CAAC,CAAA;AAEpE,MAAM,SAAS,GAAG,UAAU,CAAQ,MAAM,EAAE;IAC1C,IAAI,EAAE,MAAM;CACb,CAAC,CAAA;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAwB,SAAS,IAAI,CACjE,KAAK,EACL,GAAG;IAEH,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,GAAG,WAAW,EACzB,KAAK,EACL,KAAK,EACL,SAAS,KAEP,KAAK,EADJ,IAAI,UACL,KAAK,EARH,uEAQL,CAAQ,CAAA;IACT,MAAM,OAAO,GAAG,SAAS,EAAE,CAAA;IAE3B,OAAO,CACL,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,OAAO,CAAC,IAAI,EACZ,SAAS,EACT,0EAA0E,EAC1E,6EAA6E,CAC9E,EACD,KAAK,EAAE,kBAAK,KAAK,CAAyB;QAE1C,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC/C,oBAAC,4BAA4B,IAAC,WAAW,EAAE,WAAW,IACnD,QAAQ,CACoB,CACV,CACnB,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AAEzB,eAAe,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageFooter.d.ts","sourceRoot":"","sources":["../../../src/PageFooter/PageFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAiC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PageFooter.d.ts","sourceRoot":"","sources":["../../../src/PageFooter/PageFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAiC,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAOvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;IACnE,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B,kDAAkD;IAClD,YAAY,CAAC,EAAE,SAAS,CAAA;CACzB;AAED,eAAO,MAAM,UAAU,2EAiCrB,CAAA;AAaF,eAAe,UAAU,CAAA"}
|
|
@@ -10,25 +10,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { useContext, forwardRef } from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import cx from 'classnames';
|
|
13
|
+
import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge';
|
|
15
14
|
import { PageContext } from '../Page';
|
|
16
|
-
import
|
|
17
|
-
const useStyles = makeStyles(styles, {
|
|
18
|
-
name: 'PicassoPageFooter',
|
|
19
|
-
});
|
|
15
|
+
import { getMaxWidthClass } from './styles';
|
|
20
16
|
export const PageFooter = forwardRef(function PageFooter(props, ref) {
|
|
21
17
|
const { className, style, rightContent, copyrightContent } = props, rest = __rest(props, ["className", "style", "rightContent", "copyrightContent"]);
|
|
22
|
-
const classes = useStyles();
|
|
23
18
|
const { width, fullWidth } = useContext(PageContext);
|
|
24
|
-
const contentClassnames =
|
|
25
|
-
|
|
26
|
-
[classes.wide]: width === 'wide',
|
|
27
|
-
}, classes.content);
|
|
28
|
-
return (React.createElement("footer", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className), style: style }),
|
|
19
|
+
const contentClassnames = twJoin(getMaxWidthClass({ width, fullWidth }), 'box-border', 'flex justify-between xs:max-lg:flex-col', 'text-white text-md leading-[1em]', 'mx-auto pt-2 pb-6 px-[--content-padding-horizontal]');
|
|
20
|
+
return (React.createElement("footer", Object.assign({}, rest, { ref: ref, className: twMerge('bg-[#262d3d] w-full', className), style: style }),
|
|
29
21
|
React.createElement("div", { className: contentClassnames },
|
|
30
|
-
React.createElement("div", { className:
|
|
31
|
-
React.createElement("div", { className:
|
|
22
|
+
React.createElement("div", { className: 'flex items-center justify-center mt-4' }, copyrightContent),
|
|
23
|
+
React.createElement("div", { className: 'flex items-center justify-center mt-4 xs:max-lg:-order-1 xs:max-md:flex-col' }, rightContent))));
|
|
32
24
|
});
|
|
33
25
|
const CopyrightContent = () => (React.createElement(React.Fragment, null, `© Copyright 2010 – ${new Date().getFullYear()} Toptal, LLC`));
|
|
34
26
|
PageFooter.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageFooter.js","sourceRoot":"","sources":["../../../src/PageFooter/PageFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PageFooter.js","sourceRoot":"","sources":["../../../src/PageFooter/PageFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAS3C,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAqB,SAAS,UAAU,CAC1E,KAAK,EACL,GAAG;IAEH,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAArE,0DAA6D,CAAQ,CAAA;IAC3E,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAA;IAEtE,MAAM,iBAAiB,GAAG,MAAM,CAC9B,gBAAgB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EACtC,YAAY,EACZ,yCAAyC,EACzC,kCAAkC,EAClC,qDAAqD,CACtD,CAAA;IAED,OAAO,CACL,gDACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,CAAC,qBAAqB,EAAE,SAAS,CAAC,EACpD,KAAK,EAAE,KAAK;QAEZ,6BAAK,SAAS,EAAE,iBAAiB;YAC/B,6BAAK,SAAS,EAAC,uCAAuC,IACnD,gBAAgB,CACb;YAEN,6BAAK,SAAS,EAAC,6EAA6E,IACzF,YAAY,CACT,CACF,CACC,CACV,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAC7B,0CAAG,sBAAsB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,cAAc,CAAI,CACpE,CAAA;AAED,UAAU,CAAC,YAAY,GAAG;IACxB,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,oBAAC,gBAAgB,OAAG;CACvC,CAAA;AAED,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,eAAe,UAAU,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
export default _default;
|
|
1
|
+
import type { PageContextProps } from '../Page/types';
|
|
2
|
+
export declare const getMaxWidthClass: ({ fullWidth, width }: PageContextProps) => "max-w-full" | "max-w-[--content-width-wide]" | "max-w-[--content-width]";
|
|
4
3
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,eAAO,MAAM,gBAAgB,yBAA0B,gBAAgB,8EAUtE,CAAA"}
|
|
@@ -1,54 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
justifyContent: 'space-between',
|
|
11
|
-
margin: '0 auto',
|
|
12
|
-
paddingTop: '0.5rem',
|
|
13
|
-
paddingBottom: '1.5rem',
|
|
14
|
-
paddingLeft: layout.contentMobilePaddingHorizontal,
|
|
15
|
-
paddingRight: layout.contentMobilePaddingHorizontal,
|
|
16
|
-
maxWidth: layout.contentWidth,
|
|
17
|
-
color: palette.common.white,
|
|
18
|
-
fontSize: '0.875rem',
|
|
19
|
-
lineHeight: '1em',
|
|
20
|
-
[screens('xs', 'sm', 'md')]: {
|
|
21
|
-
flexDirection: 'column',
|
|
22
|
-
},
|
|
23
|
-
[screens('md', 'lg', 'xl')]: {
|
|
24
|
-
paddingLeft: layout.contentPaddingHorizontal,
|
|
25
|
-
paddingRight: layout.contentPaddingHorizontal,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
centered: {},
|
|
29
|
-
wide: {
|
|
30
|
-
maxWidth: layout.contentWidthWide,
|
|
31
|
-
},
|
|
32
|
-
fullWidth: {
|
|
33
|
-
maxWidth: '100%',
|
|
34
|
-
},
|
|
35
|
-
left: {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
justifyContent: 'center',
|
|
39
|
-
marginTop: '1rem',
|
|
40
|
-
},
|
|
41
|
-
right: {
|
|
42
|
-
display: 'flex',
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'center',
|
|
45
|
-
marginTop: '1rem',
|
|
46
|
-
[screens('xs', 'sm', 'md')]: {
|
|
47
|
-
order: -1,
|
|
48
|
-
},
|
|
49
|
-
[screens('xs', 'sm')]: {
|
|
50
|
-
flexDirection: 'column',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
1
|
+
export const getMaxWidthClass = ({ fullWidth, width }) => {
|
|
2
|
+
if (fullWidth || width === 'full') {
|
|
3
|
+
return 'max-w-full';
|
|
4
|
+
}
|
|
5
|
+
if (width === 'wide') {
|
|
6
|
+
return 'max-w-[--content-width-wide]';
|
|
7
|
+
}
|
|
8
|
+
return 'max-w-[--content-width]';
|
|
9
|
+
};
|
|
54
10
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAoB,EAAE,EAAE;IACzE,IAAI,SAAS,IAAI,KAAK,KAAK,MAAM,EAAE;QACjC,OAAO,YAAY,CAAA;KACpB;IAED,IAAI,KAAK,KAAK,MAAM,EAAE;QACpB,OAAO,8BAA8B,CAAA;KACtC;IAED,OAAO,yBAAyB,CAAA;AAClC,CAAC,CAAA"}
|
package/package.json
CHANGED
package/src/Page/Page.tsx
CHANGED
|
@@ -47,8 +47,13 @@ export const Page = forwardRef<HTMLDivElement, Props>(function Page(
|
|
|
47
47
|
<div
|
|
48
48
|
{...rest}
|
|
49
49
|
ref={ref}
|
|
50
|
-
className={cx(
|
|
51
|
-
|
|
50
|
+
className={cx(
|
|
51
|
+
classes.root,
|
|
52
|
+
className,
|
|
53
|
+
'[--content-padding-horizontal:1em] md:[--content-padding-horizontal:2em]',
|
|
54
|
+
'[--header-height:3.5rem] [--content-width-wide:90em] [--content-width:75em]'
|
|
55
|
+
)}
|
|
56
|
+
style={{ ...style } as React.CSSProperties}
|
|
52
57
|
>
|
|
53
58
|
<PageContext.Provider value={{ width, fullWidth }}>
|
|
54
59
|
<PageHamburgerContextProvider hamburgerId={hamburgerId}>
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { ReactNode, HTMLAttributes } from 'react'
|
|
2
2
|
import React, { useContext, forwardRef } from 'react'
|
|
3
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
5
|
-
import cx from 'classnames'
|
|
6
3
|
import type { BaseProps } from '@toptal/picasso-shared'
|
|
4
|
+
import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge'
|
|
7
5
|
|
|
8
6
|
import { PageContext } from '../Page'
|
|
9
7
|
import type { PageContextProps } from '../Page/types'
|
|
10
|
-
import
|
|
8
|
+
import { getMaxWidthClass } from './styles'
|
|
11
9
|
|
|
12
10
|
export interface Props extends BaseProps, HTMLAttributes<HTMLElement> {
|
|
13
11
|
/** Content for copyright. You can override default if needed. */
|
|
@@ -16,37 +14,36 @@ export interface Props extends BaseProps, HTMLAttributes<HTMLElement> {
|
|
|
16
14
|
rightContent?: ReactNode
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
const useStyles = makeStyles<Theme>(styles, {
|
|
20
|
-
name: 'PicassoPageFooter',
|
|
21
|
-
})
|
|
22
|
-
|
|
23
17
|
export const PageFooter = forwardRef<HTMLElement, Props>(function PageFooter(
|
|
24
18
|
props,
|
|
25
19
|
ref
|
|
26
20
|
) {
|
|
27
21
|
const { className, style, rightContent, copyrightContent, ...rest } = props
|
|
28
|
-
const classes = useStyles()
|
|
29
22
|
const { width, fullWidth } = useContext<PageContextProps>(PageContext)
|
|
30
23
|
|
|
31
|
-
const contentClassnames =
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
const contentClassnames = twJoin(
|
|
25
|
+
getMaxWidthClass({ width, fullWidth }),
|
|
26
|
+
'box-border',
|
|
27
|
+
'flex justify-between xs:max-lg:flex-col',
|
|
28
|
+
'text-white text-md leading-[1em]',
|
|
29
|
+
'mx-auto pt-2 pb-6 px-[--content-padding-horizontal]'
|
|
37
30
|
)
|
|
38
31
|
|
|
39
32
|
return (
|
|
40
33
|
<footer
|
|
41
34
|
{...rest}
|
|
42
35
|
ref={ref}
|
|
43
|
-
className={
|
|
36
|
+
className={twMerge('bg-[#262d3d] w-full', className)}
|
|
44
37
|
style={style}
|
|
45
38
|
>
|
|
46
39
|
<div className={contentClassnames}>
|
|
47
|
-
<div className=
|
|
40
|
+
<div className='flex items-center justify-center mt-4'>
|
|
41
|
+
{copyrightContent}
|
|
42
|
+
</div>
|
|
48
43
|
|
|
49
|
-
<div className=
|
|
44
|
+
<div className='flex items-center justify-center mt-4 xs:max-lg:-order-1 xs:max-md:flex-col'>
|
|
45
|
+
{rightContent}
|
|
46
|
+
</div>
|
|
50
47
|
</div>
|
|
51
48
|
</footer>
|
|
52
49
|
)
|
package/src/PageFooter/styles.ts
CHANGED
|
@@ -1,60 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { createStyles } from '@material-ui/core/styles'
|
|
1
|
+
import type { PageContextProps } from '../Page/types'
|
|
3
2
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
width: '100%',
|
|
9
|
-
},
|
|
10
|
-
content: {
|
|
11
|
-
boxSizing: 'border-box',
|
|
12
|
-
display: 'flex',
|
|
13
|
-
justifyContent: 'space-between',
|
|
14
|
-
margin: '0 auto',
|
|
15
|
-
paddingTop: '0.5rem',
|
|
16
|
-
paddingBottom: '1.5rem',
|
|
17
|
-
paddingLeft: layout.contentMobilePaddingHorizontal,
|
|
18
|
-
paddingRight: layout.contentMobilePaddingHorizontal,
|
|
19
|
-
maxWidth: layout.contentWidth,
|
|
20
|
-
color: palette.common.white,
|
|
21
|
-
fontSize: '0.875rem',
|
|
22
|
-
lineHeight: '1em',
|
|
3
|
+
export const getMaxWidthClass = ({ fullWidth, width }: PageContextProps) => {
|
|
4
|
+
if (fullWidth || width === 'full') {
|
|
5
|
+
return 'max-w-full'
|
|
6
|
+
}
|
|
23
7
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
if (width === 'wide') {
|
|
9
|
+
return 'max-w-[--content-width-wide]'
|
|
10
|
+
}
|
|
27
11
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
paddingRight: layout.contentPaddingHorizontal,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
centered: {},
|
|
34
|
-
wide: {
|
|
35
|
-
maxWidth: layout.contentWidthWide,
|
|
36
|
-
},
|
|
37
|
-
fullWidth: {
|
|
38
|
-
maxWidth: '100%',
|
|
39
|
-
},
|
|
40
|
-
left: {
|
|
41
|
-
display: 'flex',
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
justifyContent: 'center',
|
|
44
|
-
marginTop: '1rem',
|
|
45
|
-
},
|
|
46
|
-
right: {
|
|
47
|
-
display: 'flex',
|
|
48
|
-
alignItems: 'center',
|
|
49
|
-
justifyContent: 'center',
|
|
50
|
-
marginTop: '1rem',
|
|
51
|
-
|
|
52
|
-
[screens('xs', 'sm', 'md')]: {
|
|
53
|
-
order: -1,
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
[screens('xs', 'sm')]: {
|
|
57
|
-
flexDirection: 'column',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
})
|
|
12
|
+
return 'max-w-[--content-width]'
|
|
13
|
+
}
|