// @flow // A housing for all of our icons. Mostly taken from https://github.com/feathericons/react-feather import * as ICONS from 'constants/icons'; import React, { forwardRef } from 'react'; import { v4 as uuid } from 'uuid'; type IconProps = { size: number, color: string, title?: string, }; type CustomProps = { size?: number, className?: string, }; // Returns a react component // Icons with tooltips need to use this function so the ref can be properly forwarded const buildIcon = (iconStrokes: React$Node, customSvgValues = {}) => forwardRef((props: IconProps, ref) => { const { size = 24, color = 'currentColor', title, ...otherProps } = props; return ( {iconStrokes} {title && {title}} ); }); export const icons = { // The LBRY icon is different from the base icon set so don't use buildIcon() [ICONS.LBRY]: (props: IconProps) => ( ), [ICONS.LBC]: (props: IconProps) => { const { size = 24, color = 'currentColor', ...rest } = props; const randomId = uuid(); return ( ); }, [ICONS.REWARDS]: buildIcon( ), [ICONS.ARROW_LEFT]: buildIcon( ), [ICONS.ARROW_RIGHT]: buildIcon( ), [ICONS.HOME]: buildIcon( ), [ICONS.PUBLISH]: buildIcon( ), [ICONS.FETCH]: buildIcon( ), [ICONS.SUBSCRIBE]: buildIcon( ), [ICONS.UNSUBSCRIBE]: buildIcon( ), [ICONS.SETTINGS]: buildIcon( ), [ICONS.FILTER]: buildIcon( ), [ICONS.ACCOUNT]: buildIcon( ), [ICONS.OVERVIEW]: buildIcon(), [ICONS.WALLET]: buildIcon( ), [ICONS.COIN_SWAP]: buildIcon( ), [ICONS.LIBRARY]: buildIcon(), [ICONS.EDIT]: buildIcon( ), [ICONS.DOWNLOAD]: buildIcon( ), [ICONS.HELP]: buildIcon( ), [ICONS.BLOCK]: buildIcon( ), [ICONS.UNBLOCK]: buildIcon( ), [ICONS.MUTE]: buildIcon( ), [ICONS.LIGHT]: buildIcon( ), [ICONS.DARK]: buildIcon(), [ICONS.FEEDBACK]: buildIcon(), [ICONS.SEARCH]: buildIcon( ), [ICONS.SHARE]: buildIcon( ), [ICONS.REPORT]: buildIcon( ), [ICONS.EXTERNAL]: buildIcon( ), [ICONS.DELETE]: buildIcon( ), [ICONS.COPY]: buildIcon( ), [ICONS.REMOVE]: buildIcon( ), [ICONS.ADD]: buildIcon( ), [ICONS.SUBTRACT]: buildIcon( ), [ICONS.CHAT]: buildIcon( ), [ICONS.YES]: buildIcon( ), [ICONS.NO]: buildIcon( ), [ICONS.UP]: buildIcon(), [ICONS.DOWN]: buildIcon(), [ICONS.FULLSCREEN]: buildIcon( ), [ICONS.FILE]: buildIcon( ), [ICONS.CHANNEL]: buildIcon( ), [ICONS.WEB]: buildIcon( ), [ICONS.ALERT]: buildIcon( ), [ICONS.INFO]: buildIcon( ), [ICONS.GLOBE]: buildIcon( ), [ICONS.UNLOCK]: buildIcon( ), [ICONS.LOCK]: buildIcon( ), [ICONS.TAG]: buildIcon( ), [ICONS.SUPPORT]: buildIcon( ), [ICONS.EYE]: buildIcon( ), [ICONS.EYE_OFF]: buildIcon( ), [ICONS.VIEW]: buildIcon( ), [ICONS.SIGN_IN]: buildIcon( ), [ICONS.SIGN_UP]: buildIcon( ), [ICONS.SIGN_OUT]: buildIcon( ), [ICONS.PHONE]: buildIcon( ), [ICONS.MENU]: buildIcon( ), [ICONS.DISCOVER]: buildIcon( ), [ICONS.TRENDING]: buildIcon( ), [ICONS.TOP]: buildIcon( ), [ICONS.INVITE]: buildIcon( ), [ICONS.VIDEO]: buildIcon( ), [ICONS.AUDIO]: buildIcon( ), [ICONS.VOLUME_MUTED]: buildIcon( ), [ICONS.IMAGE]: buildIcon( ), [ICONS.TEXT]: buildIcon( ), [ICONS.DOWNLOADABLE]: buildIcon( ), [ICONS.REPOST]: buildIcon( ), [ICONS.MORE_VERTICAL]: buildIcon( ), [ICONS.MORE]: buildIcon( ), [ICONS.VALIDATED]: buildIcon( ), [ICONS.SLIDERS]: buildIcon( ), [ICONS.ANALYTICS]: buildIcon( ), // // Share modal social icons // [ICONS.TWITTER]: buildIcon( , { viewBox: '0 0 60 60', } ), [ICONS.FACEBOOK]: buildIcon( , { viewBox: '0 0 60 60', } ), [ICONS.REDDIT]: buildIcon( , { viewBox: '0 0 60 60', } ), [ICONS.TELEGRAM]: buildIcon( , { viewBox: '0 0 60 60', } ), [ICONS.LINKEDIN]: buildIcon( , { viewBox: '0 0 60 60', } ), [ICONS.EMBED]: buildIcon( , { viewBox: '0 0 60 60', } ), [ICONS.SHARE_LINK]: buildIcon( , { viewBox: '0 0 60 60', } ), [ICONS.PURCHASED]: buildIcon( ), [ICONS.COMPLETED]: buildIcon( ), [ICONS.NOT_COMPLETED]: buildIcon(), [ICONS.PINNED]: buildIcon( ), [ICONS.REFRESH]: buildIcon( ), [ICONS.BUY]: buildIcon( ), [ICONS.SEND]: buildIcon( ), [ICONS.RECEIVE]: buildIcon( ), [ICONS.OPEN_LOG_FOLDER]: buildIcon( ), [ICONS.OPEN_LOG]: buildIcon( ), [ICONS.CAMERA]: buildIcon( ), [ICONS.LBRY_STATUS]: buildIcon( ), [ICONS.NOTIFICATION]: buildIcon( ), [ICONS.POST]: buildIcon( ), [ICONS.LAYOUT]: buildIcon( ), [ICONS.REPLY]: buildIcon( ), [ICONS.YOUTUBE]: buildIcon( ), [ICONS.SCIENCE]: (props: CustomProps) => ( ), [ICONS.TECH]: (props: CustomProps) => ( ), [ICONS.NEWS]: (props: CustomProps) => ( ), [ICONS.FINANCE]: buildIcon( ), [ICONS.RABBIT_HOLE]: (props: CustomProps) => ( ), [ICONS.ENLIGHTENMENT]: (props: CustomProps) => ( ), [ICONS.GAMING]: (props: CustomProps) => ( ), [ICONS.COMMUNITY]: (props: CustomProps) => ( ), [ICONS.UPVOTE]: buildIcon( ), [ICONS.DOWNVOTE]: buildIcon( ), [ICONS.FIRE_ACTIVE]: buildIcon( ), [ICONS.SLIME_ACTIVE]: buildIcon( ), [ICONS.FIRE]: buildIcon( ), [ICONS.SLIME]: buildIcon( ), [ICONS.BELL]: buildIcon( ), [ICONS.BELL_ON]: buildIcon( ), [ICONS.PIN]: (props: CustomProps) => ( ), [ICONS.CONTROVERSIAL]: (props: CustomProps) => ( ), [ICONS.NEW]: (props: CustomProps) => ( ), [ICONS.BEST]: (props: CustomProps) => ( ), [ICONS.CREATOR_LIKE]: (props: CustomProps) => ( ), [ICONS.CHEF]: (props: CustomProps) => ( ), [ICONS.ANONYMOUS]: buildIcon( ), [ICONS.CHANNEL_LEVEL_1]: (props: CustomProps) => ( ), [ICONS.CHANNEL_LEVEL_2]: (props: CustomProps) => ( ), [ICONS.CHANNEL_LEVEL_3]: (props: CustomProps) => ( ), [ICONS.CHANNEL_LEVEL_4]: (props: CustomProps) => ( ), [ICONS.CHANNEL_LEVEL_5]: (props: CustomProps) => ( ), [ICONS.WILD_WEST]: buildIcon( ), [ICONS.PEACE]: (props: CustomProps) => ( ), [ICONS.UNIVERSE]: (props: CustomProps) => ( ), [ICONS.CHEESE]: (props: CustomProps) => ( ), [ICONS.PORK_BUN]: (props: CustomProps) => ( ), [ICONS.MIND_BLOWN]: (props: CustomProps) => ( ), [ICONS.MOVIES]: (props: CustomProps) => ( ), [ICONS.LIVESTREAM]: (props: CustomProps) => ( {/* }//fill="#FFFFFF" */} ), [ICONS.LIVESTREAM_SOLID]: (props: CustomProps) => ( ), [ICONS.LIVESTREAM_MONOCHROME]: (props: CustomProps) => ( ), [ICONS.LIVESTREAM]: (props: CustomProps) => ( {/* }//fill="#FFFFFF" */} ), [ICONS.LIVESTREAM_SOLID]: (props: CustomProps) => ( ), [ICONS.LIVESTREAM_MONOCHROME]: (props: CustomProps) => ( ), [ICONS.STACK]: (props: CustomProps) => ( ), [ICONS.TIME]: (props: CustomProps) => ( ), };