diff --git a/frontend/src/Login.jsx b/frontend/src/Login.jsx new file mode 100644 index 0000000..c7c16fc --- /dev/null +++ b/frontend/src/Login.jsx @@ -0,0 +1,49 @@ +import ApiCalendar from "react-google-calendar-api"; +import React from 'react'; +import {} from 'react-router-dom' + +const config = { + clientId: process.env.GOOGLE_CLIENT_ID, + apiKey: process.env.GOOGLE_API_KEY, + scope: "https://www.googleapis.com/auth/calendar", + discoveryDocs: [ + "https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest", + ], +}; + + + +const apiCalendar = new ApiCalendar(config); +export default class Login extends React.Component { + constructor(props) { + super(props); + this.handleItemClick = this.handleItemClick.bind(this); + } + handleItemClick(event, name) { + if (name === 'sign-in') { + console.log( apiCalendar.handleAuthClick()) + + } else if (name === 'sign-out') { + apiCalendar.handleSignoutClick(); } + } + + + render() { + return ( +
+ + +
+ ); + } +} + diff --git a/frontend/src/components/Time.js b/frontend/src/components/Time.js deleted file mode 100644 index 56ca01a..0000000 --- a/frontend/src/components/Time.js +++ /dev/null @@ -1,24 +0,0 @@ -// components/Time.js -//import React from 'react'; -//import PropTypes from 'prop-types'; - -const Time = ({ nome }) => { - // Função para mostrar o escudo quando o botão é clicado - const showLogo = () => { - alert(`Você selecionou o escudo do ${nome}`); - // Lógica para exibir o escudo - } - - return ( - - ); -} - -Time.propTypes = { - nome: PropTypes.string.isRequired, - escudo: PropTypes.string.isRequired -} - -export default Time; diff --git a/frontend/src/index.jsx b/frontend/src/index.jsx index 54b39dd..2a82937 100644 --- a/frontend/src/index.jsx +++ b/frontend/src/index.jsx @@ -1,10 +1,35 @@ import React from 'react' import ReactDOM from 'react-dom/client' import App from './App.jsx' +import { + createBrowserRouter, + RouterProvider, +} from "react-router-dom"; +import Time from "./routes/Time.jsx"; import './index.css' +const router = createBrowserRouter([ + + { + path:"/", + element: , + + }, + { + path: "/hello", + element:
hello
, + }, + { + path: "/Time", + element: