Skip to content

Commit 2adba75

Browse files
authored
Merge pull request #568 from Alt-Org/dev
Dev main merge
2 parents 5c081b7 + cfeda72 commit 2adba75

File tree

54 files changed

+1219
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1219
-87
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { createPage } from '@/app/_helpers';
2+
import { useServerTranslation } from '@/shared/i18n';
3+
4+
export async function _getPage(lng: string) {
5+
const { t } = await useServerTranslation(lng, 'prg');
6+
return createPage({
7+
buildPage: () => ({}),
8+
buildSeo: () => ({
9+
title: t('head-title'),
10+
description: t('head-description'),
11+
keywords: t('head-keywords'),
12+
}),
13+
});
14+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { PRGPage } from '@/preparedPages/PRGPage';
2+
import { withPageData, createMetadataGenerator } from '@/app/_helpers';
3+
import { _getPage } from './_getPage';
4+
5+
export const generateMetadata = createMetadataGenerator(_getPage);
6+
export default withPageData(PRGPage, _getPage);

frontend-next-migration/src/app/[lng]/(intro)/team/layout.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ import { ScrollTop } from '@/features/ScrollTop';
44
import cls from './Layout.module.scss';
55
import useSizes from '@/shared/lib/hooks/useSizes';
66
import { classNames } from '@/shared/lib/classNames/classNames';
7-
import TeamHeader from '@/shared/ui/TeamHeader';
87
import MembersNavMenu from '@/features/NavigateMembers';
98
import { LayoutWithSidebars } from '@/preparedPages/Layouts';
10-
import headerImg from '@/shared/assets/images/members/members8.webp';
119
import { ScrollBottomButton } from './_components/_ScrollBottomButton';
1210
import play from '@/shared/assets/icons/playIcon.svg';
11+
import { TeamHeaderWithMosaic } from '@/shared/ui/TeamHeaderWithMosaic/ui/TeamHeaderWithMosaic';
1312

1413
type Props = {
1514
children: ReactNode;
@@ -24,10 +23,7 @@ export default function TeamLayout({ children }: Props) {
2423
id={'members'}
2524
className={classNames(cls.MembersPageMobile)}
2625
>
27-
<TeamHeader
28-
image={headerImg}
29-
dropdown={<MembersNavMenu />}
30-
/>
26+
<TeamHeaderWithMosaic dropdown={<MembersNavMenu />} />
3127
<div className={cls.buttonContainer}>
3228
<ScrollBottomButton
3329
IdToScrollBeforePlay={'members'}
@@ -43,7 +39,7 @@ export default function TeamLayout({ children }: Props) {
4339
id={'members'}
4440
className={classNames(cls.MembersPage)}
4541
>
46-
<TeamHeader image={headerImg} />
42+
<TeamHeaderWithMosaic />
4743
<LayoutWithSidebars
4844
className={cls.TeamPageSidebar}
4945
leftTopSidebar={{

frontend-next-migration/src/entities/Member/api/membersApi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const membersApi = directusApi.injectEndpoints({
2222
'team.translations.*',
2323
'translations.*',
2424
'logo.*',
25+
'portrait.id',
26+
'portrait.title',
2527
],
2628
limit: 500,
2729
}),

frontend-next-migration/src/entities/Member/model/types/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ export interface Logo {
22
url: string;
33
}
44

5+
export interface Asset {
6+
id: string;
7+
title: string;
8+
}
9+
510
export interface Member {
611
id: number;
712
name: string;
@@ -17,6 +22,7 @@ export interface Member {
1722
department?: Department | null;
1823
team?: Team | null;
1924
translations?: Translation[];
25+
portrait?: Asset | null;
2026
}
2127

2228
export interface Department {

frontend-next-migration/src/entities/PresentationPackages/model/data/artGameSections.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { createSection } from '../createSection';
2-
import info from '@/shared/assets/images/gameArt/info.webp';
3-
import intro from '@/shared/assets/images/gameArt/intro.webp';
4-
import implementation from '@/shared/assets/images/gameArt/implementation.webp';
5-
import message from '@/shared/assets/images/gameArt/message.webp';
6-
import joinus from '@/shared/assets/images/gameArt/joinus.webp';
2+
import info from '@/shared/assets/images/gameArt/videogames.png';
3+
import intro from '@/shared/assets/images/gameArt/teachingpackage.png';
4+
import implementation from '@/shared/assets/images/gameArt/teacherspage.png';
5+
import message from '@/shared/assets/images/gameArt/structure.png';
6+
import joinus from '@/shared/assets/images/gameArt/taskthemes.png';
77
import gameArtLogo from '@/shared/assets/images/gameArt/gameArtLogo.webp';
88

99
/**

frontend-next-migration/src/features/NavigateGameArt/ui/GameArtNavMenuAsDropdown.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.Width {
22
width: 100%;
3-
min-width: 280px;
3+
min-width: 300px;
44
padding-top: var(--spacing-800);
55

66
@media (max-width: breakpoint(lg)) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.Title {
22
padding-left: 5%;
3+
margin-bottom: 25px;
34
}

frontend-next-migration/src/preparedPages/MainPage/ui/MainPage.tsx

Lines changed: 91 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
'use client';
2-
import { SectionHeroesBlocks, HeroesBlocksProps } from '@/widgets/SectionHeroesBlocks';
2+
import { DescriptionCard, DescriptionCardTheme } from '@/shared/ui/v2/DescriptionCard';
3+
import defenceGallery from '@/shared/assets/images/descriptionCard/defense_gallery.png';
4+
import {
5+
DescriptionCardMobile,
6+
DescriptionCardMobileTheme,
7+
} from '@/shared/ui/v2/DescriptionCardMobile';
8+
import defenceGalleryMobile from '@/shared/assets/images/descriptionCard/defense_gallery_mobile.png';
9+
import useSizes from '@/shared/lib/hooks/useSizes';
310
import { Gallery, GalleryProps } from './_components/sections/Gallery';
411
import { GetToKnowComicsProps } from './_components/sections/GetToKnowComics';
512
import { PlayWithUs, PlayWithUsProps } from './_components/sections/PlayWithUs';
6-
import { NewsSection, NewsSectionProps } from './_components/sections/NewsSection';
13+
import { NewsCard } from '@/widgets/NewsCard';
14+
import { useGetNewsQuery, formatNews } from '@/entities/NewsV2';
15+
import { envHelper } from '@/shared/const/envHelper';
16+
import hannu from '@/shared/assets/images/heros/hannu-hodari/hannu-hodari.png';
717
import {
818
ProjectDescription,
919
ProjectDescriptionProps,
@@ -12,31 +22,38 @@ import { VideoAndGalleriesProps } from './_components/sections/VideoAndGalleries
1222
import cls from './page.module.scss';
1323
import { WallIntroAnimation } from '@/shared/ui/v2/WallIntroAnimation';
1424
import { ContactSection, ContactSectionProps } from './_components/sections/ContactSection';
25+
import { useParams } from 'next/navigation';
26+
import { useClientTranslation } from '@/shared/i18n';
1527

1628
export type Props = {
1729
projectDescription: ProjectDescriptionProps;
1830
playWithUs: PlayWithUsProps;
1931
getToKnowComics: GetToKnowComicsProps;
2032
videoAndGalleries: VideoAndGalleriesProps;
2133
gallery: GalleryProps;
22-
heroesBlocks: HeroesBlocksProps;
2334
galleryCopy: GalleryProps;
2435
contactSection: ContactSectionProps;
25-
newsSection: NewsSectionProps;
2636
};
2737

2838
function MainPage(props: Props) {
2939
const {
3040
projectDescription,
3141
playWithUs,
3242
// getToKnowComics,
33-
heroesBlocks,
3443
// classifiedHeroesBlocks,
3544
gallery,
3645
contactSection,
37-
newsSection,
3846
} = props;
3947

48+
const params = useParams();
49+
const lng = params.lng as string;
50+
const lngCode = lng === 'en' ? 'en-US' : lng === 'fi' ? 'fi-FI' : lng;
51+
const { isMobileSize } = useSizes();
52+
const { data: latestNews } = useGetNewsQuery({ limit: 2, page: 1 });
53+
const directusBaseUrl = envHelper.directusHost;
54+
const groupedNews = formatNews(latestNews || [], lngCode || 'fi-FI');
55+
const { t } = useClientTranslation('main');
56+
4057
return (
4158
<div className={cls.MainPage}>
4259
<WallIntroAnimation renderOnce={true} />
@@ -52,15 +69,75 @@ function MainPage(props: Props) {
5269
{/*<VideoAndGalleries*/}
5370
{/* {...videoAndGalleries}*/}
5471
{/*/>*/}
55-
56-
<SectionHeroesBlocks
57-
{...heroesBlocks}
58-
maxHeroesPerGroup={2}
59-
maxGroupsPerPage={3}
60-
/>
72+
{isMobileSize ? (
73+
<div className={cls.descriptionCardMobile}>
74+
<a
75+
className={cls.cardLink}
76+
href={`/defense-gallery`}
77+
rel="noopener noreferrer"
78+
>
79+
<DescriptionCardMobile theme={DescriptionCardMobileTheme.DEFENSEGALLERY}>
80+
<DescriptionCardMobile.Texts title={t('descriptionCard-title')} />
81+
<DescriptionCardMobile.Image
82+
src={defenceGalleryMobile}
83+
alt="defense gallery mobile"
84+
/>
85+
</DescriptionCardMobile>
86+
</a>
87+
</div>
88+
) : (
89+
<div className={cls.descriptionCard}>
90+
<a
91+
className={cls.cardLink}
92+
href={`/defense-gallery`}
93+
rel="noopener noreferrer"
94+
>
95+
<DescriptionCard theme={DescriptionCardTheme.DEFENSEGALLERY}>
96+
<DescriptionCard.Texts width="25%">
97+
<DescriptionCard.Texts.Title>
98+
{t('descriptionCard-title')}
99+
</DescriptionCard.Texts.Title>
100+
</DescriptionCard.Texts>
101+
<DescriptionCard.Image width="65%">
102+
<DescriptionCard.Image.Image
103+
src={defenceGallery}
104+
alt="defence gallery"
105+
/>
106+
</DescriptionCard.Image>
107+
</DescriptionCard>
108+
</a>
109+
</div>
110+
)}
61111
<Gallery {...gallery} />
62-
63-
<NewsSection {...newsSection} />
112+
<div className={cls.newsSection}>
113+
<h2 className={cls.newsHeader}>{t('newsSection-title')}</h2>
114+
<div className={cls.newsGrid}>
115+
{groupedNews.map((news) => {
116+
const imageSrc = news.titlePicture?.id
117+
? `${directusBaseUrl}/assets/${news.titlePicture.id}`
118+
: hannu.src;
119+
return (
120+
<NewsCard
121+
key={news.id}
122+
titlePicture={imageSrc}
123+
title={news.title}
124+
previewText={news.previewText}
125+
date={news.date}
126+
id={news.id}
127+
/>
128+
);
129+
})}
130+
</div>
131+
<div className={cls.linkWrapper}>
132+
<a
133+
className={cls.link}
134+
href={`/news`}
135+
rel="noopener noreferrer"
136+
>
137+
{t('newsSection-seeMore')}
138+
</a>
139+
</div>
140+
</div>
64141
<ContactSection {...contactSection} />
65142

66143
{/*<Gallery {...galleryCopy} />*/}

frontend-next-migration/src/preparedPages/MainPage/ui/_components/sections/ContactSection/ContactSection.module.scss

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232
color: var(--primary-color);
3333
white-space: pre-line;
3434
text-align: center;
35-
font-family: var(--font-family-title), sans-serif;
35+
font: var(--font-sw-xxl), sans-serif;
3636
}
37+
3738
.Link {
3839
color: black;
3940
text-decoration: none;
@@ -43,7 +44,7 @@
4344
transition: all 0.3s ease-in-out;
4445
border: 1px solid black;
4546
box-shadow: 0.1rem 0.3rem black;
46-
font-family: var(--font-family-secondary) !important;
47+
font: var(--font-dm-m) !important;
4748
&:hover {
4849
transform: scale(1.05);
4950
}
@@ -56,12 +57,15 @@
5657
}
5758
.ContentWithNav {
5859
gap: 3rem;
60+
5961
.title {
60-
font-size: 1.3rem;
62+
font: var(--font-sw-l), sans-serif;
6163
}
64+
6265
.Link {
6366
font-size: 0.8rem;
6467
}
68+
6569
}
6670
.sideImg {
6771
margin-top: -90px;
@@ -71,9 +75,11 @@
7175
@media screen and (max-width: breakpoint(sm)) {
7276
.ContentWithNav {
7377
gap: 1rem;
78+
7479
.title {
75-
font-size: 1.2rem;
80+
font: var(--font-sw-l), sans-serif;
7681
}
82+
7783
.Link {
7884
font-size: 0.8rem;
7985
}
@@ -91,9 +97,11 @@
9197
@media screen and (max-width: breakpoint(xs)) {
9298
.ContentWithNav {
9399
gap: 0;
100+
94101
.title {
95-
font-size: 1.2rem;
102+
font: var(--font-sw-l), sans-serif;
96103
}
104+
97105
.Link {
98106
font-size: 0.8rem;
99107
}

0 commit comments

Comments
 (0)