Skip to content

Commit

Permalink
Merge pull request #121 from ApeSwapFinance/add-favs
Browse files Browse the repository at this point in the history
Added favs svg
  • Loading branch information
Prof-SD authored Dec 21, 2022
2 parents 21bd5e0 + a63d2e4 commit e17593d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/components/Svg/Icons/Fav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** @jsxImportSource theme-ui */
import React from "react";
import { SvgProps, rotation } from "./types";

const Fav: React.FC<SvgProps> = ({ direction = "down", color = "text", width, getStyles }) => {
const deg: rotation = {
left: 90,
up: 180,
right: 270,
down: 0,
};
const style = getStyles({
degree: deg[direction as keyof rotation],
color,
});

return (
<svg width={width || "16"} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" sx={style}>
<path
d="M3.06 15.7142L4.36 10.0097L0 6.17286L5.76 5.66535L8 0.285645L10.24 5.66535L16 6.17286L11.64 10.0097L12.94 15.7142L8 12.6894L3.06 15.7142Z"
fill="#4D4040"
/>
</svg>
);
};

export default Fav;
1 change: 1 addition & 0 deletions src/components/Svg/Icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ export { default as Migrate } from "./Migrate";
export { default as Message } from "./Message";
export { default as Positions } from "./Positions";
export { default as MenuSettings } from "./MenuSettings";
export { default as Fav } from "./Fav";
4 changes: 4 additions & 0 deletions src/components/Svg/Svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
Message,
Positions,
MenuSettings,
Fav
} from "./Icons";
import { BSC, BANANA, BNB, ETH, GNANA, POLYGON, TLOS } from "./tokens";
import { IconStyles } from "./Icons/types";
Expand Down Expand Up @@ -227,6 +228,9 @@ const Svg: React.FC<SvgProps> = ({ icon, ...props }: any) => {
if (icon === icons.MENU_SETTINGS) {
return <MenuSettings {...props} getStyles={getStyles} />;
}
if (icon === icons.FAV) {
return <Fav {...props} getStyles={getStyles} />;
}
return null;
};

Expand Down
1 change: 1 addition & 0 deletions src/components/Svg/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export enum icons {
MESSAGE = "message",
POSITIONS = "Positions",
MENU_SETTINGS = "MenuSettings",
FAV = "Fav",
}

export enum directions {
Expand Down

0 comments on commit e17593d

Please sign in to comment.