Skip to content

Commit

Permalink
schedule block
Browse files Browse the repository at this point in the history
  • Loading branch information
preshetin committed Nov 18, 2024
1 parent 379ae42 commit 6b2d64b
Showing 1 changed file with 82 additions and 133 deletions.
215 changes: 82 additions & 133 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'
import Image from "next/image";

import { useState } from 'react'
import { useEffect, useState } from 'react'
import { Dialog, DialogPanel } from '@headlessui/react'
import { Bars3Icon, XMarkIcon } from '@heroicons/react/24/outline'
import { CloudArrowUpIcon, LockClosedIcon, ServerIcon, FingerPrintIcon } from '@heroicons/react/20/solid'
Expand Down Expand Up @@ -138,9 +138,9 @@ export default function Example() {
</p>
<div className="mt-10 flex items-center justify-center gap-x-6">
<a
href="https://www.dhamma.org/ru/schedules/schdullabha#child_course"
// href="https://www.dhamma.org/ru/schedules/schdullabha#child_course"
href="#schedule"
className="rounded-md bg-indigo-600 px-3.5 py-2.5 text-lg font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
target='_blank'
>
Записаться на курс
</a>
Expand All @@ -149,6 +149,9 @@ export default function Example() {
</a> */}
</div>
</div>
{/* <div className="w-full md:w-1/2 p-4">
<iframe width="560" height="415" src="https://www.youtube.com/embed/fc-m3YHd9EE?si=yRIDyg0WuTSdRjfI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div> */}
</div>
{/* <div
aria-hidden="true"
Expand All @@ -165,6 +168,16 @@ export default function Example() {
</div>
</div>

<div className="bg-white py-24 sm:py-32">
<div className="mx-auto max-w-7xl px-6 lg:px-8">
<div className="mx-auto max-w-2xl lg:text-center">
<p id="schedule" className="mt-2 text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
Расписание
</p>
</div>
<CoursesList />
</div>
</div>

<Centered2x2Grid />

Expand Down Expand Up @@ -249,25 +262,6 @@ function Centered2x2Grid() {
}


const productFeatures = [
{
name: 'Push to deploy.',
description:
'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.',
icon: CloudArrowUpIcon,
},
{
name: 'SSL certificates.',
description: 'Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo.',
icon: LockClosedIcon,
},
{
name: 'Database backups.',
description: 'Ac tincidunt sapien vehicula erat auctor pellentesque rhoncus. Et magna sit morbi lobortis.',
icon: ServerIcon,
},
]

function FeatureSection() {
return (
<div className="overflow-hidden bg-white py-24 sm:py-32">
Expand Down Expand Up @@ -308,115 +302,70 @@ function FeatureSection() {



interface Course {
application_url: string;
date: string;
description: string;
location: string;
status: string;
}

export function CoursesList() {
const [courses, setCourses] = useState<Course[]>([]);
const [loading, setLoading] = useState<boolean>(true);
const [error, setError] = useState<string | null>(null);

useEffect(() => {
const fetchCourses = async () => {
try {
const url = 'https://seahorse-app-db78s.ondigitalocean.app/api/courses'
const response = await fetch(url); // Replace with your API endpoint
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
setCourses(data);
} catch (error) {
setError(error instanceof Error ? error.message : 'An error occurred');
} finally {
setLoading(false);
}
};

fetchCourses();
}, []);

if (loading) {
return <div>Loading...</div>;
}

if (error) {
return <div>Error: {error}</div>;
}

return (
<ul role="list" className="divide-y divide-gray-100">
{courses.map((course) => (
<li key={course.application_url} className="flex justify-between gap-x-6 py-5">
<div className="min-w-0 flex-1">
<p className="text-lg mb1 font-semibold text-gray-900">{course.date}</p>
<p className="mt-1 mb1 text-m text-gray-500">{course.description}</p>
<p className="mt-1 mb1 text-m text-gray-500">{course.status}</p>
<p className="mt-1 mb1 text-m text-gray-500">{course.location}</p>
</div>
<div className="flex items-center">
<a
href={course.application_url}
className="inline-block px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded hover:bg-indigo-500"
target="_blank"
>
Анкета
</a>
</div>
</li>
))}
</ul>
);
}






// import Image from "next/image";

// export default function Home() {
// return (
// <main className="flex min-h-screen flex-col items-center justify-between p-24">
// <div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
// <p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
// Get started by editing&nbsp;
// <code className="font-mono font-bold">src/app/page.tsx</code>
// </p>
// <div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:size-auto lg:bg-none">
// <a
// className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
// href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
// target="_blank"
// rel="noopener noreferrer"
// >
// <Image
// className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
// src="/dhammawheel.png"
// alt="Dhamma wheel"
// width={80}
// height={112}
// priority
// />
// </a>
// </div>
// </div>

// <div className="relative z-[-1] flex place-items-center before:bg-children after:content-[''] before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px]">
// <h1 className="mb-3 text-2xl font-semibold">
// Ananapa for Young People
// </h1>
// </div>

// <div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
// <a
// href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
// className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
// target="_blank"
// rel="noopener noreferrer"
// >
// <h2 className="mb-3 text-2xl font-semibold">
// Docs{" "}
// <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
// -&gt;
// </span>
// </h2>
// <p className="m-0 max-w-[30ch] text-sm opacity-50">
// Find in-depth information about Next.js features and API.
// </p>
// </a>

// <a
// href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
// className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
// target="_blank"
// rel="noopener noreferrer"
// >
// <h2 className="mb-3 text-2xl font-semibold">
// Learn{" "}
// <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
// -&gt;
// </span>
// </h2>
// <p className="m-0 max-w-[30ch] text-sm opacity-50">
// Learn about Next.js in an interactive course with&nbsp;quizzes!
// </p>
// </a>

// <a
// href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
// className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
// target="_blank"
// rel="noopener noreferrer"
// >
// <h2 className="mb-3 text-2xl font-semibold">
// Templates{" "}
// <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
// -&gt;
// </span>
// </h2>
// <p className="m-0 max-w-[30ch] text-sm opacity-50">
// Explore starter templates for Next.js.
// </p>
// </a>

// <a
// href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
// className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
// target="_blank"
// rel="noopener noreferrer"
// >
// <h2 className="mb-3 text-2xl font-semibold">
// Deploy{" "}
// <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
// -&gt;
// </span>
// </h2>
// <p className="m-0 max-w-[30ch] text-balance text-sm opacity-50">
// Instantly deploy your Next.js site to a shareable URL with Vercel.
// </p>
// </a>
// </div>
// </main>
// );
// }

0 comments on commit 6b2d64b

Please sign in to comment.