@woosmap/ui 3.87.0 → 3.90.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
CHANGED
|
@@ -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
|
+
});
|
|
@@ -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>
|