Skip to content

Commit

Permalink
fix: stop carousel from scrolling with few events (#397) (#405)
Browse files Browse the repository at this point in the history
Co-authored-by: Cody's Dad <[email protected]>
  • Loading branch information
toffee-k21 and AceTheCreator authored Oct 16, 2024
1 parent eb4b500 commit b5e6e0f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion components/Header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import cities from '../../config/city-lists.json';
import Venue from '../Venue/venue';
import Announcement from '../announcement';
import Link from 'next/link';
import { useMediaQuery } from 'react-responsive';

function Header() {
const isMobile = useMediaQuery({ maxWidth: '590px' });
return (
<div className='relative'>
<div className='container w-full flex items-center justify-center'>
Expand Down Expand Up @@ -43,7 +45,7 @@ function Header() {
</div>
</div>
<div className='mt-24'>
<ReactSlider>
<ReactSlider>
{cities.map((city) => {
return <Venue key={city.name} city={city}/>;
})}
Expand Down
9 changes: 7 additions & 2 deletions components/Slider/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ function ReactSlider({ children }) {
variableWidth: isMobile ? false : true,
arrows: false,
};

return (
<Slider ref={slider} {...settings}>
<>
{ children.length > 4 || isMobile ?
(<Slider ref={slider} {...settings}>
{children}
</Slider>
</Slider>):(
<div className='flex m-2 justify-center'>{children}</div>)}
</>
);
}

Expand Down
2 changes: 1 addition & 1 deletion components/Venue/venue.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function Venue({ className, city }) {
return (
<Link href={`/venue/${city.name}`}>
<div style={{'--image-url': `url(${city.img})`}}
className='relative w-[300px] h-[400px] sm:w-[250px] sm:h-[350px] card-bg rounded-md bg-[image:var(--image-url)] flex items-center justify-center p-4 cursor-pointer'>
className='relative w-[300px] h-[400px] sm:w-[250px] sm:h-[350px] card-bg rounded-md bg-[image:var(--image-url)] flex items-center justify-center p-4 cursor-pointer m-2'>
<div className='flex justify-between flex-col w-full h-full'>
<div className='flex items-center'>
{city.cfp? <div className='border text-white text-md rounded-lg p-1 text-center mt-2'>cfp is open</div> :null}
Expand Down
2 changes: 1 addition & 1 deletion config/city-lists.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"date": "30th October 2024",
"cfpdate":"Not announced yet",
"description": "Join us for the AsyncAPI Online Conference Edition as the community unites across the globe to share experiences, collaborate, and foster meaningful connections.",
"img": "/img/testMic.png",
"img": "/img/testMic.webp",
"address": "AsyncAPI Youtube Channel",
"map": "https://www.youtube.com/@AsyncAPI",
"sponsors": [
Expand Down
Binary file modified public/img/finland.webp
Binary file not shown.
Binary file added public/img/london.webp
Binary file not shown.
Binary file added public/img/testMic.webp
Binary file not shown.

0 comments on commit b5e6e0f

Please sign in to comment.