File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/components/main/card/PostCard/RecentPostCard Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,20 @@ const RecentPostCard = ({ post }: IProps) => {
2222 day : "numeric" ,
2323 timeZone : "UTC" ,
2424 } ) ;
25+
26+ let isVercelBlobHost = false ;
27+ if ( post . thumbnailUrl ) {
28+ try {
29+ const url = new URL ( post . thumbnailUrl ) ;
30+ const hostname = url . hostname ;
31+ isVercelBlobHost =
32+ hostname === "blob.vercel-storage.com" ||
33+ hostname . endsWith ( ".blob.vercel-storage.com" ) ;
34+ } catch {
35+ isVercelBlobHost = false ;
36+ }
37+ }
38+
2539 return (
2640 < Link
2741 className = { `button-card-shadow ${ styles . card_resent } ` }
@@ -36,7 +50,7 @@ const RecentPostCard = ({ post }: IProps) => {
3650 width = { 320 }
3751 height = { 180 }
3852 className = { styles . thumbnail }
39- unoptimized = { post . thumbnailUrl . includes ( "blob.vercel-storage.com" ) }
53+ unoptimized = { isVercelBlobHost }
4054 />
4155 </ div >
4256 ) }
You can’t perform that action at this time.
0 commit comments