Skip to content

Commit

Permalink
fix: bytes thumbnail (#597)
Browse files Browse the repository at this point in the history
* fix: bytes thumbnail

* chore: cleanup
  • Loading branch information
sasicodes authored Feb 9, 2023
1 parent 338a9b2 commit df14cad
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
5 changes: 2 additions & 3 deletions apps/web/src/components/Channel/BasicInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ const BasicInfo: FC<Props> = ({ channel }) => {

const isOwnChannel = channel?.id === selectedChannel?.id
const subscribeType = channel?.followModule?.__typename
const coverImage = imageCdn(sanitizeIpfsUrl(getChannelCoverPicture(channel)))

return (
<>
<div
style={{
backgroundImage: `url(${imageCdn(
sanitizeIpfsUrl(getChannelCoverPicture(channel))
)})`
backgroundImage: `url(${coverImage})`
}}
className="ultrawide:h-[35vh] relative h-44 w-full bg-white bg-cover bg-center bg-no-repeat dark:bg-gray-900 md:h-[20vw]"
>
Expand Down
32 changes: 21 additions & 11 deletions apps/web/src/components/Common/VideoCard/QueuedVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { STATIC_ASSETS } from 'utils'
import getProfilePicture from 'utils/functions/getProfilePicture'
import imageCdn from 'utils/functions/imageCdn'
import sanitizeIpfsUrl from 'utils/functions/sanitizeIpfsUrl'
import useAverageColor from 'utils/hooks/useAverageColor'

import IsVerified from '../IsVerified'

Expand All @@ -41,6 +42,10 @@ const QueuedVideo: FC<Props> = ({ queuedVideo }) => {
: sanitizeIpfsUrl(queuedVideo.thumbnailUrl),
uploadedVideo.isByteVideo ? 'thumbnail_v' : 'thumbnail'
)
const { color: backgroundColor } = useAverageColor(
thumbnailUrl,
uploadedVideo.isByteVideo
)

const removeFromQueue = () => {
setUploadedVideo(UPLOADED_VIDEO_FORM_DEFAULTS)
Expand Down Expand Up @@ -114,17 +119,22 @@ const QueuedVideo: FC<Props> = ({ queuedVideo }) => {

return (
<div className="cursor-wait">
<div className="aspect-w-16 aspect-h-9 relative overflow-hidden">
<img
src={thumbnailUrl}
draggable={false}
className={clsx(
'h-full w-full bg-gray-100 object-center dark:bg-gray-900 md:rounded-xl lg:h-full lg:w-full',
uploadedVideo.isByteVideo ? 'object-contain' : 'object-cover'
)}
alt="thumbnail"
/>
</div>
<Tooltip content="Indexing, please wait..." placement="top">
<div className="aspect-w-16 aspect-h-9 relative overflow-hidden">
<img
src={thumbnailUrl}
className={clsx(
'h-full w-full bg-gray-100 object-center dark:bg-gray-900 md:rounded-xl lg:h-full lg:w-full',
uploadedVideo.isByteVideo ? 'object-contain' : 'object-cover'
)}
style={{
backgroundColor: backgroundColor && `${backgroundColor}95`
}}
alt="thumbnail"
draggable={false}
/>
</div>
</Tooltip>
<div className="py-2">
<div className="flex items-start space-x-2.5">
<img
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Upload/ChooseThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const ChooseThumbnail: FC<Props> = ({ label, afterUpload, file }) => {
selectedThumbnailIndex === idx && (
<div className="absolute top-1 right-1">
<span>
<Loader size="sm" className="!text-white" />
<Loader size="sm" />
</span>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/functions/uploadToIPFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const everland = async (
secretAccessKey: token.data?.secretAccessKey,
sessionToken: token.data?.sessionToken
},
maxAttempts: 3
maxAttempts: 5
})
const fileKey = uuidv4()
const params = {
Expand Down

4 comments on commit df14cad

@vercel
Copy link

@vercel vercel bot commented on df14cad Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

web-git-main-lenstube.vercel.app
web-lenstube.vercel.app
lenstube.xyz

@vercel
Copy link

@vercel vercel bot commented on df14cad Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

embed – ./apps/embed

embed.lenstube.xyz
embed-lenstube.vercel.app
embed-git-main-lenstube.vercel.app

@vercel
Copy link

@vercel vercel bot commented on df14cad Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

api – ./apps/api

api-git-main-lenstube.vercel.app
api.lenstube.xyz
api-lenstube.vercel.app

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on df14cad Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
lenstube ✅ Deployed View Logs 2023-02-09T19:34:16.092Z

Please sign in to comment.