Skip to content
Merged
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
14 changes: 7 additions & 7 deletions src/components/CalendarCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ END:VCALENDAR
link.download = "posadev-2025.ics";
link.click();
};
const handleGoogleCalendar = () => {
const getUrlGoogleCalendar = () => {
// Hora UTC equivalente a 9:00 a.m. - 9:00 p.m. hora México (UTC−6)
const start = "20251206T150000Z";
const end = "20251207T030000Z";
Expand All @@ -32,14 +32,14 @@ END:VCALENDAR
const details = encodeURIComponent("Únete al evento Posadev 2025 en Guadalajara.");
const location = encodeURIComponent("https://maps.app.goo.gl/8ayZ57xJf9Uvod6o7");

const url = `https://www.google.com/calendar/render?action=TEMPLATE&text=${text}&dates=${start}/${end}&details=${details}&location=${location}`;
window.open(url, "_blank");
return `https://www.google.com/calendar/render?action=TEMPLATE&text=${text}&dates=${start}/${end}&details=${details}&location=${location}`;
};

return (
<div
onClick={handleGoogleCalendar}
className="bg-white/10 backdrop-blur-sm rounded-2xl p-6 hover-scale text-center cursor-pointer"
<a
target="_blank"
href={getUrlGoogleCalendar()}
className="bg-white/10 backdrop-blur-sm rounded-2xl p-6 hover-scale text-center"
>
<Calendar className="w-8 h-8 text-posadev-brightPink mx-auto mb-3" aria-hidden="true" />
<h3 className="text-white font-semibold mb-2">Fecha</h3>
Expand All @@ -51,7 +51,7 @@ END:VCALENDAR
6 de diciembre 2025
</time>
<p className="text-xs text-posadev-lightPink/70 mt-2">(Haz clic para agregar al calendario)</p>
</div>
</a>
);
};

Expand Down
9 changes: 3 additions & 6 deletions src/components/Shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@ import {ISpeaker} from "@/types/speakers.ts";
interface SharedProps {
link: string,
speaker: ISpeaker
blob: Blob
}

const Shared: React.FC<SharedProps> = ({link, speaker, blob }) => {
const Shared: React.FC<SharedProps> = ({link, speaker }) => {
const {toast, dismiss} = useToast();
const file = new File([blob], speaker.profilePicture, { type: "image/png" });

const handleBrochureClick = async () => {
if (navigator.share) {
await navigator.share({
title: `Speaker: ${speaker.fullName}`,
text: "¡Mira este speaker de Posadev 2025!",
url: link,
files: [file]
text: "¡Mira a este speaker de Posadev 2025!",
url: link
});
} else {
await navigator.clipboard.writeText(link);
Expand Down
6 changes: 3 additions & 3 deletions src/components/SpeakerInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import React, {useEffect, useState} from "react";
import {useLocation, useNavigate, useParams} from "react-router-dom";
import SocialMedia from "@/components/SocialMedia.tsx";
import {Badge} from "@/components/ui/badge.tsx";
import {ArrowBigLeft, ChevronLeft, Speech} from "lucide-react";
import { ChevronLeft, Speech} from "lucide-react";
import Gradient from "@/components/Gradient.tsx";
import {useAppContext} from "@/context/AppContext.tsx";
import {findSpeaker, scrollToTop} from "@/lib/utils.ts";
import Shared from "@/components/Shared.tsx";
import Loading from "@/components/Loading.tsx";
import {Button} from "@/components/ui/button.tsx";

const SpeakerInfo = () => {
const navigate = useNavigate()
Expand Down Expand Up @@ -49,6 +48,7 @@ const SpeakerInfo = () => {
<ChevronLeft className="h-8 w-8" strokeWidth={2} />
<span
className="
hidden md:block
relative
after:absolute after:left-0 after:bottom-0
after:h-[2px] after:w-0 after:bg-primary-600
Expand All @@ -70,7 +70,7 @@ const SpeakerInfo = () => {
{currentSpeaker.links.map((link) => (
<SocialMedia key={`link-${link.url}`} className="h-6 w-6 hover:text-primary-600" link={link} />
))}
<Shared blob={blob} link={fullUrl} speaker={currentSpeaker} />
<Shared link={fullUrl} speaker={currentSpeaker} />
</div>
</div>
</Card>
Expand Down