Skip to content

Commit

Permalink
Merge pull request #515 from shoutem/release/4.0.0
Browse files Browse the repository at this point in the history
Introducing SVG icons:
* Icon component now uses SVG icons instead of font icons
* Existing set of font icons is replaced with new SVG icons
* Users are allowed to add/register custom icons to existing set

Set this as a breaking change since font icons are now deprecated.
  • Loading branch information
majaklajic authored Aug 27, 2020
2 parents f244863 + da8d97d commit 4fbd1b7
Show file tree
Hide file tree
Showing 107 changed files with 790 additions and 4,224 deletions.
34 changes: 34 additions & 0 deletions components/Icon/Icon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from "react";
import PropTypes from "prop-types";
import _ from "lodash";
import { connectStyle } from "@shoutem/theme";
import { getIcon } from "./services";

function Icon({ name, style, ...otherProps }) {
const { color, width, height, ...otherStyle } = style;

const Icon = getIcon(name);

if (!Icon) {
console.warn(`Icon with ${name} name not found within the provided set`);

return null;
}

return (
<Icon
fill={color}
width={width}
height={height}
style={{ ...otherStyle }}
{...otherProps}
/>
);
}

Icon.propTypes = {
name: PropTypes.string.isRequired,
style: PropTypes.any,
};

export default connectStyle("shoutem.ui.Icon")(Icon);
5 changes: 5 additions & 0 deletions components/Icon/assets/about.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/activity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/add-event.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/add-friend.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/add-to-cart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/add-to-favorites-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/add-to-favorites-on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/address.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/books.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/call.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/cam-switch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/cart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/checkbox-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/checkbox-on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/clear-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/comment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/deals.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/directions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/down-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/drop-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/email.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/equalizer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions components/Icon/assets/error.svg
5 changes: 5 additions & 0 deletions components/Icon/assets/events.svg
5 changes: 5 additions & 0 deletions components/Icon/assets/exit-to-app.svg
5 changes: 5 additions & 0 deletions components/Icon/assets/eye-crossed.svg
5 changes: 5 additions & 0 deletions components/Icon/assets/eye.svg
5 changes: 5 additions & 0 deletions components/Icon/assets/facebook-logo.svg
Loading

0 comments on commit 4fbd1b7

Please sign in to comment.