Skip to content

Commit

Permalink
Merge branch 'master' into dev/multiples-pactos
Browse files Browse the repository at this point in the history
  • Loading branch information
xtian7489 committed Apr 22, 2024
2 parents 85bdf5b + 3d619b8 commit 0432a8a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
Binary file added public/video/video_banner_es.mp4
Binary file not shown.
Binary file added public/video/video_banner_pt.mp4
Binary file not shown.
2 changes: 0 additions & 2 deletions src/components/common/language-selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export default function LanguageSelector() {
useEffect(() => {
if (user) {
changeLanguage(user.lang)
} else {
changeLanguage(navigator.language.split("-")[0] || navigator.userLanguage.split("-")[0])
}
}, [])

Expand Down
8 changes: 4 additions & 4 deletions src/components/home/banner-resurgente.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import VideoBanner from "./video-banner";

export default function BannerResurgente(){
export default function BannerResurgente(){
return <div className=" banner-re-surgente">
<div className="content has-background-orange">
<div className="content has-background-orange is-flex is-align-items-center">
<div className="title is-size-1 is-size-3-touch">¿Qué es <br />
(re)surgentes <br />
y el pacto <br />
Expand All @@ -12,7 +13,6 @@ export default function BannerResurgente(){
</div>

</div>
<div className="banner-image">
</div>
<VideoBanner/>
</div>
}
18 changes: 18 additions & 0 deletions src/components/home/video-banner.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use client'
import { useLanguage } from '@/context/lang-context';
import React from 'react'

function VideoBanner() {
const { language } = useLanguage();
return (
<div className='banner-image has-background-black is-flex is-align-items-center'>
<video controls>
<source src={`/video/video_banner_${language}.mp4`} type="video/mp4"/>

</video>

</div>
)
}

export default VideoBanner
2 changes: 1 addition & 1 deletion src/context/lang-context.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const LANGUAGE_INFO_COOKIE = 'RES_LANG'
export const LanguageProvider = ({ children }) => {
const storedLanguage = window.localStorage.getItem(LANGUAGE_INFO_COOKIE);
const jsonStoredLanguage = storedLanguage && JSON.parse(storedLanguage);
const [language, setLanguage] = useState(jsonStoredLanguage ? jsonStoredLanguage.language : 'es');
const [language, setLanguage] = useState(jsonStoredLanguage ? jsonStoredLanguage.language : navigator.language.split("-")[0] || navigator.userLanguage.split("-")[0] || 'es');

const changeLanguage = (newLanguage) => {
const switchLanguage = {
Expand Down

0 comments on commit 0432a8a

Please sign in to comment.