@omniumretail/component-library 0.1.13 → 0.1.15
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/.storybook/preview.js +1 -0
- package/dist/bundle.js +1766 -63
- package/dist/main.css +37 -0
- package/dist/types/components/Footer/Footer.stories.d.ts +5 -0
- package/dist/types/components/Footer/index.d.ts +4 -0
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +3 -1
- package/src/assets/images/omnium-retail-logo-white.png +0 -0
- package/src/components/Footer/Footer.stories.tsx +14 -0
- package/src/components/Footer/index.tsx +38 -0
- package/src/components/Footer/styles.module.scss +38 -0
- package/src/components/index.tsx +1 -0
- package/webpack.config.js +2 -1
package/dist/main.css
CHANGED
|
@@ -296,3 +296,40 @@
|
|
|
296
296
|
.e3BZiSKkbgvekUOREMi6 .ant-radio:hover .ant-radio-inner {
|
|
297
297
|
border-color: var(--color-orange);
|
|
298
298
|
}
|
|
299
|
+
/*!***************************************************************************************************************************************************************!*\
|
|
300
|
+
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Footer/styles.module.scss ***!
|
|
301
|
+
\***************************************************************************************************************************************************************/
|
|
302
|
+
.D8zh2JqbXPRwa7HPZoou {
|
|
303
|
+
display: flex;
|
|
304
|
+
justify-content: space-between;
|
|
305
|
+
align-items: center;
|
|
306
|
+
flex-wrap: nowrap;
|
|
307
|
+
gap: 0 16px;
|
|
308
|
+
background-color: var(--color-black);
|
|
309
|
+
position: fixed;
|
|
310
|
+
bottom: 0;
|
|
311
|
+
width: 100%;
|
|
312
|
+
padding: 12px 24px;
|
|
313
|
+
font-size: var(--font-size-body-1);
|
|
314
|
+
color: var(--color-grey-light);
|
|
315
|
+
height: 60px;
|
|
316
|
+
flex-direction: row;
|
|
317
|
+
text-align: left;
|
|
318
|
+
box-sizing: border-box;
|
|
319
|
+
}
|
|
320
|
+
.D8zh2JqbXPRwa7HPZoou .rLcS8I6I0aB1gd6Ro7Ix {
|
|
321
|
+
color: var(--grey2);
|
|
322
|
+
width: 100%;
|
|
323
|
+
margin-bottom: 4px;
|
|
324
|
+
}
|
|
325
|
+
.D8zh2JqbXPRwa7HPZoou .I18ixqhkBJrOHeIm9ELH {
|
|
326
|
+
margin-left: 8px;
|
|
327
|
+
}
|
|
328
|
+
.D8zh2JqbXPRwa7HPZoou .XVFO_EVWpXwEwbcS7OwM,
|
|
329
|
+
.D8zh2JqbXPRwa7HPZoou .I18ixqhkBJrOHeIm9ELH {
|
|
330
|
+
display: inline-block;
|
|
331
|
+
}
|
|
332
|
+
.D8zh2JqbXPRwa7HPZoou .Ch59mk3ENKwL_xUV4kwI {
|
|
333
|
+
height: 25px;
|
|
334
|
+
align-self: flex-end;
|
|
335
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omniumretail/component-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/bundle.js",
|
|
6
6
|
"typings": "./dist/types/index",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"jest-resolve": "^27.4.2",
|
|
45
45
|
"jest-watch-typeahead": "^1.0.0",
|
|
46
46
|
"mini-css-extract-plugin": "^2.7.2",
|
|
47
|
+
"moment": "^2.29.4",
|
|
47
48
|
"postcss": "^8.4.4",
|
|
48
49
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
49
50
|
"postcss-loader": "^6.2.1",
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"tailwindcss": "^3.0.2",
|
|
68
69
|
"terser-webpack-plugin": "^5.2.5",
|
|
69
70
|
"typescript": "^4.9.3",
|
|
71
|
+
"url-loader": "^4.1.1",
|
|
70
72
|
"web-vitals": "^2.1.0",
|
|
71
73
|
"webpack-dev-server": "^4.6.0",
|
|
72
74
|
"webpack-manifest-plugin": "^4.0.2",
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { Footer, FooterProps } from '.';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Footer',
|
|
6
|
+
component: Footer,
|
|
7
|
+
} as Meta;
|
|
8
|
+
|
|
9
|
+
const Template: Story<FooterProps> = (args) => <Footer {...args}></Footer>;
|
|
10
|
+
|
|
11
|
+
export const Primary = Template.bind({});
|
|
12
|
+
Primary.args = {
|
|
13
|
+
storeName: 'Levis'
|
|
14
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
import styles from './styles.module.scss';
|
|
4
|
+
import omniumLogo from '../../assets/images/omnium-retail-logo-white.png';
|
|
5
|
+
|
|
6
|
+
export interface FooterProps {
|
|
7
|
+
storeName: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Footer = (props: FooterProps) => {
|
|
11
|
+
const [date, setDate] = useState(moment());
|
|
12
|
+
const { storeName = 'Missing Store Name' } = props;
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const time = (function updateDate() {
|
|
16
|
+
const nextMinute = moment().add(1, 'minute');
|
|
17
|
+
return setTimeout(() => {
|
|
18
|
+
setDate(moment());
|
|
19
|
+
updateDate();
|
|
20
|
+
}, nextMinute.valueOf() - moment().valueOf());
|
|
21
|
+
}());
|
|
22
|
+
|
|
23
|
+
return () => clearTimeout(time);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className={styles.footer}>
|
|
28
|
+
<div className={styles.content}>
|
|
29
|
+
<div className={styles.brand}>{storeName}</div>
|
|
30
|
+
<div className={styles.date}>{date.format('DD/MM/yyyy')}</div>
|
|
31
|
+
<div className={styles.time}>{date.format('HH:mm')}</div>
|
|
32
|
+
</div>
|
|
33
|
+
<img src={omniumLogo} className={styles.omniumLogoImg} alt="omnium logo" />
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.footer {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
flex-wrap: nowrap;
|
|
6
|
+
gap: 0 16px;
|
|
7
|
+
background-color: var(--color-black);
|
|
8
|
+
position: fixed;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
padding: 12px 24px;
|
|
12
|
+
font-size: var(--font-size-body-1);
|
|
13
|
+
color: var(--color-grey-light);
|
|
14
|
+
height: 60px;
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
text-align: left;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
|
|
19
|
+
.brand {
|
|
20
|
+
color: var(--grey2);
|
|
21
|
+
width: 100%;
|
|
22
|
+
margin-bottom: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.time {
|
|
26
|
+
margin-left: 8px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.date,
|
|
30
|
+
.time {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.omniumLogoImg {
|
|
35
|
+
height: 25px;
|
|
36
|
+
align-self: flex-end;
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/components/index.tsx
CHANGED
package/webpack.config.js
CHANGED