Skip to content

.sign not worked #111

@ItaloCobains

Description

@ItaloCobains

I have the following code.

'use client'

import { SyntheticEvent } from 'react'
import ApiCalendar from 'react-google-calendar-api'

export const useGoogleCalendar = () => {
  const calendar = new ApiCalendar({
  clientId: process.env.NEXT_PUBLIC_CLIENT_ID as string,
  apiKey: process.env.NEXT_PUBLIC_API_KEY as string,
  scope: "https://www.googleapis.com/auth/calendar",
  discoveryDocs: [
    "https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest",
  ],
  })


  const handleItemClick = (event: SyntheticEvent<any>, name: string) => {
    console.info('Funcao handleItemClick', event, name)
    if (name === 'sign-in') {
        calendar.handleAuthClick();
    } else if (name === 'sign-out') {
        calendar.handleSignoutClick();
    }
};

  return {
    api: calendar,
    handleItemClick,
  }
}

When I click on the button that launches one of these events, the api.sign variable never changes value. Is this correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions