From becf75d9e46ea644da3a69820aaa72165af33cc6 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Thu, 6 Oct 2022 15:37:32 +0300 Subject: [PATCH] update: navbar --- src/Components/DynamicIcon/DynamicIcon.tsx | 40 ------ src/Components/Navbar/NavDesktop.tsx | 97 +------------- src/Components/Navbar/NavMobile.tsx | 119 +----------------- src/Components/Navbar/Navbar.tsx | 34 +---- .../Categories/Categories.stories.tsx | 2 +- .../Components/Categories/Categories.tsx | 1 - .../ProjectDetailsCard/ProjectDetailsCard.tsx | 8 +- 7 files changed, 9 insertions(+), 292 deletions(-) delete mode 100644 src/Components/DynamicIcon/DynamicIcon.tsx diff --git a/src/Components/DynamicIcon/DynamicIcon.tsx b/src/Components/DynamicIcon/DynamicIcon.tsx deleted file mode 100644 index 1ba6e78..0000000 --- a/src/Components/DynamicIcon/DynamicIcon.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React, { CSSProperties, SVGAttributes } from "react"; -import { IconContext } from "react-icons"; -import loadable from "@loadable/component"; - -interface IProps { - icon: string; - color?: string; - size?: string; - className?: string; - style?: CSSProperties; - attr?: SVGAttributes; -} - -const DynamicIcon: React.FC = ({ ...props }) => { - // const [library, iconComponent] = props.icon.split("/"); - - // if (!library || !iconComponent) return
Could Not Find Icon
; - - // const lib = library.toLowerCase(); - const Icon = loadable(() => import("react-icons/hi/index.js"), { - resolveComponent: (el: JSX.Element) => - el[props.icon as keyof JSX.Element] - }); - - const value: IconContext = { - color: props.color, - size: props.size, - className: props.className, - style: props.style, - attr: props.attr - }; - - return ( - - - - ); -}; - -export default DynamicIcon; diff --git a/src/Components/Navbar/NavDesktop.tsx b/src/Components/Navbar/NavDesktop.tsx index dbac04e..bb4c4a7 100644 --- a/src/Components/Navbar/NavDesktop.tsx +++ b/src/Components/Navbar/NavDesktop.tsx @@ -44,102 +44,7 @@ export default function NavDesktop() { Bolt fun logo -
    -
  • - - Projects - -
  • -
  • - - Events - -
  • - {/*
  • - Community - - } - menuClassName='!rounded-12 !p-8 !border-gray-200' - menuStyle={{ border: '1px solid' }} - > - { - e.syntheticEvent.preventDefault(); - navigate(PAGES_ROUTES.blog.feed); - }} - className='!p-16 font-medium flex gap-16 hover:bg-gray-100 !rounded-12 ' - > -
    - ✍🏼 -
    -
    -

    - Stories -

    -

    - Tales from the maker community -

    -
    -
    - -
    - 💬 -
    -
    -

    - Discussions -

    -

    - Coming soon -

    -
    -
    - { - e.syntheticEvent.preventDefault(); - navigate("/hackathons"); - }} - className='!p-16 font-medium flex gap-16 hover:bg-gray-100 !rounded-12' - > -
    - 🏆 -
    -
    -

    - Hackathons -

    -

    - Take part in hackathons & tournaments -

    -
    -
    -
    -
  • */} -
  • - - Guide - -
  • -
  • - - Donate - -
  • -
+
    diff --git a/src/Components/Navbar/NavMobile.tsx b/src/Components/Navbar/NavMobile.tsx index 6cbcd5d..eb63bb1 100644 --- a/src/Components/Navbar/NavMobile.tsx +++ b/src/Components/Navbar/NavMobile.tsx @@ -155,124 +155,7 @@ export default function NavMobile() {
    {/* toggleDrawerOpen(false)} /> */}
    -
      - -
    • - toggleDrawerOpen(false)} - className='text-body4 font-bold hover:text-primary-600'> - Projects - -
    • -
    • - toggleDrawerOpen(false)} - className='text-body4 font-bold hover:text-primary-600'> - Events - -
    • - {/*
    • - - { -
      - toggleDrawerOpen(false)} - className='font-medium flex gap-16 !rounded-12 ' - > -
      - ✍🏼 -
      -
      -

      - Stories -

      -

      - Tales from the maker community -

      -
      - -
      -
      - 💬 -
      -
      -

      - Discussions -

      -

      - Coming soon -

      -
      -
      - toggleDrawerOpen(false)} - className='font-medium flex gap-16 !rounded-12' - > -
      - 🏆 -
      -
      -

      - Hackathons -

      -

      - Take part in hackathons & tournaments -

      -
      - -
      -
      } -
    • */} -
    • - - Guide - -
    • -
    • - toggleDrawerOpen(false)} - className='text-body4 font-bold hover:text-primary-600'> - Donate - -
    • - {curUser && -
    • - toggleDrawerOpen(false)} - className='text-body4 font-bold hover:text-primary-600'> - Logout 👋 - -
    • } -
    +
      • About Us diff --git a/src/Components/Navbar/Navbar.tsx b/src/Components/Navbar/Navbar.tsx index e871110..103ee39 100644 --- a/src/Components/Navbar/Navbar.tsx +++ b/src/Components/Navbar/Navbar.tsx @@ -9,33 +9,7 @@ import { MEDIA_QUERIES } from "src/utils/theme/media_queries"; import { IoMdTrophy } from "react-icons/io"; -export const navLinks = [ - { text: "Explore", url: "/", icon: MdHomeFilled, color: "text-primary-600" }, - { - text: "Blog", - url: "/blog", - icon: MdComment, - color: "text-primary-600", - }, - { - text: "Hackathons", - url: "/hackathons", - icon: IoMdTrophy, - color: "text-primary-600", - }, - { - text: "Hottest", - url: "/hottest", - icon: MdLocalFireDepartment, - color: "text-primary-600", - }, - // { - // text: "Categories", - // url: "/categories", - // icon: IoExtensionPuzzle, - // color: "text-primary-600", - // }, -]; +export const navLinks = []; export default function Navbar() { @@ -65,11 +39,7 @@ export default function Navbar() { return (
        - {(isLargeScreen) ? - - : - - } +
        ); } diff --git a/src/features/Projects/Components/Categories/Categories.stories.tsx b/src/features/Projects/Components/Categories/Categories.stories.tsx index 2c94d9d..1e5fd52 100644 --- a/src/features/Projects/Components/Categories/Categories.stories.tsx +++ b/src/features/Projects/Components/Categories/Categories.stories.tsx @@ -9,7 +9,7 @@ export default { } as ComponentMeta; -const Template: ComponentStory = (args) => ; +const Template: ComponentStory = (args) => ; export const Default = Template.bind({}); diff --git a/src/features/Projects/Components/Categories/Categories.tsx b/src/features/Projects/Components/Categories/Categories.tsx index 3278e1a..c8ac9bb 100644 --- a/src/features/Projects/Components/Categories/Categories.tsx +++ b/src/features/Projects/Components/Categories/Categories.tsx @@ -3,7 +3,6 @@ import { useNavigate } from 'react-router-dom'; import { CategoryList, useAllCategoriesQuery } from 'src/graphql'; import { FaChevronLeft, FaChevronRight } from 'react-icons/fa'; import { useCarousel } from 'src/utils/hooks'; -import DynamicIcon from 'src/Components/DynamicIcon/DynamicIcon'; import Skeleton from 'react-loading-skeleton'; const colors = [ diff --git a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx index f35484a..c7b2434 100644 --- a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx +++ b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx @@ -100,11 +100,11 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P url: project.twitter }, { - value: project.github, - text: project.github, + value: project.repository, + text: project.repository, icon: FiGithub, colors: "bg-pink-100 text-pink-600", - url: project.github + url: project.repository }, ]; @@ -149,7 +149,7 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P

        {project.title}

        {project.tagline}

        - {project.category.icon} {project.category.title} + {project.category} {project.category.title}