show all stories function for series
This commit is contained in:
@@ -27,6 +27,7 @@ export default function StoryDetailPage() {
|
|||||||
const [isSendingToAudioCove, setIsSendingToAudioCove] = useState(false);
|
const [isSendingToAudioCove, setIsSendingToAudioCove] = useState(false);
|
||||||
const [audioCovedSuccess, setAudioCovedSuccess] = useState(false);
|
const [audioCovedSuccess, setAudioCovedSuccess] = useState(false);
|
||||||
const [isCreatingCollection, setIsCreatingCollection] = useState(false);
|
const [isCreatingCollection, setIsCreatingCollection] = useState(false);
|
||||||
|
const [showAllSeriesStories, setShowAllSeriesStories] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadStoryData = async () => {
|
const loadStoryData = async () => {
|
||||||
@@ -315,7 +316,7 @@ export default function StoryDetailPage() {
|
|||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
{seriesStories
|
{seriesStories
|
||||||
.filter(s => s.id !== story.id)
|
.filter(s => s.id !== story.id)
|
||||||
.slice(0, 5)
|
.slice(0, showAllSeriesStories ? undefined : 5)
|
||||||
.map((seriesStory) => (
|
.map((seriesStory) => (
|
||||||
<Link
|
<Link
|
||||||
key={seriesStory.id}
|
key={seriesStory.id}
|
||||||
@@ -326,10 +327,13 @@ export default function StoryDetailPage() {
|
|||||||
{seriesStory.title}
|
{seriesStory.title}
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
{seriesStories.length > 6 && (
|
{!showAllSeriesStories && seriesStories.length > 6 && (
|
||||||
<p className="text-sm theme-text">
|
<button
|
||||||
|
onClick={() => setShowAllSeriesStories(true)}
|
||||||
|
className="text-sm theme-accent hover:underline text-left"
|
||||||
|
>
|
||||||
+{seriesStories.length - 6} more stories
|
+{seriesStories.length - 6} more stories
|
||||||
</p>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user