@woosmap/ui 3.88.0 → 3.91.0
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/package.json +1 -1
- package/src/components/Demo/MerchantDemo.styl +4 -4
- package/src/components/Demo/skeletondemo.styl +3 -0
- package/src/components/Icon/Icon.js +2 -1
- package/src/components/Icon/Icon.stories.js +1 -0
- package/src/components/Icon/Icon.test.js +10 -0
- package/src/components/ServiceMessage/ServiceMessage.js +1 -1
- package/src/components/ServiceMessage/ServiceMessage.test.js +28 -11
- package/src/icons/customers-services.svg +1 -1
package/package.json
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
width 100%
|
|
9
9
|
zoom .9
|
|
10
10
|
padding 2rem
|
|
11
|
-
background
|
|
11
|
+
background #31436C
|
|
12
|
+
background radial-gradient(circle, #31436C 0%, #262D3E 100%)
|
|
12
13
|
&__mobilewrapper
|
|
13
14
|
trans()
|
|
14
15
|
position relative
|
|
@@ -68,9 +69,8 @@
|
|
|
68
69
|
.merchant__mobile--details--dirty &
|
|
69
70
|
opacity 1
|
|
70
71
|
&__button
|
|
71
|
-
sq(3)
|
|
72
72
|
position absolute
|
|
73
|
-
background-color transparent
|
|
73
|
+
background-color transparent !important
|
|
74
74
|
left -.6rem
|
|
75
75
|
padding 0
|
|
76
76
|
display flex
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
justify-content center
|
|
79
79
|
flex-shrink 0
|
|
80
80
|
&:hover
|
|
81
|
-
background-color $dark30
|
|
81
|
+
background-color $dark30 !important
|
|
82
82
|
|
|
83
83
|
&__section
|
|
84
84
|
padding 1.4rem 2rem
|
|
@@ -426,7 +426,8 @@ const Icons = {
|
|
|
426
426
|
class Icon extends Component {
|
|
427
427
|
render() {
|
|
428
428
|
const { icon, size, className, title, testId } = this.props;
|
|
429
|
-
const IconComponent = Icons[icon];
|
|
429
|
+
const IconComponent = Object.keys(Icons).includes(icon) ? Icons[icon] : Woosmap;
|
|
430
|
+
|
|
430
431
|
return (
|
|
431
432
|
<IconComponent
|
|
432
433
|
className={cl('icon', className)}
|
|
@@ -32,3 +32,4 @@ export const All = () => <div className="flex-wrap">{Object.keys(Icons).map(draw
|
|
|
32
32
|
export const Website = () => <div className="flex-wrap">{Object.keys(WebsiteIcons).map(drawIcon)}</div>;
|
|
33
33
|
export const Console = () => <div className="flex-wrap">{Object.keys(ConsoleIcons).map(drawIcon)}</div>;
|
|
34
34
|
export const Products = () => <div className="flex-wrap">{Object.keys(ProductsIcons).map(drawIcon)}</div>;
|
|
35
|
+
export const NotExisting = () => <div className="flex-wrap">{drawIcon('not-existing-icon')}</div>;
|
|
@@ -40,3 +40,13 @@ it('renders all icon components', () => {
|
|
|
40
40
|
const { Icons } = Icon;
|
|
41
41
|
Object.keys(Icons).forEach(isIconRendered);
|
|
42
42
|
});
|
|
43
|
+
|
|
44
|
+
it('renders woosmap icon component when using bad icon name', () => {
|
|
45
|
+
const { getByTestId } = render(<Icon icon="no-existing-icon" size={64} />);
|
|
46
|
+
|
|
47
|
+
const result = getByTestId('icon-no-existing-icon');
|
|
48
|
+
|
|
49
|
+
expect(result).toHaveClass('icon');
|
|
50
|
+
expect(result).toHaveAttribute('width', '64');
|
|
51
|
+
expect(result).toHaveTextContent('woosmap');
|
|
52
|
+
});
|
|
@@ -42,6 +42,6 @@ ServiceMessage.defaultProps = {
|
|
|
42
42
|
|
|
43
43
|
ServiceMessage.propTypes = {
|
|
44
44
|
type: PropTypes.oneOf([undefined, 'success', 'error', 'warning', 'info']),
|
|
45
|
-
text: PropTypes.string,
|
|
45
|
+
text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
46
46
|
testId: PropTypes.string,
|
|
47
47
|
};
|
|
@@ -4,16 +4,33 @@ import { act } from 'react-dom/test-utils';
|
|
|
4
4
|
import '@testing-library/jest-dom/extend-expect';
|
|
5
5
|
import ServiceMessage from './ServiceMessage';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
describe('<ServiceMessage />', () => {
|
|
8
|
+
it('renders a ServiceMessage component ', () => {
|
|
9
|
+
const ref = React.createRef();
|
|
10
|
+
const { container } = render(
|
|
11
|
+
<div>
|
|
12
|
+
<ServiceMessage text="my message" ref={ref} />
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
act(() => {
|
|
16
|
+
ref.current.open();
|
|
17
|
+
});
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
expect(container.firstChild).toHaveTextContent('my message');
|
|
20
|
+
});
|
|
21
|
+
it('does not throw a proptype error if text is node', () => {
|
|
22
|
+
const ref = React.createRef();
|
|
23
|
+
const errorSpy = jest.spyOn(console, 'error');
|
|
24
|
+
const warnSpy = jest.spyOn(console, 'warn');
|
|
25
|
+
render(
|
|
26
|
+
<div>
|
|
27
|
+
<ServiceMessage text={<div>Some node</div>} ref={ref} />
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
act(() => {
|
|
31
|
+
ref.current.open();
|
|
32
|
+
});
|
|
33
|
+
expect(errorSpy).not.toHaveBeenCalled();
|
|
34
|
+
expect(warnSpy).not.toHaveBeenCalled();
|
|
35
|
+
});
|
|
19
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 37.486c3.248 0 6.546-1.2 8.401-3.057a1.501 1.501 0 0 0-2.122-2.121c-1.301 1.302-3.824 2.177-6.278 2.177s-4.978-.875-6.278-2.177a1.5 1.5 0 1 0-2.122 2.121c1.855 1.857 5.153 3.057 8.401 3.057Z"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 37.486c3.248 0 6.546-1.2 8.401-3.057a1.501 1.501 0 0 0-2.122-2.121c-1.301 1.302-3.824 2.177-6.278 2.177s-4.978-.875-6.278-2.177a1.5 1.5 0 1 0-2.122 2.121c1.855 1.857 5.153 3.057 8.401 3.057Z" /><path d="M64.111 37.855c2.279-2.987 3.649-6.702 3.649-10.741a17.64 17.64 0 0 0-1.154-6.252c.238-.244.45-.516.594-.839a2.894 2.894 0 0 0-.245-2.809l-.724-1.073 1.565-4.669a2.93 2.93 0 0 0-.343-2.577 2.929 2.929 0 0 0-2.248-1.306L50.104 6.523a1.486 1.486 0 0 0-.211 0L34.792 7.589a2.932 2.932 0 0 0-2.248 1.306 2.928 2.928 0 0 0-.343 2.576l1.565 4.67-.724 1.073a2.894 2.894 0 0 0-.245 2.809c.144.323.356.595.594.839a17.64 17.64 0 0 0-1.154 6.252c0 4.038 1.37 7.754 3.649 10.741-9.402 1.748-16.514 10.121-16.514 19.855v32.243a3.533 3.533 0 0 0 3.529 3.529h8.783a5.193 5.193 0 0 0 4.963-3.684H64.13a5.195 5.195 0 0 0 4.963 3.684h7.999a3.533 3.533 0 0 0 3.529-3.529V57.71c0-9.734-7.112-18.107-16.514-19.855ZM35.615 18.771l.609-.904h27.574l.634.898L50 20.804l-14.386-2.032Zm14.389-9.249 14.95.996-1.458 4.349H36.502l-1.453-4.289 14.955-1.056ZM36.212 21.885l13.579 1.918a1.473 1.473 0 0 0 .42 0l13.579-1.918c.636 1.672.971 3.428.971 5.23 0 8.139-6.621 14.76-14.76 14.76s-14.76-6.621-14.76-14.76c0-1.802.335-3.557.971-5.23Zm12.541 28.734c.12-.806.825-1.414 1.641-1.414s1.521.608 1.632 1.345l1.718 16.84a1.967 1.967 0 0 1-.39 1.489l-2.129 2.748a1.033 1.033 0 0 1-.832.408c-.192 0-.557-.053-.831-.408l-2.129-2.748c-.325-.42-.468-.963-.381-1.558l1.701-16.702Zm3.068-5.745-1.264 1.263a.234.234 0 0 1-.138.07l-.026-.002c-.009 0-.018.003-.028.003a.24.24 0 0 1-.138-.071l-1.263-1.263h2.856Zm25.805 45.079a.53.53 0 0 1-.529.529h-7.999a2.187 2.187 0 0 1-2.184-2.184V60.882a1.5 1.5 0 1 0-3 0v25.916H36.873V60.882a1.5 1.5 0 1 0-3 0v27.416c0 1.204-.98 2.184-2.185 2.184h-8.783a.53.53 0 0 1-.529-.529V57.71c0-8.843 6.892-16.366 15.688-17.126.112-.01.218-.033.321-.066a17.707 17.707 0 0 0 6.789 3.672 2.41 2.41 0 0 0 .695 1.831l1.409 1.409a4.744 4.744 0 0 0-1.502 2.815l-1.701 16.703a4.987 4.987 0 0 0 .985 3.769l2.129 2.748c.772.998 1.94 1.57 3.202 1.57s2.431-.572 3.203-1.57l2.129-2.748c.825-1.065 1.185-2.439.994-3.7l-1.718-16.84a4.64 4.64 0 0 0-1.489-2.751l1.404-1.404a2.405 2.405 0 0 0 .673-2.062 17.737 17.737 0 0 0 6.027-3.442c.103.032.209.056.321.066 8.797.761 15.688 8.284 15.688 17.126v32.243Z"/></svg>
|