-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAltZone.tsx
More file actions
140 lines (133 loc) · 5.02 KB
/
AltZone.tsx
File metadata and controls
140 lines (133 loc) · 5.02 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
'use client';
import { useInView } from 'react-intersection-observer';
import { Container } from '@/shared/ui/Container';
import { classNames } from '@/shared/lib/classNames/classNames';
import Image, { StaticImageData } from 'next/image';
import cls from './AltZone.module.scss';
import { AppExternalLinks } from '@/shared/appLinks/appExternalLinks';
import instaIcon from '@/shared/assets/images/Insta2.svg';
import discordIcon from '@/shared/assets/images/Discord2.svg';
import facebookIcon from '@/shared/assets/images/Facebook2.svg';
import youtubeIcon from '@/shared/assets/images/Youtube2.svg';
import useSizes from '@/shared/lib/hooks/useSizes';
export type Props = {
title: string;
infoText: string;
socialsText: string;
followUsText: string;
seeMoreLink: {
text: string;
href: string;
};
socialMediaLinks: string[];
videoLink: string;
gameImg?: StaticImageData;
};
const AltZone = (props: Props) => {
const { title, infoText, seeMoreLink, gameImg, followUsText } = props;
const { isMobileSize } = useSizes();
const { ref, inView } = useInView({
rootMargin: '-150px 0px',
triggerOnce: true,
});
const mods = {
[cls.inView]: inView,
};
return (
<section
ref={ref}
className={classNames(cls.SectionAltZone, mods)}
>
<Container className={cls.Container}>
<div className={cls.titleWrapper}>
<h2 className={classNames(cls.title, mods)}>{title}</h2>
<p className={cls.InfoText}>{infoText}</p>
<a
className={cls.aboutLink}
href={seeMoreLink.href}
target="_blank"
rel="noreferrer"
>
{seeMoreLink.text}
</a>
<p className={cls.socialMediaLinks}>{followUsText}</p>
<div className={cls.socialMediaHolder}>
<a
href={AppExternalLinks.discord}
target="_blank"
rel="noreferrer"
>
<Image
src={discordIcon.src}
alt="Discord"
className={cls.socialMediaIcon}
width={32}
height={32}
/>
</a>
<a
href={AppExternalLinks.instagram}
target="_blank"
rel="noreferrer"
>
<Image
src={instaIcon.src}
alt="Instagram"
className={cls.socialMediaIcon}
width={32}
height={32}
/>
</a>
<a
href={AppExternalLinks.facebook}
target="_blank"
rel="noreferrer"
>
<Image
src={facebookIcon.src}
alt="Facebook"
className={cls.socialMediaIcon}
width={32}
height={32}
/>
</a>
<a
href={AppExternalLinks.youtube}
target="_blank"
rel="noreferrer"
>
<Image
src={youtubeIcon.src}
alt="YouTube"
className={cls.socialMediaIcon}
width={32}
height={32}
/>
</a>
</div>
</div>
<div className={cls.imgWrapper}>
{gameImg ? (
isMobileSize ? (
<Image
src={gameImg}
alt=""
width={328}
height={477}
/>
) : (
<Image
src={gameImg}
alt=""
className={cls.MinSizes}
width={677}
height={978}
/>
)
) : null}
</div>
</Container>
</section>
);
};
export default AltZone;