-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProjectDescription.tsx
More file actions
62 lines (57 loc) · 1.94 KB
/
ProjectDescription.tsx
File metadata and controls
62 lines (57 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'use client';
import Image from 'next/image';
import { useInView } from 'react-intersection-observer';
import { classNames } from '@/shared/lib/classNames/classNames';
import greenHaired from '@/shared/assets/images/mainpage/topImage.png';
import { Container } from '@/shared/ui/Container';
import cls from './ProjectDescription.module.scss';
import { Paragraph } from '@/shared/ui/Paragraph';
export interface Props {
className?: string;
title: string;
description: string;
subDescription?: string;
descriptionArray?: string[];
}
export const ProjectDescription = (props: Props) => {
const { description, title, subDescription } = props;
const { ref, inView } = useInView({
rootMargin: '-150px 0px',
triggerOnce: true,
});
const mods = {
[cls.inView]: inView,
};
return (
<section
ref={ref}
className={classNames(cls.Section, mods)}
id="description"
>
<div className={cls.imgHolder}>
<Image
src={greenHaired}
priority={true}
alt={'description hero'}
style={{ objectFit: 'cover' }}
className={classNames(cls.Image)}
/>
</div>
<Container className={classNames(cls.Container, mods)}>
<h2 className={cls.titleQuestion}>{title}</h2>
<div className={classNames(cls.imageTextBlock, mods)}>
<Paragraph
className={cls.description}
text={description}
/>
</div>
<div className={classNames(cls.subDescription, mods)}>
<Paragraph
className={cls.subDescription}
text={subDescription}
/>
</div>
</Container>
</section>
);
};