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
17 changes: 10 additions & 7 deletions src/components/Modal.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { id = 'modal', open = false, closeOnOutsideClick = false } = Astro.props;
<script >
document.addEventListener('DOMContentLoaded', () => {
// Function to toggle body scroll
const toggleBodyScroll = (disable) => {
const toggleBodyScroll = (disable: any) => {
if (disable) {
// Save the current scroll position
const scrollY = window.scrollY;
Expand All @@ -49,7 +49,7 @@ const { id = 'modal', open = false, closeOnOutsideClick = false } = Astro.props;
};

// Function to open modal
const openModal = (modal) => {
const openModal = (modal: any) => {
if (modal) {
// Disable body scroll
toggleBodyScroll(true);
Expand All @@ -60,7 +60,7 @@ const { id = 'modal', open = false, closeOnOutsideClick = false } = Astro.props;
};

// Function to close modal
const closeModal = (modal) => {
const closeModal = (modal: any) => {
if (modal) {
// Enable body scroll
toggleBodyScroll(false);
Expand All @@ -72,22 +72,25 @@ const { id = 'modal', open = false, closeOnOutsideClick = false } = Astro.props;

// Open modal buttons
document.querySelectorAll('[data-open-modal]').forEach(button => {
button.addEventListener('click', () => {
const modal = document.getElementById(button.dataset.openModal);
const btn = button as HTMLElement;
btn.addEventListener('click', () => {
const modal = document.getElementById(btn.dataset.openModal!);
openModal(modal);
});
});

// Close modal buttons
document.querySelectorAll('[data-close-modal]').forEach(button => {
button.addEventListener('click', () => {
const btn = button as HTMLElement;
btn.addEventListener('click', () => {
const modal = button.closest('[data-modal-wrapper]');
closeModal(modal);
});
});

// Close when clicking outside the modal content - only if enabled
document.querySelectorAll('[data-modal-wrapper]').forEach(modal => {
document.querySelectorAll('[data-modal-wrapper]').forEach(m => {
const modal = m as HTMLElement;
const closeOnOutsideClick = modal.dataset.closeOnOutsideClick === 'true';

if (closeOnOutsideClick) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/SocialMediaSponsorCard.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
import { getEntry } from "astro:content";
import { sponsorLogos } from "@data/sponsorLogos";

const { sponsor } = Astro.props;

const {
name: title,
url: website,
logo_padding = false,
} = sponsor.data;

Expand Down
1 change: 0 additions & 1 deletion src/components/schedule/session.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import Speakers from "./speakers.astro";
import { slugify } from "@utils/content";
import Headline from "@ui/Headline.astro";

export interface props {
style: any;
Expand Down
1 change: 0 additions & 1 deletion src/components/sponsors/sponsors.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import { getCollection } from "astro:content";
import Separator from "@ui/Separator.astro";
import Headline from "@ui/Headline.astro"
import Section from "@ui/Section.astro"

Expand Down
2 changes: 1 addition & 1 deletion src/pages/media/sponsor/[slug].astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { getEntry, getCollection} from "astro:content";
import { getCollection} from "astro:content";
import SocialMediaSponsorCard from "@components/SocialMediaSponsorCard.astro";

export async function getStaticPaths() {
Expand Down