Skip to content

Commit

Permalink
Temporary fixes for Jochen
Browse files Browse the repository at this point in the history
  • Loading branch information
TriangleJuice committed Mar 23, 2021
1 parent 0f5e9fe commit 4c6bcb6
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
35 changes: 35 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"react-input-mask": "^2.0.4",
"react-modal": "~3.5.1",
"react-scripts": "^4.0.3",
"react-svg": "^12.1.0",
"rollup-plugin-postcss": "^2.9.0",
"rollup-plugin-sass": "^1.2.2",
"rxjs": "^6.6.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/alert/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Icon from '../icon/src/Icon';
title="This is a success box!"
onClose={() => console.log('closed')}
closable={true}>
This is my child <Icon name="alarm-bell" />
This is my child <Icon name="test3" style={{stroke:'green'}} />
</Alert>
```

Expand Down
23 changes: 18 additions & 5 deletions packages/icon/src/Icon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import { render } from 'react-dom';
import { ReactSVG } from 'react-svg';
import classNames from 'classnames';

type Props = {
Expand All @@ -17,17 +19,28 @@ type Props = {
const Icon = ({ name, style, className, ariaLabel, onClick, qa }: Props) => {

const iconClass = classNames(className, 'ai');
const xlinkHref = `http://cdn.antwerpen.be/core_branding_scss/5.0.0-beta.2/assets/images/ai.svg#${name}`;

// const iconUrl = `https://cdn.antwerpen.be/core_branding_scss/5.0.0-beta.2/assets/icons/${name}.svg`; // Works
const iconUrl = `https://cdn.antwerpen.be/core_branding_scss/5.0.0-beta.2/assets/images/ai.svg#${name}`; // Doesn't work
return (

// Option 1
<span className={iconClass} style={style} data-qa={qa} onClick={onClick}>
<svg aria-hidden="true"><use xlinkHref={xlinkHref} /></svg>
{ariaLabel && <span className="u-screen-reader-only">{ariaLabel}</span>}
<ReactSVG src={iconUrl} wrapper="span" className={iconClass} style={style} data-qa={qa} onClick={onClick} />
</span>
)

// const iconClass = classNames(className, `fa fa-${name} ${name}`);
// Option 2
// const iconClass = classNames(className, 'ai');
// const xlinkHref = `https://cdn.antwerpen.be/core_branding_scss/5.0.0-beta.2/assets/images/ai.svg#${name}`;
// return (
// <span className={iconClass} style={style} data-qa={qa} onClick={onClick}>
// <svg aria-hidden="true"><use href={xlinkHref} /></svg>
// {ariaLabel && <span className="u-screen-reader-only">{ariaLabel}</span>}
// </span>
// );

// Option 3
// const iconClass = classNames(className, `fa fa-${name} ${name}`);
// return (
// <React.Fragment>
// <span className={iconClass} style={style} data-qa={qa} aria-hidden="true" onClick={onClick}></span>
Expand Down

0 comments on commit 4c6bcb6

Please sign in to comment.