Skip to content

Commit

Permalink
Added new community section, fixes for AppsCarousel
Browse files Browse the repository at this point in the history
  • Loading branch information
gabros20 committed Feb 6, 2025
1 parent f449925 commit 3749d0e
Show file tree
Hide file tree
Showing 20 changed files with 496 additions and 266 deletions.
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.
8 changes: 4 additions & 4 deletions src/app/community/page.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import SecondaryHero from "@/components/Heroes/SecondaryHero";
import EcosystemPage from "@/components/CallToActions/EcosystemPage";
import IconCard from "@/components/Cards/IconCards/IconCard";
import Container from "@/components/Container/Container";
import SecondaryHero from "@/components/Heroes/SecondaryHero";
import { Body, Display } from "@/macros/Copy";
import { Col, Row } from "@/macros/Grids";
import { Display, Body } from "@/macros/Copy";
import IconCard from "@/components/Cards/IconCards/IconCard";
import EcosystemPage from "@/components/CallToActions/EcosystemPage";

import meta from "@/components/Meta/Meta";
import seo from "@/data/community/seo";
Expand Down
4 changes: 4 additions & 0 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import AlternatingMediaRows from "@/components/AlternatingMediaRows/AlternatingM
import AppsCarousel from "@/components/AppsCarousel/AppsCarousel";
import ExploreCard from "@/components/Cards/ExploreCards/ExploreCard";
import ExploreCardsContainer from "@/components/Cards/ExploreCards/ExploreCardsContainer";
import CommunityCarousel from "@/components/CommunityCarousel/CommunityCarousel";
import EcosytemExplorer from "@/components/Ecosystem/EcosytemExplorer/EcosytemExplorer";
import PrimaryHero from "@/components/Heroes/PrimaryHero";
import Blog from "@/components/Resources/Blog/Blog";
import { ANALYTICS_EVENTS } from "@/constants/analytics";
import { appItems } from "@/data/home/apps-on-celestia";
import { communityItems } from "@/data/home/community-items";
import { Link } from "@/micros/TertiaryPageMicors/TertiaryPageMicors";

