Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.tsx 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use client'
  2. import { useTranslation } from 'react-i18next'
  3. import Link from 'next/link'
  4. import { useSelectedLayoutSegment } from 'next/navigation'
  5. import {
  6. RiPlanetFill,
  7. RiPlanetLine,
  8. } from '@remixicon/react'
  9. import classNames from '@/utils/classnames'
  10. type ExploreNavProps = {
  11. className?: string
  12. }
  13. const ExploreNav = ({
  14. className,
  15. }: ExploreNavProps) => {
  16. const { t } = useTranslation()
  17. const selectedSegment = useSelectedLayoutSegment()
  18. const activated = selectedSegment === 'explore'
  19. return (
  20. <Link href="/explore/apps" className={classNames(
  21. className, 'group',
  22. activated && 'bg-components-main-nav-nav-button-bg-active shadow-md',
  23. activated ? 'text-components-main-nav-nav-button-text-active' : 'text-components-main-nav-nav-button-text hover:bg-components-main-nav-nav-button-bg-hover',
  24. )}>
  25. {
  26. activated
  27. ? <RiPlanetFill className='h-4 w-4' />
  28. : <RiPlanetLine className='h-4 w-4' />
  29. }
  30. <div className='ml-2 max-[1024px]:hidden'>
  31. {t('common.menus.explore')}
  32. </div>
  33. </Link>
  34. )
  35. }
  36. export default ExploreNav