mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(home): stabilize initial popular threads box
Keep usePopularPosts() keyed to the requested board list, wait to reveal the box until the first result set is stable, and limit the grid to one thread per board. Freeze the first revealed threads until refresh or filter changes so later board loads cannot displace visible cards.
This commit is contained in:
@@ -211,7 +211,7 @@ const Home = () => {
|
||||
<SearchBar />
|
||||
<InfoBox />
|
||||
<BoardsList multisub={directories} />
|
||||
<PopularThreadsBox directories={directories} subplebbits={subplebbits} />
|
||||
<PopularThreadsBox directories={directories} directoryAddresses={directoryAddresses} subplebbits={subplebbits} />
|
||||
<Stats directoryAddresses={directoryAddresses} />
|
||||
<Footer />
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@ interface PopularThreadProps {
|
||||
boardPath: string;
|
||||
}
|
||||
|
||||
export const ContentPreview = ({ content, maxLength = 99 }: { content: string; maxLength?: number }) => {
|
||||
const ContentPreview = ({ content, maxLength = 99 }: { content: string; maxLength?: number }) => {
|
||||
const plainText = removeMarkdown(content).trim().replaceAll(' ', '').replace(/\n\n/g, '\n').replaceAll('\n\n', '');
|
||||
const truncatedText = plainText.length > maxLength ? `${plainText.substring(0, maxLength).trim()}...` : plainText;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user