From 6804e3626fb9c42861ed831d9f9fe7027d9d94ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Mon, 6 Jul 2026 00:18:34 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20remplacer=20les=20puces=20par=20un=20se?= =?UTF-8?q?lect=20group=C3=A9=20par=20continent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/teks/teks.js | 103 +++++++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 44 deletions(-) diff --git a/components/teks/teks.js b/components/teks/teks.js index f3eecae..6fb7190 100644 --- a/components/teks/teks.js +++ b/components/teks/teks.js @@ -3,7 +3,10 @@ import {useEffect, useState} from 'react' import PropTypes from 'prop-types' import Box from '@mui/material/Box' -import Chip from '@mui/material/Chip' +import Select from '@mui/material/Select' +import MenuItem from '@mui/material/MenuItem' +import ListSubheader from '@mui/material/ListSubheader' +import FormControl from '@mui/material/FormControl' import Typography from '@mui/material/Typography' import Tooltip from '@mui/material/Tooltip' import {useMediaQuery} from '@mui/material' @@ -12,6 +15,8 @@ import slugify from 'slugify' import {styled} from '@mui/material/styles' import ExplicitIcon from '@mui/icons-material/Explicit' +import TranslateIcon from '@mui/icons-material/Translate' +import StarIcon from '@mui/icons-material/Star' import Image from 'next/image' @@ -92,11 +97,11 @@ const CONTINENTS = ['Afrique', 'Asie', 'Europe'] const TRAD_FIELDS = [ // Afrique — langues vedettes en premier - {field: 'yoruba', title: 'Yorùbá', continent: 'Afrique'}, - {field: 'lingala', title: 'Lingála', continent: 'Afrique'}, - {field: 'wolof', title: 'Wolof', continent: 'Afrique'}, - {field: 'swahili', title: 'Kiswahili', continent: 'Afrique'}, - {field: 'hausa', title: 'Hausa', continent: 'Afrique'}, + {field: 'yoruba', title: 'Yorùbá', continent: 'Afrique', vedette: true}, + {field: 'lingala', title: 'Lingála', continent: 'Afrique', vedette: true}, + {field: 'wolof', title: 'Wolof', continent: 'Afrique', vedette: true}, + {field: 'swahili', title: 'Kiswahili', continent: 'Afrique', vedette: true}, + {field: 'hausa', title: 'Hausa', continent: 'Afrique', vedette: true}, {field: 'arabe', title: 'العربية', continent: 'Afrique'}, {field: 'oromo', title: 'Oromoo', continent: 'Afrique'}, {field: 'igbo', title: 'Igbo', continent: 'Afrique'}, @@ -125,7 +130,7 @@ const langToArray = parole => { return TRAD_FIELDS .filter(({field}) => parole.traductions[field]) - .map(({field, title, continent}) => ({field, title, continent, lang: parole.traductions[field]})) + .map(({field, title, continent, vedette}) => ({field, title, continent, vedette, lang: parole.traductions[field]})) } const BROWSER_LANG_TO_FIELD = { @@ -268,45 +273,55 @@ export default function Teks({parole}) { )} - - setTab(0)} - /> - {CONTINENTS.map(continent => { - const items = langArray - .map((item, index) => ({...item, index})) - .filter(item => item.continent === continent) + + + + {tab === 0 && ( <>