-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from iic2154-uc-cl/development_deploy_2
Development deploy 2
- Loading branch information
Showing
95 changed files
with
10,074 additions
and
3,464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
importScripts("https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.sw.js"); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import '../pages/users/campana.css'; | ||
|
||
const Campana = () => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
const [notificaciones, setNotificaciones] = useState([]); | ||
|
||
const toggleNotifications = () => { | ||
setIsOpen(!isOpen); | ||
}; | ||
|
||
useEffect(() => { | ||
if (isOpen && notificaciones.length === 0) { | ||
fetch('http://localhost:8000/onesignal/notificaciones/') | ||
.then((response) => response.json()) | ||
.then((data) => setNotificaciones(data)) | ||
.catch((error) => console.error('Error fetching notifications:', error)); | ||
} | ||
}, [isOpen]); | ||
|
||
return ( | ||
<div className="campana-container"> | ||
<div className="loader" onClick={toggleNotifications}> | ||
<svg | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
height="24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
aria-hidden="true" | ||
className="w-6 h-6 text-gray-800 dark:text-white" | ||
> | ||
<path | ||
d="M12 5.365V3m0 2.365a5.338 5.338 0 0 1 5.133 5.368v1.8c0 2.386 1.867 2.982 1.867 4.175 0 .593 0 1.292-.538 1.292H5.538C5 18 5 17.301 5 16.708c0-1.193 1.867-1.789 1.867-4.175v-1.8A5.338 5.338 0 0 1 12 5.365ZM8.733 18c.094.852.306 1.54.944 2.112a3.48 3.48 0 0 0 4.646 0c.638-.572 1.236-1.26 1.33-2.112h-6.92Z" | ||
strokeWidth="2" | ||
strokeLinejoin="round" | ||
strokeLinecap="round" | ||
stroke="currentColor" | ||
></path> | ||
</svg> | ||
<div className="point"></div> | ||
</div> | ||
|
||
{isOpen && ( | ||
<div className="notification-box"> | ||
<h4>Notificaciones</h4> | ||
<ul> | ||
{notificaciones.length > 0 ? ( | ||
notificaciones.map((notificacion, index) => ( | ||
<li key={index}> | ||
<h5>{notificacion.title}</h5> | ||
<p>{notificacion.message}</p> | ||
</li> | ||
)) | ||
) : ( | ||
<li>No hay notificaciones disponibles</li> | ||
)} | ||
</ul> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Campana; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React, { useState } from 'react'; | ||
import { GoogleMap, LoadScript, Marker } from '@react-google-maps/api'; | ||
|
||
const containerStyle = { | ||
height: '400px', // Ajusta el tamaño del contenedor si es necesario | ||
width: '100%', | ||
}; | ||
|
||
const center = { | ||
lat: -33.45694, // Coordenadas iniciales para Santiago, Chile | ||
lng: -70.64827, | ||
}; | ||
|
||
const GoogleMapSelectLocation = ({ onLocationSelect }) => { | ||
const [selectedLocation, setSelectedLocation] = useState(null); | ||
|
||
const handleMapClick = (event) => { | ||
const location = { | ||
lat: event.latLng.lat(), | ||
lng: event.latLng.lng(), | ||
}; | ||
setSelectedLocation(location); | ||
|
||
//Llamada a la API de Geocoding | ||
const geocoder = new window.google.maps.Geocoder(); | ||
geocoder.geocode({ location }, (results, status) => { | ||
if (status === "OK") { | ||
if (results[0]) { | ||
const address = results[0].formatted_address; | ||
onLocationSelect(address); // Pasar la dirección al formulario | ||
} else { | ||
console.log("No se encontraron resultados"); | ||
} | ||
} else { | ||
console.log("Geocoder falló debido a: " + status); | ||
} | ||
}); | ||
}; | ||
|
||
return ( | ||
<LoadScript googleMapsApiKey={import.meta.env.VITE_GOOGLE_MAPS_API_KEY}> | ||
<GoogleMap | ||
mapContainerStyle={containerStyle} | ||
center={center} | ||
zoom={12} | ||
onClick={handleMapClick} // Añade la función para manejar clics en el mapa | ||
> | ||
{selectedLocation && ( | ||
<Marker | ||
position={selectedLocation} | ||
title="Ubicación seleccionada" | ||
/> | ||
)} | ||
</GoogleMap> | ||
</LoadScript> | ||
); | ||
}; | ||
|
||
export default GoogleMapSelectLocation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
html, body { | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* Usar San Francisco */ | ||
} | ||
.image-upload-container { | ||
max-width: 800px; | ||
margin: 0 auto; | ||
} | ||
|
||
.dropzone { | ||
background-color: #f9fafb; /* Color de fondo más claro */ | ||
transition: background-color 0.2s; | ||
} | ||
|
||
.dropzone:hover { | ||
background-color: #e5e7eb; /* Color de fondo al pasar el mouse */ | ||
} | ||
|
||
.image-preview { | ||
margin-top: 0.5rem; | ||
width: 100%; /* Asegúrate de que ocupe todo el ancho de su contenedor */ | ||
height: 150px; /* Altura fija para todas las imágenes */ | ||
object-fit: cover; /* Mantener la relación de aspecto y recortar si es necesario */ | ||
} | ||
|
||
.font-medium { | ||
padding-left: 10px; | ||
margin-bottom: 70px; | ||
} | ||
.absolute{ | ||
position: absolute; | ||
border: none; | ||
background-color: transparent; | ||
} | ||
.absolute:hover{ | ||
color: #666; | ||
} | ||
.flex{ | ||
display: flex flex-wrap; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.