Skip to content

Commit 922ea1a

Browse files
committed
trucs
1 parent dcbd0e3 commit 922ea1a

File tree

7 files changed

+1693
-10393
lines changed

7 files changed

+1693
-10393
lines changed

components/datapack.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ export default function Datapack({ data, minHeight }: any) {
7171
// let modules = activeModules
7272
let updatedModules: IDictionary = {}
7373

74-
updatedModules[module] = !(activeModules[module]);
74+
if ( !(data.required_modules.includes(module)) ){
75+
updatedModules[module] = !(activeModules[module]);
76+
}
77+
else{
78+
updatedModules[module] = true
79+
}
7580

7681
setActiveModules({
7782
...activeModules,
@@ -90,7 +95,9 @@ export default function Datapack({ data, minHeight }: any) {
9095
}
9196
else {
9297
selectedVersion.modules?.map(module => {
93-
updatedModules[module] = false;
98+
if ( !(data.required_modules.includes(module)) ){
99+
updatedModules[module] = false;
100+
}
94101
})
95102
}
96103
setActiveModules({
@@ -168,6 +175,16 @@ export default function Datapack({ data, minHeight }: any) {
168175
</Box>
169176
</CardContent>
170177
</Card>
178+
<Card>
179+
<Box sx={{display: 'flex', flexWrap: 'wrap', '& > *': { mr: 1} }}>
180+
<a href="https://mtxserv.com/fr/?utm_source=altearn_website&utm_medium=website&utm_campaign=altearn" title="Louez votre serveur haute qualité, profitez pleinement de vos jeux préférés">
181+
<img src="https://mtxserv.com/build/img/banners/serveur_minecraft.png" height="80"/>
182+
</a>
183+
<Box sx={{display: 'flex', flexDirection: 'column', justifyContent: 'center'}}>
184+
<p>Merci à notre partenaire <a style={{textDecoration: 'underline'}} href="https://mtxserv.com/fr/?utm_source=altearn_website&utm_medium=website&utm_campaign=altearn">mTxServ</a> !</p>
185+
</Box>
186+
</Box>
187+
</Card>
171188
</Stack>
172189
</Grid>
173190
<Grid item xs={1} md={1} lg={1} className={"heightViewport"}>
@@ -244,6 +261,7 @@ export default function Datapack({ data, minHeight }: any) {
244261
checked={activeModules[module]}
245262
tabIndex={-1}
246263
inputProps={{ 'aria-labelledby': module }}
264+
disabled={data.required_modules?.includes(module)}
247265
/>
248266
</ListItemIcon>
249267
<ListItemText id={module} primary={module} />

components/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
33
import { AppBar, Stack, Toolbar, Typography } from "@mui/material";
44
import { Box } from "@mui/system";
55
import Head from "next/head";
6-
import { ComponentProps, useEffect, useState, useRef } from "react";
6+
import { useRef } from "react";
77
import Link from 'next/link'
88
import useTranslation from "next-translate/useTranslation";
99
import useResizeObserver from "@react-hook/resize-observer";

lib/datapacks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,5 @@ export async function getContributors() {
194194

195195
export async function getGlib() {
196196

197-
return { devs: getDevs(), releases: getReleases(), contributors: await getContributors() }
197+
return { devs: getDevs(), releases: getReleases(), contributors: await getContributors(), required_modules: process.env.REQUIRED_MODULES?.split(';') }
198198
}

next-env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32
/// <reference types="next/image-types/global" />
43

54
// NOTE: This file should not be edited

0 commit comments

Comments
 (0)