v0.2/features #68

Merged
lamacchinadesiderante merged 7 commits from v0.2/features into develop 2024-05-12 12:01:16 +00:00
8 changed files with 70 additions and 3 deletions
Showing only changes of commit 3e6d700063 - Show all commits

View File

@ -24,7 +24,8 @@
"lang_it": "Italian", "lang_it": "Italian",
"lang_en": "English", "lang_en": "English",
"settings_title": "Settings", "settings_title": "Settings",
"platform_title": "Platform:" "platform_title": "Platform:",
"category_title": "Category:"
}, },
"Results": { "Results": {
"query": "Search results for: {{ query }}", "query": "Search results for: {{ query }}",

View File

@ -24,7 +24,8 @@
"lang_it": "Italiano", "lang_it": "Italiano",
"lang_en": "Inglese", "lang_en": "Inglese",
"settings_title": "Impostazioni", "settings_title": "Impostazioni",
"platform_title": "Piattaforma:" "platform_title": "Piattaforma:",
"category_title": "Categoria:"
}, },
"Results": { "Results": {
"query": "Risultati della ricerca per: {{ query }}", "query": "Risultati della ricerca per: {{ query }}",

View File

@ -0,0 +1,11 @@
@import 'fontsize';
@import 'spacing';
.container {
.title {
margin-bottom: $spacing_16;
}
}

View File

@ -0,0 +1,42 @@
'use client'
import { XVideosCategories } from '@/meta/settings';
import css from './Category.module.scss'
import React from 'react';
import { setCookie } from '@/utils/cookies/write';
import { useCookies } from 'react-cookie';
interface Props {
labels: {
title: string,
}
}
const Category: React.FC<Props> = (props) => {
const { labels } = props
const [cookies] = useCookies(['category']);
const handleChange = async (event: React.ChangeEvent<HTMLSelectElement>) => {
const value = event.target.value;
await setCookie('category', value)
}
return (
<div className={css.container}>
<div className={css.title}>{labels.title}</div>
<select defaultValue={ cookies.category ?? XVideosCategories.etero } onChange={handleChange} name={'category'} aria-label={labels.title}>
{Object.keys(XVideosCategories).map((elem, key) => {
return <option className={css.option} key={key} value={elem}>{elem.toUpperCase()}</option>
})}
</select>
</div>
);
};
export default Category;

View File

@ -16,7 +16,7 @@
.content { .content {
display: flex; display: flex;
flex-direction: row; flex-direction: column;
} }
} }

View File

@ -6,12 +6,14 @@ import { IoCloseCircleOutline } from "react-icons/io5";
import style from './Modal.module.scss' import style from './Modal.module.scss'
import Platform from './Platform'; import Platform from './Platform';
import Category from './Category';
interface Props { interface Props {
handleClose(): void handleClose(): void
labels: { labels: {
title: string title: string
platform: any platform: any
category: any
} }
} }
@ -28,6 +30,7 @@ const LangSwitcher: React.FC<Props> = (props) => {
</header> </header>
<div className={style.content}> <div className={style.content}>
<Platform labels={{ title: labels.platform.title }} /> <Platform labels={{ title: labels.platform.title }} />
<Category labels={{ title: labels.category.title }} />
</div> </div>
</article> </article>
</dialog > </dialog >

View File

@ -28,6 +28,9 @@ const Menu: React.FC = () => {
title: t('settings_title'), title: t('settings_title'),
platform: { platform: {
title: t('platform_title') title: t('platform_title')
},
category: {
title: t('category_title')
} }
} }

View File

@ -3,6 +3,12 @@ export enum Platforms {
xnxx= 'xnxx' xnxx= 'xnxx'
} }
export enum XVideosCategories {
etero= 'etero',
gay= 'gay',
trans= 'trans'
}
export enum Themes { export enum Themes {
light= 'light', light= 'light',
dark= 'dark', dark= 'dark',