website/src/pages/index.js

54 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

2022-12-19 12:29:53 +00:00
import React, {useEffect, useState} from "react"
2022-08-26 13:46:21 +00:00
import Layout from "../components/layout"
import Hero from "../components/hero"
2022-08-27 08:45:32 +00:00
import CompatBtn from "../components/compatbtn"
2022-12-01 09:04:26 +00:00
import SEO from "../components/seo"
2022-08-26 13:46:21 +00:00
2022-12-01 09:04:26 +00:00
import bgImage from "../media/phones.webp"
2022-08-26 13:46:21 +00:00
2022-12-19 12:29:53 +00:00
/*
For some inexplicable reason on first load React decides to make this div class into "divider".
I have no idea why that happens this is why I implemented this weird hack that forces React to reload classes.
If you have any idea how to fix this properly, you're more than welcome to open a PR.
*/
const BuggyDiv = () => {
const [clName, setClName] = useState("flex justify-center w-full mb-5");
useEffect(() => {
setTimeout(() => {
setClName("flex justify-center w-full mb-5 div-loaded");
}, 100)
}, [])
return (
<div className={clName}>
<CompatBtn autoFocus={true} className="btn-primary" href="/install/">Install</CompatBtn>
<div className="divider divider-horizontal" />
<CompatBtn className="btn-primary" href="/repos/">Repositories</CompatBtn>
</div>
)
}
2022-08-26 13:46:21 +00:00
const IndexPage = () => {
return <Layout>
<Hero bg={bgImage}>
2022-12-01 09:04:26 +00:00
<h1 className="mb-5 text-5xl font-bold">Hello there</h1>
<p className="mb-5 text-lg">
Cloudstream is an Android app for streaming and downloading Movies, TV-Series and Anime.
2022-12-01 09:42:36 +00:00
<div className="divider" />
2022-12-01 09:04:26 +00:00
On this official cloudstream/recloudstream site you can find downloads links and a list of repositories of extensions.
</p>
2022-12-19 12:29:53 +00:00
<BuggyDiv />
2022-12-01 09:42:36 +00:00
<CompatBtn className="btn-secondary" href="/docs/">Guides, FAQ & Docs</CompatBtn>
2022-08-26 13:46:21 +00:00
</Hero>
</Layout>
}
export default IndexPage
export function Head() {
2022-12-01 09:04:26 +00:00
return <SEO />
2022-08-26 13:46:21 +00:00
}