fixes
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 234 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 244 KiB |
@@ -1,31 +1,10 @@
|
||||
'use client';
|
||||
|
||||
import { api } from '@/api';
|
||||
import { ArrowMoreIcon } from '@/components/icons/ArrowMoreIcon';
|
||||
import { IProject } from '@/types/IProject';
|
||||
import { Descriptor } from '@/ui/Descriptor';
|
||||
import { Title } from '@/ui/Title';
|
||||
import Image from 'next/image';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export function Streaming() {
|
||||
const [streamingProjects, setSteramingProjects] = useState<IProject[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
getStreamingProjects();
|
||||
}, []);
|
||||
|
||||
async function getStreamingProjects() {
|
||||
try {
|
||||
const projects: IProject[] = await api.get('projects').json();
|
||||
setSteramingProjects(
|
||||
projects.filter(project => project.devices.includes('stream')),
|
||||
);
|
||||
} catch (error) {
|
||||
alert(`Error: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="pt-[200px] space-y-20">
|
||||
<Title>
|
||||
@@ -61,20 +40,31 @@ export function Streaming() {
|
||||
</p>
|
||||
</div>
|
||||
<div className="p-4 grid grid-cols-3 gap-4 col-start-4 col-span-full border-y border-[#3D425C]">
|
||||
{streamingProjects.map(streamingProject => (
|
||||
<StreamingProject {...streamingProject} key={streamingProject.id} />
|
||||
))}
|
||||
<StreamingProject
|
||||
city="Екатеринбург"
|
||||
name="Re:volution Towers"
|
||||
image="/img/pages/home/streaming/revolution.png"
|
||||
/>
|
||||
<StreamingProject
|
||||
city="Тюмень"
|
||||
image="/img/pages/home/streaming/aivazovsky.png"
|
||||
name="Айвазовский City"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function StreamingProject({ city, name, image }: IProject) {
|
||||
function StreamingProject({
|
||||
city,
|
||||
name,
|
||||
image,
|
||||
}: Pick<IProject, 'city' | 'name' | 'image'>) {
|
||||
return (
|
||||
<div className="flex flex-col justify-between gap-y-12 p-6 [background:center/cover_url(/img/pages/home/stats/highlight.svg)_no-repeat,#14161F] col-span-1">
|
||||
<Image
|
||||
src={process.env.NEXT_PUBLIC_API + '/upload/' + image}
|
||||
src={image}
|
||||
width={164}
|
||||
height={164}
|
||||
alt={''}
|
||||
|
||||
Reference in New Issue
Block a user