react-icons/ri#RiGameFill TypeScript Examples

The following examples show how to use react-icons/ri#RiGameFill. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BottomTab.tsx    From game-store-monorepo-app with MIT License 5 votes vote down vote up
BottomTab: React.FC = () => {
  const { pathname } = useLocation();

  const renderTabIcon = (path: string) => {
    switch (path) {
      case ROUTES.ROOT:
        return <RiGameFill size={20} />;
      case ROUTES.GAMES:
        return <IoGameController size={20} />;
      case ROUTES.GENRES:
        return <AiTwotoneAppstore size={20} />;
      case ROUTES.TAGS:
        return <AiFillTags size={20} />;
      case ROUTES.PUBLISHERS:
        return <RiShieldUserFill size={20} />;
      default:
        return null;
    }
  };

  const renderTabItem = () => {
    return routeKeys.map((key) => {
      const path: string = ROUTES[key];
      const name = path.replace('/', '') || 'explore';
      const linkClass = cn({
        'flex flex-col justify-center w-full': true,
        active: pathname === path,
      });
      return (
        <li key={key} className="w-1/5">
          <Link to={path} className={linkClass}>
            {renderTabIcon(path)}
            <p className="text-2xs capitalize">{name}</p>
          </Link>
        </li>
      );
    });
  };

  return (
    <div className="sticky bottom-0 overflow-hidden z-10 shadow">
      <ul className="menu compact w-full horizontal bg-neutral text-neutral-content">{renderTabItem()}</ul>
    </div>
  );
}