Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Expensicon lib #1188

Merged
merged 23 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions assets/images/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/icon-paper-clip.png
Binary file not shown.
Binary file removed assets/images/icon-pencil.png
Binary file not shown.
Binary file removed assets/images/icon-send.png
Binary file not shown.
Binary file removed assets/images/icon-x--20x20.png
Binary file not shown.
Binary file removed assets/images/icon-x.png
Binary file not shown.
4 changes: 4 additions & 0 deletions assets/images/paperclip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions assets/images/pencil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"html-entities": "^1.3.1",
"lodash.get": "^4.4.2",
"lodash.has": "^4.5.2",
"lodash.merge": "^4.6.2",
"lodash.orderby": "^4.6.0",
"metro-config": "^0.64.0",
"mime-types": "^2.1.28",
Expand Down
11 changes: 6 additions & 5 deletions src/components/CreateMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import styles from '../styles/styles';
import CONST from '../CONST';
import themeColors from '../styles/themes/default';
import colors from '../styles/colors';
import {ChatBubbleIcon, UsersIcon} from './Expensicons';
import Icon from './Icon';
import {ChatBubble, Users} from './Icon/Expensicons';
import variables from '../styles/variables';

const propTypes = {
Expand All @@ -28,8 +29,8 @@ const CreateMenu = (props) => {
// This format allows to set individual callbacks to each item
// while including mutual callbacks first
const menuItemData = [
{IconComponent: ChatBubbleIcon, text: 'New Chat', onPress: () => {}},
{IconComponent: UsersIcon, text: 'New Group', onPress: () => {}},
{icon: ChatBubble, text: 'New Chat', onPress: () => {}},
{icon: Users, text: 'New Group', onPress: () => {}},
].map(item => ({
...item,
onPress: () => {
Expand All @@ -48,7 +49,7 @@ const CreateMenu = (props) => {
: CONST.MODAL.MODAL_TYPE.POPOVER
}
>
{menuItemData.map(({IconComponent, text, onPress}) => (
{menuItemData.map(({icon, text, onPress}) => (
<Pressable
key={text}
onPress={onPress}
Expand All @@ -58,7 +59,7 @@ const CreateMenu = (props) => {
])}
>
<View style={styles.createMenuIcon}>
<IconComponent width={24} height={24} />
<Icon src={icon} width={variables.iconSizeLarge} height={variables.iconSizeLarge} />
</View>
<View style={styles.justifyContentCenter}>
<Text style={[styles.createMenuText, styles.ml3]}>
Expand Down
34 changes: 0 additions & 34 deletions src/components/Expensicons/ChatBubbleIcon.js

This file was deleted.

26 changes: 0 additions & 26 deletions src/components/Expensicons/ExpensifyCashLogoIcon.js

This file was deleted.

27 changes: 0 additions & 27 deletions src/components/Expensicons/MagnifyingGlassIcon.js

This file was deleted.

28 changes: 0 additions & 28 deletions src/components/Expensicons/PinIcon.js

This file was deleted.

40 changes: 0 additions & 40 deletions src/components/Expensicons/PlusIcon.js

This file was deleted.

34 changes: 0 additions & 34 deletions src/components/Expensicons/UsersIcon.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/Expensicons/index.js

This file was deleted.

7 changes: 4 additions & 3 deletions src/components/FAB.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import {Pressable, Animated, Easing} from 'react-native';
import PropTypes from 'prop-types';
import {PlusIcon} from './Expensicons';
import Icon from './Icon';
import {Plus} from './Icon/Expensicons';
import styles from '../styles/styles';
import themeColors from '../styles/themes/default';

const AnimatedPlusIcon = Animated.createAnimatedComponent(PlusIcon);
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);

const propTypes = {
Expand Down Expand Up @@ -67,7 +68,7 @@ class FAB extends React.Component {
{transform: [{rotate}], backgroundColor},
]}
>
<AnimatedPlusIcon fill={fill} />
<AnimatedIcon src={Plus} fill={fill} />
</AnimatedPressable>
);
}
Expand Down
11 changes: 4 additions & 7 deletions src/components/HeaderWithCloseButton.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
View, Image, TouchableOpacity,
View, TouchableOpacity,
} from 'react-native';
import styles from '../styles/styles';
import exitIcon from '../../assets/images/icon-x--20x20.png';
import Header from './Header';
import Icon from './Icon';
import {Close} from './Icon/Expensicons';

const propTypes = {
/** Title of the Header */
Expand Down Expand Up @@ -37,11 +38,7 @@ const HeaderWithCloseButton = props => (
onPress={props.onCloseButtonPress}
style={[styles.touchableButtonImage]}
>
<Image
resizeMode="contain"
style={[styles.attachmentCloseIcon]}
source={exitIcon}
/>
<Icon src={Close} />
</TouchableOpacity>
</View>
</View>
Expand Down
23 changes: 23 additions & 0 deletions src/components/Icon/Expensicons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import BackArrow from '../../../assets/images/back-left.svg';
import ChatBubble from '../../../assets/images/chatbubble.svg';
import Close from '../../../assets/images/close.svg';
import MagnifyingGlass from '../../../assets/images/magnifyingglass.svg';
import Paperclip from '../../../assets/images/paperclip.svg';
import Pencil from '../../../assets/images/pencil.svg';
import Pin from '../../../assets/images/pin.svg';
import Plus from '../../../assets/images/plus.svg';
import Send from '../../../assets/images/send.svg';
import Users from '../../../assets/images/users.svg';

export {
BackArrow,
ChatBubble,
Close,
MagnifyingGlass,
Paperclip,
Pencil,
Pin,
Plus,
Send,
Users,
};
Loading