import React, { useEffect, useRef } from 'react';
import { Helmet } from 'react-helmet-async';
import { useAccount } from '@plebbit/plebbit-react-hooks';
import useGeneralStore from '../../hooks/stores/useGeneralStore';
import { Link, useNavigate } from 'react-router-dom';
import { Container, Header, Logo, Page, Search, About, AboutTitle, AboutContent, Boards, BoardsTitle, BoardsContent, Footer } from '../styled/views/Home.styled';
import BoardAvatar from '../BoardAvatar';
import OfflineIndicator from '../OfflineIndicator';
import packageJson from '../../../package.json'
import { Tooltip } from 'react-tooltip';
const {version} = packageJson
// show commit ref on netlify to know which commit is being served for debugging
const commitRef = process?.env?.REACT_APP_COMMIT_REF ? ` ${process.env.REACT_APP_COMMIT_REF.slice(0, 7)}` : ''
const Home = () => {
const {
bodyStyle, setBodyStyle,
defaultSubplebbits,
setSelectedAddress,
selectedStyle, setSelectedStyle,
setSelectedTitle
} = useGeneralStore(state => state);
const account = useAccount();
const navigate = useNavigate();
const inputRef = useRef(null);
const prevStyle = useRef(selectedStyle);
const prevBodyStyle = useRef(bodyStyle);
// prevent dark mode
useEffect(() => {
const currentPrevStyle = prevStyle.current;
const currentPrevBodyStyle = prevBodyStyle.current;
setBodyStyle({
background: "#ffe url(assets/fade.png) top repeat-x",
color: "maroon",
fontFamily: "Helvetica, Arial, sans-serif"
});
setSelectedStyle("Yotsuba");
return () => {
setSelectedStyle(currentPrevStyle);
setBodyStyle(currentPrevBodyStyle);
};
}, [setBodyStyle, setSelectedStyle]);
return (
<>
plebchan
{
if (event.key === "Enter") {
event.preventDefault();
const address = inputRef.current.value;
if (address) {
setSelectedAddress(address);
navigate(`/p/${address}`)
}
}
}} />
{
const address = inputRef.current.value;
if (address) {
setSelectedAddress(address);
navigate(`/p/${address}`)
}
}
} />
What is plebchan?
Plebchan is a serverless, adminless, decentralized 4chan alternative that uses the plebbit protocol. Users do not need to register an account before participating in the community; anyone can post comments, share media links, and . All the content is just text, and plebchan's speed depends on how many users are seeding. Search for any board address above, or feel free to click on a popular board below that interests you and jump right in!
There are no global rules, each board is completely independent and its owner decides how it should be moderated.
{account?.subscriptions?.length > 0 ? (
Subscriptions
You have subscribed to {account?.subscriptions?.length} board{account?.subscriptions?.length > 1 ? "s" : null}