mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Wire up follower empty state. Closes #1913
This commit is contained in:
parent
fa30dea523
commit
18d92dbe9d
@ -59,9 +59,19 @@ const ChatContainer = dynamic(() =>
|
|||||||
import('../../chat/ChatContainer/ChatContainer').then(mod => mod.ChatContainer),
|
import('../../chat/ChatContainer/ChatContainer').then(mod => mod.ChatContainer),
|
||||||
);
|
);
|
||||||
|
|
||||||
const DesktopContent = ({ name, streamTitle, summary, tags, socialHandles, extraPageContent }) => {
|
const DesktopContent = ({
|
||||||
|
name,
|
||||||
|
streamTitle,
|
||||||
|
summary,
|
||||||
|
tags,
|
||||||
|
socialHandles,
|
||||||
|
extraPageContent,
|
||||||
|
setShowFollowModal,
|
||||||
|
}) => {
|
||||||
const aboutTabContent = <CustomPageContent content={extraPageContent} />;
|
const aboutTabContent = <CustomPageContent content={extraPageContent} />;
|
||||||
const followersTabContent = <FollowerCollection name={name} />;
|
const followersTabContent = (
|
||||||
|
<FollowerCollection name={name} onFollowButtonClick={() => setShowFollowModal(true)} />
|
||||||
|
);
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{ label: 'About', key: '2', children: aboutTabContent },
|
{ label: 'About', key: '2', children: aboutTabContent },
|
||||||
@ -154,7 +164,9 @@ const MobileContent = ({
|
|||||||
<CustomPageContent content={extraPageContent} />
|
<CustomPageContent content={extraPageContent} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
const followersTabContent = <FollowerCollection name={name} />;
|
const followersTabContent = (
|
||||||
|
<FollowerCollection name={name} onFollowButtonClick={() => setShowFollowModal(true)} />
|
||||||
|
);
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
showChat && { label: 'Chat', key: '0', children: chatContent },
|
showChat && { label: 'Chat', key: '0', children: chatContent },
|
||||||
@ -367,6 +379,7 @@ export const Content: FC = () => {
|
|||||||
tags={tags}
|
tags={tags}
|
||||||
socialHandles={socialHandles}
|
socialHandles={socialHandles}
|
||||||
extraPageContent={extraPageContent}
|
extraPageContent={extraPageContent}
|
||||||
|
setShowFollowModal={setShowFollowModal}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,7 +11,13 @@ export default {
|
|||||||
|
|
||||||
const Template: ComponentStory<typeof FollowerCollection> = (args: object) => (
|
const Template: ComponentStory<typeof FollowerCollection> = (args: object) => (
|
||||||
<RecoilRoot>
|
<RecoilRoot>
|
||||||
<FollowerCollection name="Example stream name" {...args} />
|
<FollowerCollection
|
||||||
|
onFollowButtonClick={function (): void {
|
||||||
|
throw new Error('Function not implemented.');
|
||||||
|
}}
|
||||||
|
name="Example stream name"
|
||||||
|
{...args}
|
||||||
|
/>
|
||||||
</RecoilRoot>
|
</RecoilRoot>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -7,9 +7,10 @@ import { FollowButton } from '../../../action-buttons/FollowButton';
|
|||||||
|
|
||||||
export type FollowerCollectionProps = {
|
export type FollowerCollectionProps = {
|
||||||
name: string;
|
name: string;
|
||||||
|
onFollowButtonClick: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FollowerCollection: FC<FollowerCollectionProps> = ({ name }) => {
|
export const FollowerCollection: FC<FollowerCollectionProps> = ({ name, onFollowButtonClick }) => {
|
||||||
const ENDPOINT = '/api/followers';
|
const ENDPOINT = '/api/followers';
|
||||||
const ITEMS_PER_PAGE = 24;
|
const ITEMS_PER_PAGE = 24;
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ export const FollowerCollection: FC<FollowerCollectionProps> = ({ name }) => {
|
|||||||
from the stream, share it with others, and and show your appreciation when it goes live, all
|
from the stream, share it with others, and and show your appreciation when it goes live, all
|
||||||
from your own Fediverse account.
|
from your own Fediverse account.
|
||||||
</p>
|
</p>
|
||||||
<FollowButton />
|
<FollowButton onClick={onFollowButtonClick} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user