Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop carousel from scrolling with few events (#397) #405

Merged
merged 13 commits into from
Oct 16, 2024
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
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.
Loading