Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 Added the download button back to mobile #887

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,79 +74,77 @@ const SpeakerYoutubePublishButton = ({
};

return (
<div>
<Dialog open={open} onOpenChange={setOpen}>
<Button className="bg-[#FF0000]" onClick={() => setOpen(true)}>
<SiYoutube className="mr-2" /> Publish to Youtube
</Button>
<DialogContent>
<DialogTitle className="font-bold">
Publish Video to Youtube{' '}
</DialogTitle>
{refreshToken ? (
<div className="flex items-center pr-3">
<Image
src={thumbnail}
className="p-1 mr-2 rounded-full"
width={50}
height={50}
alt=""
/>
<Link
className="text-sm underline"
href={`/api/google/request?state=${state}`}
>
Click to Reconnect
</Link>
</div>
) : (
<div>
<p className="mb-2">Connect Youtube Account before continuing </p>
<div className="flex gap-4 items-center">
<Button
onClick={handleModalClose}
className="w-full"
variant={'outline'}
>
Cancel
</Button>
<Link
className="w-full"
href={`/api/google/request?state=${state}`}
>
<Button className="w-full" variant={'primary'}>
Connect
</Button>
</Link>
</div>
</div>
)}

{refreshToken && (
<div className="flex gap-4 items-center w-full">
<Dialog open={open} onOpenChange={setOpen}>
<Button className="bg-[#FF0000]" onClick={() => setOpen(true)}>
<SiYoutube className="mr-2" /> Publish to Youtube
</Button>
<DialogContent>
<DialogTitle className="font-bold">
Publish Video to Youtube{' '}
</DialogTitle>
{refreshToken ? (
<div className="flex items-center pr-3">
<Image
src={thumbnail}
className="p-1 mr-2 rounded-full"
width={50}
height={50}
alt=""
/>
<Link
className="text-sm underline"
href={`/api/google/request?state=${state}`}
>
Click to Reconnect
</Link>
</div>
) : (
<div>
<p className="mb-2">Connect Youtube Account before continuing </p>
<div className="flex gap-4 items-center">
<Button
onClick={handleModalClose}
className="w-full"
variant={'outline'}
>
Cancel
</Button>
<Button
variant="primary"
className="overflow-hidden w-full"
onClick={() => {
track('Upload to YouTube', { location: 'Speaker Page' });
handleYoutubePublish();
}}
loading={isLoading}
<Link
className="w-full"
href={`/api/google/request?state=${state}`}
>
Publish
</Button>
<Button className="w-full" variant={'primary'}>
Connect
</Button>
</Link>
</div>
)}
</DialogContent>
</Dialog>
</div>
</div>
)}

{refreshToken && (
<div className="flex gap-4 items-center w-full">
<Button
onClick={handleModalClose}
className="w-full"
variant={'outline'}
>
Cancel
</Button>
<Button
variant="primary"
className="overflow-hidden w-full"
onClick={() => {
track('Upload to YouTube', { location: 'Speaker Page' });
handleYoutubePublish();
}}
loading={isLoading}
>
Publish
</Button>
</div>
)}
</DialogContent>
</Dialog>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const ZoraUploadButton = ({
}, [publicClient, address, session, writeContract, switchChain]);

if (!isConnected) {
return <ConnectWalletButton />;
return <ConnectWalletButton btnText="Upload to Zora" />;
}

const isDisabled = isUploading || state?.length > 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/app/app/speaker/[session]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const SessionPage = async ({
video={session!}
/>

<div className="flex space-x-2">
<div className="flex flex-col space-y-2 sm:flex-row sm:space-y-0 sm:space-x-2">
<SpeakerYoutubePublishButton
openModal={searchParams.m}
sessionId={params.session}
Expand Down
60 changes: 25 additions & 35 deletions packages/app/components/sessions/SessionInfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,43 +76,33 @@ const MobileButtons = ({
nftCollection: IExtendedNftCollections | null;
vod: boolean;
}) => {
const hasCalendarReminder = !vod;

return (
<>
{video?.nftCollections?.[0] ? (
<>
<div className="w-full">
<CollectVideButton video={video} nftCollection={nftCollection} />
</div>
<Popover>
<PopoverTrigger asChild>
<EllipsisVertical size={30} className="cursor-pointer" />
</PopoverTrigger>
<PopoverContent className="flex w-full flex-col space-y-2">
{/* Hydration Error */}
<ShareButton className="w-full" shareFor="video" />{' '}
{video?.assetId && (
<VideoDownloadClient
videoName={`${video.name}.mp4`}
assetId={video?.assetId}
/>
)}
{!vod && (
<>
<CalendarReminder
eventName={name}
description={description}
start={date}
end={date}
/>
</>
)}
</PopoverContent>
</Popover>
</>
) : (
<ShareButton variant={'primary'} shareFor="video" />
<div className="flex w-full flex-wrap items-center gap-2">
{video?.nftCollections?.[0] && (
<CollectVideButton video={video} nftCollection={nftCollection} />
)}
</>
<ShareButton
variant={video?.nftCollections?.[0] ? 'outline' : 'primary'}
shareFor="video"
/>
{video?.assetId && (
<VideoDownloadClient
variant="outline"
videoName={`${video.name}.mp4`}
assetId={video?.assetId}
/>
)}
{hasCalendarReminder && (
<CalendarReminder
eventName={name}
description={description}
start={date}
end={date}
/>
)}
</div>
);
};

Expand Down
Loading