Skip to content

✨ feat: Adicao do botao de ingressos e programação #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const HeaderLogic = ({ children }: { children: ReactNode }) => {
const { scrollY } = useScroll()
const [isDown, setIsDown] = useState<boolean>(false)

const { setOpen } = useMenu()

useEffect(() => {
const interval = setInterval(() => {
const scrollYValue = window.scrollY
Expand Down
48 changes: 27 additions & 21 deletions src/components/molecules/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { locales } from '@/services/utils/locale.utils'
import { useState } from 'react'
import { scrollTo } from '@/services/utils/scrollTo'
import { cn } from '@/services/utils/className.utils'
import { signIn, useSession } from 'next-auth/react'
import DesktopMenu from './components/DesktopMenu'
import { useSession } from 'next-auth/react'
import Menu from '../Menu'

const Header = () => {
Expand All @@ -30,51 +29,58 @@ const Header = () => {
<div className='hidden lg:flex w-fit h-fit items-center justify-between flex-1 max-w-[570px] mx-2 gap-2'>
<Link
onClick={() => scrollTo('about')}
className='text-base *:tracking-[0.192px] text-white'
className={cn(
'text-base *:tracking-[0.192px] text-white',
locale !== 'en' && 'text-xs xl:text-base'
)}
>
{locale === 'en' ? 'THE PROGRAM' : 'O PROGRAMA'}
</Link>
<Link
onClick={() => scrollTo('editions')}
className='text-base *:tracking-[0.192px] text-white'
className={cn(
'text-base *:tracking-[0.192px] text-white',
locale !== 'en' && 'text-xs xl:text-base'
)}
>
{locale === 'en' ? 'EDITIONS' : 'EDIÇÕES'}
</Link>
<Link
onClick={() => scrollTo('winners')}
className='text-base *:tracking-[0.192px] text-white'
className={cn(
'text-base *:tracking-[0.192px] text-white',
locale !== 'en' && 'text-xs xl:text-base'
)}
>
{locale === 'en' ? 'WINNERS' : 'VENCEDORES'}
</Link>
<Link
onClick={() => scrollTo('partners')}
className='text-base *:tracking-[0.192px] text-white'
className={cn(
'text-base *:tracking-[0.192px] text-white',
locale !== 'en' && 'text-xs xl:text-base'
)}
>
{locale === 'en' ? 'PARTNERS' : 'PATROCINADORES'}
</Link>
</div>

<div
className={cn(
'hidden lg:flex w-full h-fit items-center justify-between mr-[62px] max-w-[min(24.88vw,293.6px)] relative',
data && 'max-w-[215px] xl:max-w-[380px]'
)}
>
<div className='hidden lg:flex w-fit h-fit items-center justify-center mr-[62px] gap-4'>
<Button asChild variant='primary'>
<NextLink href={`${locale}/solutions`}>
{locale === 'en' ? 'See Solutions' : 'Ver Soluções'}
</NextLink>
</Button>
{/* {!data ? (
<Button
variant='secondary'
onClick={() => signIn('google')}
<Button asChild variant='secondary'>
<NextLink
href='https://linktr.ee/computacaoamostra'
target='_blank'
>
{locale === 'en' ? 'Sign In' : 'Fazer Login'}
</Button>
) : (
<DesktopMenu data={data} />
)} */}
{locale === 'en'
? 'Tickets and Schedule'
: 'Ingressos e Programação'}
</NextLink>
</Button>
</div>
</HeaderLogic>
)
Expand Down
33 changes: 13 additions & 20 deletions src/components/molecules/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,25 @@ import AmazonHacking from 'public/images/AmazonHackingColoredLogo.svg'
import { usePathname } from 'next/navigation'
import { useEffect, useState } from 'react'
import { locales } from '@/services/utils/locale.utils'
import { signIn, signOut } from 'next-auth/react'
// import { signIn, signOut } from 'next-auth/react'

import { sections } from '@/constants/sections'
// import { sections } from '@/constants/sections'
import { scrollTo } from '@/services/utils/scrollTo'

function DesktopMenu() {
const pathname = usePathname()
const [locale, setLocale] = useState<string>(
locales.find((locale) => pathname?.includes(locale.locale))?.locale ||
'en'
'en'
)

return (
<div className='flex flex-col items-start justify-start gap-[18px]'>
<div className='flex gap-[10px] items-center justify-center'>
<Link className='font-medium text-20 tracking-[0.24px] text-white pointer-events-none opacity-50'>
{locale === 'en'
? 'Student Area'
: 'Área do Aluno'}
<Link className='pointer-events-none opacity-50'>
{locale === 'en' ? 'Student Area' : 'Área do Aluno'}
</Link>
<Badge>
{locale === 'en' ? 'Soon' : 'Em Breve'}
</Badge>
<Badge>{locale === 'en' ? 'Soon' : 'Em Breve'}</Badge>
</div>
<Link
href='https://www.sympla.com.br/eventos?s=computacao-amostra-xx'
Expand All @@ -46,9 +42,7 @@ function DesktopMenu() {
href='https://drive.google.com/drive/u/2/folders/1DkP687BP4TZV7zYQr9_l7bVGKr_awJUW'
target='_blank'
>
{locale === 'en'
? 'Schedule'
: 'Programação'}
{locale === 'en' ? 'Schedule' : 'Programação'}
</Link>
{/* <Link
href='/'
Expand All @@ -67,7 +61,7 @@ const Menu = ({ data }: MenuProps) => {
const pathname = usePathname()
const [locale, setLocale] = useState<string>(
locales.find((locale) => pathname?.includes(locale.locale))?.locale ||
'en'
'en'
)

const { open, handleOpenChange, setOpen } = useMenu()
Expand All @@ -77,12 +71,12 @@ const Menu = ({ data }: MenuProps) => {
if (open) setBlock(true)
}, [open])

let uName: string = ''
// let uName: string = ''

if (data) {
const names = data.user?.name?.split(' ') as string[]
uName = names[0] + ' ' + names[names.length - 1]
}
// if (data) {
// const names = data.user?.name?.split(' ') as string[]
// uName = names[0] + ' ' + names[names.length - 1]
// }

return (
<div className='absolute flex justify-end items-start w-full h-full inset-0 top-0 right-0'>
Expand Down Expand Up @@ -176,7 +170,6 @@ const Menu = ({ data }: MenuProps) => {
</Button>
</div>


<DesktopMenu />

{/* {!data ? (
Expand Down