Release v0.4.1: Refactor platforms and orientation #115
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { Cookies, Platforms, XVideosOrientations, PornHubOrientations, YouPornOrientations, RedTubeOrientations, XHamsterOrientations } from '@/meta/settings';
|
import { Cookies, OrientationMapper, Platforms, XVideosOrientations } from '@/meta/settings';
|
||||||
|
|
||||||
import css from './Orientation.module.scss'
|
import css from './Orientation.module.scss'
|
||||||
|
|
||||||
|
@ -17,23 +17,7 @@ interface Props {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOrientations = (platform: Platforms):Object => {
|
const getOrientations = (platform: Platforms):Object => {
|
||||||
if ([Platforms.xnxx, Platforms.xvideos].includes(platform)) {
|
return OrientationMapper[platform];
|
||||||
return XVideosOrientations
|
|
||||||
}
|
|
||||||
|
|
||||||
if([Platforms.youporn].includes(platform)) {
|
|
||||||
return YouPornOrientations
|
|
||||||
}
|
|
||||||
|
|
||||||
if([Platforms.redtube].includes(platform)) {
|
|
||||||
return RedTubeOrientations
|
|
||||||
}
|
|
||||||
|
|
||||||
if([Platforms.xhamster].includes(platform)) {
|
|
||||||
return XHamsterOrientations
|
|
||||||
}
|
|
||||||
|
|
||||||
return PornHubOrientations
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Orientation: React.FC<Props> = (props) => {
|
const Orientation: React.FC<Props> = (props) => {
|
||||||
|
|
|
@ -58,3 +58,12 @@ export interface LangOption {
|
||||||
label: string;
|
label: string;
|
||||||
code: string;
|
code: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const OrientationMapper = {
|
||||||
|
[Platforms.xvideos]: XVideosOrientations,
|
||||||
|
[Platforms.xnxx]: XVideosOrientations,
|
||||||
|
[Platforms.pornhub]: PornHubOrientations,
|
||||||
|
[Platforms.youporn]: YouPornOrientations,
|
||||||
|
[Platforms.redtube]: RedTubeOrientations,
|
||||||
|
[Platforms.xhamster]: XHamsterOrientations
|
||||||
|
}
|
Loading…
Reference in New Issue