diff --git a/public/images/rotate1.jpg b/public/images/rotate1.jpg new file mode 100644 index 00000000..0a6432e9 Binary files /dev/null and b/public/images/rotate1.jpg differ diff --git a/public/images/rotate2.jpg b/public/images/rotate2.jpg new file mode 100644 index 00000000..7ac006ab Binary files /dev/null and b/public/images/rotate2.jpg differ diff --git a/public/images/rotate3.jpg b/public/images/rotate3.jpg new file mode 100644 index 00000000..4bd99179 Binary files /dev/null and b/public/images/rotate3.jpg differ diff --git a/public/images/rotate4.jpg b/public/images/rotate4.jpg new file mode 100644 index 00000000..70dc7f96 Binary files /dev/null and b/public/images/rotate4.jpg differ diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 00000000..6a213b8e Binary files /dev/null and b/public/logo.png differ diff --git a/src/components/Common/ImageFader/index.tsx b/src/components/Common/ImageFader/index.tsx new file mode 100644 index 00000000..4ccb9711 --- /dev/null +++ b/src/components/Common/ImageFader/index.tsx @@ -0,0 +1,50 @@ +import React, { + useState, + useEffect, + HTMLAttributes, + ForwardRefRenderFunction, +} from 'react'; + +interface ImageFaderProps extends HTMLAttributes { + backgroundImages: string[]; + rotationSpeed?: number; +} + +const DEFAULT_ROTATION_SPEED = 6000; + +const ImageFader: ForwardRefRenderFunction = ( + { backgroundImages, rotationSpeed = DEFAULT_ROTATION_SPEED, ...props }, + ref +) => { + const [activeIndex, setIndex] = useState(0); + + useEffect(() => { + const interval = setInterval( + () => setIndex((ai) => (ai + 1) % backgroundImages.length), + rotationSpeed + ); + + return () => { + clearInterval(interval); + }; + }, [backgroundImages, rotationSpeed]); + + return ( +
+ {backgroundImages.map((imageUrl, i) => ( +
+ ))} +
+ ); +}; + +export default React.forwardRef(ImageFader); diff --git a/src/components/Layout/LanguagePicker/index.tsx b/src/components/Layout/LanguagePicker/index.tsx index b1c66e64..1a8669a6 100644 --- a/src/components/Layout/LanguagePicker/index.tsx +++ b/src/components/Layout/LanguagePicker/index.tsx @@ -85,15 +85,12 @@ const LanguagePicker: React.FC = () => { onBlur={(e) => setLocale && setLocale(e.target.value as AvailableLocales) } + defaultValue={locale} > {(Object.keys( availableLanguages ) as (keyof typeof availableLanguages)[]).map((key) => ( - ))} diff --git a/src/components/Layout/Sidebar/index.tsx b/src/components/Layout/Sidebar/index.tsx index 19daaaed..127b2029 100644 --- a/src/components/Layout/Sidebar/index.tsx +++ b/src/components/Layout/Sidebar/index.tsx @@ -148,7 +148,11 @@ const Sidebar: React.FC = ({ open, setClosed }) => {
- Overseerr + + + Overseerr Logo + +