-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move iconAlertCircle to a component so it can be used inside an SVG (#…
…489) * move iconAlertCircle to a component so it can be used inside svgs * alert icon thicker border. color grey outline in blockWaiverBanner
- Loading branch information
Showing
12 changed files
with
293 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react" | ||
|
||
const IconAlertCircle = () => ( | ||
<svg viewBox="-3 -3 54 54" className="c-icon-alert-circle"> | ||
<IconAlertCircleSvgNode /> | ||
</svg> | ||
) | ||
|
||
export const IconAlertCircleSvgNode = () => ( | ||
<> | ||
<circle cx="24" cy="24" className="c-icon-alert-circle__outline" r="27" /> | ||
<circle cx="24" cy="24" className="c-icon-alert-circle__fill" r="22.59" /> | ||
<g className="c-icon-alert-circle__exclamation-point"> | ||
<path d="m20.39 4.42h7.22a1.81 1.81 0 0 1 1.49 2.11l-1.49 23.22a1.73 1.73 0 0 1 -1.49 1.78h-4.24a1.73 1.73 0 0 1 -1.49-1.78l-1.49-23.22c-.07-1.13.61-2.11 1.49-2.11" /> | ||
<path d="m21.57 34.54h4.87a1.88 1.88 0 0 1 1.82 1.93v5.17a1.89 1.89 0 0 1 -1.82 1.94h-4.87a1.89 1.89 0 0 1 -1.83-1.94v-5.17a1.88 1.88 0 0 1 1.83-1.93" /> | ||
</g> | ||
</> | ||
) | ||
|
||
export default IconAlertCircle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
assets/tests/components/__snapshots__/iconAlertCircle.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders 1`] = ` | ||
<svg | ||
className="c-icon-alert-circle" | ||
viewBox="-3 -3 54 54" | ||
> | ||
<circle | ||
className="c-icon-alert-circle__outline" | ||
cx="24" | ||
cy="24" | ||
r="27" | ||
/> | ||
<circle | ||
className="c-icon-alert-circle__fill" | ||
cx="24" | ||
cy="24" | ||
r="22.59" | ||
/> | ||
<g | ||
className="c-icon-alert-circle__exclamation-point" | ||
> | ||
<path | ||
d="m20.39 4.42h7.22a1.81 1.81 0 0 1 1.49 2.11l-1.49 23.22a1.73 1.73 0 0 1 -1.49 1.78h-4.24a1.73 1.73 0 0 1 -1.49-1.78l-1.49-23.22c-.07-1.13.61-2.11 1.49-2.11" | ||
/> | ||
<path | ||
d="m21.57 34.54h4.87a1.88 1.88 0 0 1 1.82 1.93v5.17a1.89 1.89 0 0 1 -1.82 1.94h-4.87a1.89 1.89 0 0 1 -1.83-1.94v-5.17a1.88 1.88 0 0 1 1.83-1.93" | ||
/> | ||
</g> | ||
</svg> | ||
`; | ||
|
||
exports[`renders an unwrapped svg node 1`] = ` | ||
<svg> | ||
<circle | ||
className="c-icon-alert-circle__outline" | ||
cx="24" | ||
cy="24" | ||
r="27" | ||
/> | ||
<circle | ||
className="c-icon-alert-circle__fill" | ||
cx="24" | ||
cy="24" | ||
r="22.59" | ||
/> | ||
<g | ||
className="c-icon-alert-circle__exclamation-point" | ||
> | ||
<path | ||
d="m20.39 4.42h7.22a1.81 1.81 0 0 1 1.49 2.11l-1.49 23.22a1.73 1.73 0 0 1 -1.49 1.78h-4.24a1.73 1.73 0 0 1 -1.49-1.78l-1.49-23.22c-.07-1.13.61-2.11 1.49-2.11" | ||
/> | ||
<path | ||
d="m21.57 34.54h4.87a1.88 1.88 0 0 1 1.82 1.93v5.17a1.89 1.89 0 0 1 -1.82 1.94h-4.87a1.89 1.89 0 0 1 -1.83-1.94v-5.17a1.88 1.88 0 0 1 1.83-1.93" | ||
/> | ||
</g> | ||
</svg> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react" | ||
import renderer from "react-test-renderer" | ||
import IconAlertCircle, { | ||
IconAlertCircleSvgNode, | ||
} from "../../src/components/iconAlertCircle" | ||
|
||
test("renders", () => { | ||
const tree = renderer.create(<IconAlertCircle />).toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
|
||
test("renders an unwrapped svg node", () => { | ||
const tree = renderer | ||
.create( | ||
<svg> | ||
<IconAlertCircleSvgNode /> | ||
</svg> | ||
) | ||
.toJSON() | ||
|
||
expect(tree).toMatchSnapshot() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.