Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 6b28f79

Browse files
committed
addressed PR comments
1 parent d3ac583 commit 6b28f79

File tree

3 files changed

+23
-38
lines changed

3 files changed

+23
-38
lines changed

docs/src/examples/components/Icon/Variations/IconExampleColor.shorthand.tsx

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,17 @@ const IconExampleColor = () => (
1616
<Icon name="call" bordered variables={{ outline: true }} />
1717
<Icon name="call-video" bordered variables={{ outline: true }} />
1818
</div>
19-
<Text
20-
content={
21-
<span>
22-
USING THE <code>color</code> VARIABLE:
23-
</span>
24-
}
25-
weight="bold"
26-
/>
19+
<Text weight="bold">
20+
USING THE <code>color</code> VARIABLE:
21+
</Text>
2722
<div>
2823
<Icon name="calendar" bordered variables={{ color: 'violet' }} />
2924
<Icon name="call" bordered variables={{ color: 'yellowgreen' }} />
3025
<Icon name="call-video" bordered variables={{ color: 'cornflowerblue' }} />
3126
</div>
32-
<Text
33-
content={
34-
<span>
35-
USING THE <code>borderColor</code> VARIABLE:
36-
</span>
37-
}
38-
weight="bold"
39-
/>
27+
<Text weight="bold">
28+
USING THE <code>borderColor</code> VARIABLE:
29+
</Text>
4030
<div>
4131
<Icon
4232
name="calendar"
@@ -54,14 +44,9 @@ const IconExampleColor = () => (
5444
variables={{ color: 'cornflowerblue', borderColor: 'orangered' }}
5545
/>
5646
</div>
57-
<Text
58-
content={
59-
<span>
60-
USING THE <code>color</code> PROP:
61-
</span>
62-
}
63-
weight="bold"
64-
/>
47+
<Text weight="bold">
48+
USING THE <code>color</code> PROP:
49+
</Text>
6550
<div>
6651
<ProviderConsumer
6752
render={({ siteVariables: { emphasisColors, naturalColors } }) =>

src/themes/teams/components/Icon/iconStyles.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import { pxToRem } from '../../utils'
1010
import { getStyle as getSvgStyle } from './svg'
1111
import { IconVariables, IconSizeModifier } from './iconVariables'
1212

13-
const sizes = new Map([
14-
['smallest', 7],
15-
['smaller', 10],
16-
['small', 12],
17-
['medium', 16],
18-
['large', 20],
19-
['larger', 32],
20-
['largest', 40],
21-
])
13+
const sizes: { [key in IconSize]: number } = {
14+
smallest: 7,
15+
smaller: 10,
16+
small: 12,
17+
medium: 16,
18+
large: 20,
19+
larger: 32,
20+
largest: 40,
21+
}
2222

2323
const getDefaultFontIcon = (iconName: string) => {
2424
return callable(fontAwesomeIcons(iconName).icon)()
@@ -75,8 +75,9 @@ const getPaddedStyle = (): ICSSInJSStyle => ({
7575

7676
const getIconSize = (size: IconSize, sizeModifier: IconSizeModifier): number => {
7777
if (!sizeModifier) {
78-
return sizes.get(size)
78+
return sizes[size]
7979
}
80+
8081
const modifiedSizes = {
8182
large: {
8283
x: 24,

src/themes/teams/components/Icon/iconVariables.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export interface IconVariables {
1414
redColor?: string
1515
disabledColor: string
1616

17-
outline?: boolean
1817
horizontalSpace: string
1918
margin: string
20-
sizeModifier: IconSizeModifier
19+
outline?: boolean
20+
sizeModifier?: IconSizeModifier
2121
}
2222

2323
const colorVariant = 500
@@ -32,8 +32,7 @@ export default (siteVars): IconVariables => ({
3232
redColor: siteVars.red,
3333
disabledColor: siteVars.gray06,
3434

35-
outline: undefined,
3635
horizontalSpace: pxToRem(10),
3736
margin: `0 ${pxToRem(8)} 0 0`,
38-
sizeModifier: undefined,
37+
outline: undefined,
3938
})

0 commit comments

Comments
 (0)