mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add initial subscriptions box UI
This commit is contained in:
@@ -171,6 +171,11 @@ export const Boards = styled.div`
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
padding-bottom: .5em;
|
padding-bottom: .5em;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
word-wrap: break-word;
|
||||||
|
|
||||||
|
#subscriptions {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const BoardsTitle = styled.div`
|
export const BoardsTitle = styled.div`
|
||||||
@@ -237,6 +242,22 @@ export const BoardsContent = styled.div`
|
|||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 100%;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boardlink {
|
||||||
|
color: #800;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
color: #e00
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const Footer = styled.div`
|
export const Footer = styled.div`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { Helmet } from 'react-helmet-async';
|
import { Helmet } from 'react-helmet-async';
|
||||||
import { useSubplebbit } from '@plebbit/plebbit-react-hooks';
|
import { useAccount, useSubplebbit } from '@plebbit/plebbit-react-hooks';
|
||||||
import useGeneralStore from '../../hooks/stores/useGeneralStore';
|
import useGeneralStore from '../../hooks/stores/useGeneralStore';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
import { Container, Header, Logo, Page, Search, About, AboutTitle, AboutContent, Boards, BoardsTitle, BoardsContent, Footer } from '../styled/Home.styled';
|
import { Container, Header, Logo, Page, Search, About, AboutTitle, AboutContent, Boards, BoardsTitle, BoardsContent, Footer } from '../styled/Home.styled';
|
||||||
@@ -31,6 +31,7 @@ const Home = () => {
|
|||||||
setSelectedTitle
|
setSelectedTitle
|
||||||
} = useGeneralStore(state => state);
|
} = useGeneralStore(state => state);
|
||||||
|
|
||||||
|
const account = useAccount();
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
@@ -98,9 +99,30 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
</AboutContent>
|
</AboutContent>
|
||||||
</About>
|
</About>
|
||||||
|
{account.subscriptions?.length > 0 ? (
|
||||||
|
<Boards style={{marginBottom: '6px'}}>
|
||||||
|
<BoardsTitle>
|
||||||
|
<h2>Board Subscriptions</h2>
|
||||||
|
</BoardsTitle>
|
||||||
|
<BoardsContent id="subscriptions">
|
||||||
|
<h3 style={{textDecoration: 'underline', display: 'inline'}}>
|
||||||
|
You have subscribed to {account.subscriptions.length} board{account.subscriptions.length > 1 ? "s" : null}
|
||||||
|
</h3>
|
||||||
|
<br />
|
||||||
|
{account.subscriptions.map((subscription, index) => (
|
||||||
|
<>
|
||||||
|
<Link key={`sub-${index}`} class="boardlink" to={`/p/${subscription.subplebbitAddress}`}>
|
||||||
|
{subscription}
|
||||||
|
</Link>
|
||||||
|
<br />
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</BoardsContent>
|
||||||
|
</Boards>
|
||||||
|
) : null}
|
||||||
<Boards>
|
<Boards>
|
||||||
<BoardsTitle>
|
<BoardsTitle>
|
||||||
<h2>Popular boards</h2>
|
<h2>Popular Boards</h2>
|
||||||
</BoardsTitle>
|
</BoardsTitle>
|
||||||
<BoardsContent>
|
<BoardsContent>
|
||||||
{defaultSubplebbits.map(subplebbit => (
|
{defaultSubplebbits.map(subplebbit => (
|
||||||
|
|||||||
Reference in New Issue
Block a user