Skip to content

Commit

Permalink
rename icon prop to src
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jan 24, 2021
1 parent 7415d5f commit 4a0e4b1
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/components/CreateMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const CreateMenu = (props) => {
])}
>
<View style={styles.createMenuIcon}>
<Icon icon={icon} width={24} height={24} />
<Icon src={icon} width={24} height={24} />
</View>
<View style={styles.justifyContentCenter}>
<Text style={[styles.createMenuText, styles.ml3]}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderWithCloseButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const HeaderWithCloseButton = props => (
onPress={props.onCloseButtonPress}
style={[styles.touchableButtonImage]}
>
<Icon icon={Close} />
<Icon src={Close} />
</TouchableOpacity>
</View>
</View>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Icon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ICONS = _.extend(BrandAssets, Expensicons);

const propTypes = {
// The asset to render.
icon: PropTypes.oneOf(_.values(ICONS)).isRequired,
src: PropTypes.oneOf(_.values(ICONS)).isRequired,

// The width of the icon.
width: PropTypes.number,
Expand All @@ -33,11 +33,11 @@ const defaultProps = {
// eslint-disable-next-line react/prefer-stateless-function
class Icon extends PureComponent {
render() {
const IconToRender = this.props.icon;
const IconToRender = this.props.src;

// Expensicons have a default fill color, but brand assets do not
let fillColor = this.props.fill;
if (!fillColor && _.contains(_.values(Expensicons), this.props.icon)) {
if (!fillColor && _.contains(_.values(Expensicons), this.props.src)) {
fillColor = themeColors.icon;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/PillWithCancelButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const PillWithCancelButton = props => (
>
{props.text}
</Text>
<Icon icon={Close} width={12} height={12} />
<Icon src={Close} width={12} height={12} />
</TouchableOpacity>
);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/SetPasswordPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class SetPasswordPage extends Component {
<View style={[styles.signInPageInner]}>
<View style={[styles.signInPageLogo]}>
<Icon
icon={ExpensifyCashLogo}
src={ExpensifyCashLogo}
width={variables.componentSizeLarge}
height={variables.componentSizeLarge}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const HeaderView = props => (
onPress={props.onNavigationMenuButtonClicked}
style={[styles.LHNToggle]}
>
<Icon icon={BackArrow} />
<Icon src={BackArrow} />
</Pressable>
)}
{props.report && props.report.reportName ? (
Expand All @@ -63,7 +63,7 @@ const HeaderView = props => (
onPress={() => togglePinnedState(props.report)}
style={[styles.touchableButtonImage, styles.mr0]}
>
<Icon icon={Pin} fill={props.report.isPinned ? themeColors.heading : themeColors.icon} />
<Icon src={Pin} fill={props.report.isPinned ? themeColors.heading : themeColors.icon} />
</Pressable>
</View>
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ReportActionCompose extends React.Component {
style={[styles.chatItemAttachButton]}
underlayColor={themeColors.componentBG}
>
<Icon icon={Paperclip} />
<Icon src={Paperclip} />
</TouchableOpacity>
)}
</AttachmentPicker>
Expand Down Expand Up @@ -214,7 +214,7 @@ class ReportActionCompose extends React.Component {
underlayColor={themeColors.componentBG}
disabled={this.state.isCommentEmpty}
>
<Icon icon={Send} fill={themeColors.componentBG} />
<Icon src={Send} fill={themeColors.componentBG} />
</TouchableOpacity>
</View>
<ReportTypingIndicator reportID={this.props.reportID} />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/sidebar/ChatLinkRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const ChatLinkRow = ({
</TouchableOpacity>
</View>
)}
{option.hasDraftComment && <Icon icon={Pencil} width={16} height={16} />}
{option.hasDraftComment && <Icon src={Pencil} width={16} height={16} />}
</View>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/sidebar/ChatSwitcherSearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const ChatSwitcherSearchForm = props => (
onPress={props.onClearButtonClick}
underlayColor={themeColors.componentBG}
>
<Icon icon={Close} width={24} height={24} />
<Icon src={Close} width={24} height={24} />
</TouchableOpacity>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const SidebarLinks = (props) => {
style={[styles.flexRow, styles.sidebarHeaderTop]}
onPress={() => ChatSwitcher.show()}
>
<Icon icon={MagnifyingGlass} />
<Icon src={MagnifyingGlass} />
</TouchableOpacity>
<TouchableOpacity
onPress={props.onAvatarClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const SignInPageLayoutNarrow = ({children}) => (
<View style={[styles.signInPageInnerNative]}>
<View style={[styles.signInPageLogoNative]}>
<Icon
icon={ExpensifyCashLogo}
src={ExpensifyCashLogo}
width={variables.componentSizeLarge}
height={variables.componentSizeLarge}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signin/SignInPageLayout/SignInPageLayoutWide.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SignInPageLayoutWide = ({children}) => (
<View style={[styles.flex1, styles.w50]}>
<View style={[styles.signInPageLogo, styles.mt6, styles.mb5]}>
<Icon
icon={ExpensifyCashLogo}
src={ExpensifyCashLogo}
width={variables.componentSizeLarge}
height={variables.componentSizeLarge}
/>
Expand Down

0 comments on commit 4a0e4b1

Please sign in to comment.