ferns-ui 0.21.3 → 0.22.1

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/src/Form.tsx CHANGED
@@ -153,7 +153,7 @@ export class FormLine extends React.Component<FormLineProps, FormLineState> {
153
153
  <Box direction="row" display="flex">
154
154
  <IconButton
155
155
  accessibilityLabel="edit"
156
- icon="cancel"
156
+ icon="times"
157
157
  iconColor="darkGray"
158
158
  prefix="far"
159
159
  size="xs"
package/src/Icon.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import {FontAwesome} from "@expo/vector-icons";
1
+ import {FontAwesome5} from "@expo/vector-icons";
2
2
  import React from "react";
3
3
 
4
4
  import {IconProps, iconSizeToNumber} from "./Common";
@@ -9,10 +9,16 @@ export function initIcons() {
9
9
  }
10
10
 
11
11
  // TODO: Update <Icon /> to be closer to Expo's Vector Icon, letting multiple icon packs be used, etc.
12
- export class Icon extends React.Component<IconProps, {}> {
13
- render() {
14
- const color = Unifier.theme[this.props.color || "primary"];
15
- const size = iconSizeToNumber(this.props.size);
16
- return <FontAwesome color={color} name={this.props.name as any} size={size} />;
17
- }
12
+ export function Icon({color, size, name, prefix}: IconProps): React.ReactElement {
13
+ const iconColor = Unifier.theme[color || "primary"];
14
+ const iconSize = iconSizeToNumber(size);
15
+ return (
16
+ <FontAwesome5
17
+ color={iconColor}
18
+ name={name}
19
+ regular={prefix === "far"}
20
+ size={iconSize}
21
+ solid={!prefix || prefix === "fas"}
22
+ />
23
+ );
18
24
  }
package/src/Pog.tsx CHANGED
@@ -2,7 +2,7 @@
2
2
  import React from "react";
3
3
 
4
4
  import {Box} from "./Box";
5
- import {AllColors, IconPrefix, IconSize} from "./Common";
5
+ import {AllColors, IconName, IconPrefix, IconSize} from "./Common";
6
6
  import {Icon} from "./Icon";
7
7
 
8
8
  const SIZE_NAME_TO_PIXEL = {
@@ -20,7 +20,7 @@ interface Props {
20
20
  hovered?: boolean;
21
21
  selected?: boolean;
22
22
  iconColor?: AllColors;
23
- icon: string;
23
+ icon: IconName;
24
24
  iconPrefix?: IconPrefix;
25
25
  size?: IconSize;
26
26
  }
package/src/TapToEdit.tsx CHANGED
@@ -130,7 +130,7 @@ export const TapToEdit = ({
130
130
  </Box>
131
131
  {editable && (
132
132
  <Box marginLeft={2} onClick={(): void => setEditing(true)}>
133
- <Icon color="darkGray" name="edit" size="lg" />
133
+ <Icon color="darkGray" name="edit" prefix="far" size="md" />
134
134
  </Box>
135
135
  )}
136
136
  </Box>