export default async function Home() {
Expand Down Expand Up @@ -41,6 +43,8 @@ export default async function Home() {

<AppsCarousel items={appItems} />

<CommunityCarousel items={communityItems} />

<AlternatingMediaRows
id={"explore-celestia"}
rows={[
Expand Down
6 changes: 3 additions & 3 deletions src/components/AppsCarousel/AppsCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "slick-carousel/slick/slick-theme.css";
import "slick-carousel/slick/slick.css";

const AppCard = ({ title, description, image, url, chainIcon }) => (
<div className='h-full px-2 transition-all duration-300 sm:px-7'>
<div className='h-full px-2 transition-all duration-300 sm:px-7 xl:px-18'>
<div className='flex flex-col min-h-full overflow-hidden transition-all duration-300 rounded-lg'>
<div className='w-full aspect-[400/240] overflow-hidden rounded-lg'>
<img src={image} alt={title} className='object-cover w-full h-full pointer-events-none select-none' draggable='false' />
Expand Down Expand Up @@ -121,14 +121,14 @@ const AppsCarousel = ({ items }) => {

return (
<section className='pt-14 pb-10 md:pt-20 md:pb-4 bg-[#17141A]'>
<Container size='lg' className='relative overflow-hidden max-w-[1680px] 2xl:overflow-visible'>
<Container size='lg' className='relative overflow-hidden max-w-[1680px] 3xl:overflow-visible'>
<div className='mb-8 md:mb-[64px] lg:mb-[80px]'>
<Display tag={"h2"} className={`text-center text-white`} size={"sm"}>
Apps on Celestia
</Display>
</div>

<div className='[&_.slick-list]:overflow-visible [&_.slick-track]:flex [&_.slick-slide]:h-auto [&_.slick-slide>div]:h-full [&_.slick-slide]:scale-100 [&_.slick-slide.slick-center]:scale-[112%] [&_.slick-slide]:transition-all [&_.slick-slide]:duration-300 [&_.slick-slide.slick-center_>_div_>_div_>div]:bg-[#1F1C23] [&_.slick-list]:box-sizing-border-box'>
<div className='[&_.slick-list]:overflow-y-visible [&_.slick-list]:overflow-x-clip 3xl:[&_.slick-list]:overflow-y-visible 3xl:[&_.slick-list]:overflow-x-visible [&_.slick-track]:flex [&_.slick-slide]:h-auto [&_.slick-slide>div]:h-full [&_.slick-slide]:scale-100 [&_.slick-slide.slick-center]:scale-[112%] [&_.slick-slide]:transition-all [&_.slick-slide]:duration-300 [&_.slick-slide.slick-center_>_div_>_div_>div]:bg-[#1F1C23] [&_.slick-list]:box-sizing-border-box'>
<Slider ref={sliderRef} {...settings}>
{items.map((item) => (
<AppCard key={item.id} {...item} />
Expand Down
145 changes: 145 additions & 0 deletions src/components/CommunityCarousel/CommunityCarousel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
"use client";

import Container from "@/components/Container/Container";
import { eventSlides } from "@/data/home/community-items";
import { Body, Display } from "@/macros/Copy";
import Icon from "@/macros/Icons/Icon";
import ArrowLongSVG from "@/macros/SVGs/ArrowLongSVG";
import { useRef } from "react";
import Slider from "react-slick";
import "slick-carousel/slick/slick-theme.css";
import "slick-carousel/slick/slick.css";

const CommunityCard = ({ title, description, icon, url }) => (
<a href={url} className='flex items-center px-4 py-2 transition-all rounded-lg cursor-pointer hover:bg-gray-50'>
<div className='flex items-center justify-center w-10 h-10 overflow-hidden bg-gray-100 rounded-full'>{icon && icon}</div>
<div className='ml-3 sm:ml-5'>
<div className='font-medium text-gray-900 max-sm:text-sm'>{title}</div>
<div className='text-[12px] sm:text-sm text-black'>{description}</div>
</div>
</a>
);

const EventSlide = ({ title, image }) => (
<div className='px-1'>
<div className='relative rounded-lg overflow-hidden h-[420px] w-full lg:w-[565px] mx-auto'>
<img src={image} alt={title} className='object-cover w-full h-full' draggable='false' />
<div className='absolute bottom-0 left-0 right-0 p-1 bg-gradient-to-t from-black/60 to-transparent'>
<div className='inline-block px-4 py-3 bg-white rounded-md text-[14px] leading-[17px] text-black font-medium'>{title}</div>
</div>
</div>
</div>
);

const NavigationButtons = ({ sliderRef, className }) => (
<div className={`flex gap-2 ${className}`}>
<button className='group' onClick={() => sliderRef.current?.slickPrev()}>
<Icon
Icon={<ArrowLongSVG />}
hover
HoverIcon={<ArrowLongSVG />}
className='flex-grow-0 border border-gray-200 hover:border-gray-300'
direction='left'
border
size='md'
/>
<span className='sr-only'>Previous Slide</span>
</button>
<button className='group' onClick={() => sliderRef.current?.slickNext()}>
<Icon
Icon={<ArrowLongSVG />}
hover
HoverIcon={<ArrowLongSVG />}
className='flex-grow-0 border border-gray-200 hover:border-gray-300'
direction='right'
border
size='md'
/>
<span className='sr-only'>Next Slide</span>
</button>
</div>
);

const CommunityCarousel = ({ items }) => {
const sliderRef = useRef(null);

const settings = {
dots: false,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
variableWidth: true,
swipeToSlide: true,
centerMode: false,
centerPadding: "0px",
responsive: [
{
breakpoint: 1024,
settings: {
variableWidth: false,
adaptiveHeight: true,
centerPadding: "0px",
slidesToShow: 1,
slidesToScroll: 1,
centerMode: true,
},
},
{
breakpoint: 768,
settings: {
variableWidth: false,
adaptiveHeight: true,
centerPadding: "12px",
slidesToShow: 1,
slidesToScroll: 1,
centerMode: true,
},
},
],
};

return (
<section className='w-full pt-12 pb-12 bg-white lg:py-[100px]'>
<Container size='lg'>
<Display tag='h2' className='mb-4 text-gray-900 max-lg:text-center' size='sm'>
Join the community
</Display>
<div className='flex flex-col lg:flex-row items-center justify-center lg:justify-between mb-6 sm:mb-[44px] gap-4'>
<Body size={"lg"} className={"leading-[1.7em] max-lg:text-center max-lg:max-w-[540px] max-lg:mx-auto"}>
Join the Celestia community online or hang out at one of the grassroots Modular Meetups
</Body>
<NavigationButtons sliderRef={sliderRef} className='self-end hidden lg:flex sm:self-auto' />
</div>

<div className='flex flex-col gap-8 lg:gap-2 lg:flex-row'>
{/* Social Links Column */}
<div className='w-full lg:w-[260px] flex-shrink-0 bg-white rounded-lg border border-gray-200 px-1 py-2 md:py-6 lg:px-4 lg:py-2 h-auto lg:h-[420px] shadow-sm flex items-center'>
<div className='grid w-full grid-cols-2 sm:gap-1 lg:grid-cols-1'>
{items.map((item) => (
<CommunityCard key={item.id} {...item} />
))}
</div>
</div>

{/* Carousel Column */}
<div className='flex-1 overflow-hidden lg:mr-[-50vw] rounded-lg'>
<div className='[&_.slick-list]:lg:overflow-visible [&_.slick-track]:flex [&_.slick-slide]:h-[420px] [&_.slick-slide>div]:h-full [&_.slick-slide]:transition-all'>
<Slider ref={sliderRef} {...settings}>
{eventSlides.map((slide, index) => (
<EventSlide key={index} {...slide} />
))}
</Slider>
</div>
</div>

{/* Mobile Navigation Buttons */}
<NavigationButtons sliderRef={sliderRef} className='flex justify-center lg:mt-4 lg:hidden' />
</div>
</Container>
</section>
);
};

export default CommunityCarousel;
58 changes: 0 additions & 58 deletions src/components/EmblaCarousel/EmblaCarousel.js

This file was deleted.

77 changes: 0 additions & 77 deletions src/components/EmblaCarousel/EmblaCarouselArrowButtons.js

This file was deleted.

46 changes: 0 additions & 46 deletions src/components/EmblaCarousel/EmblaCarouselDotButtons.js

This file was deleted.

Loading

0 comments on commit 3749d0e

Please sign in to comment.