Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
cc970931
Unverified
Commit
cc970931
authored
May 08, 2024
by
Igor Stuev
Committed by
GitHub
May 08, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1895 from blockscout/fe-1872
remove video autoplay from lists
parents
3d600593
4cc4e43b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
4 deletions
+9
-4
NFTItem.tsx
ui/address/tokens/NFTItem.tsx
+1
-0
NftMedia.tsx
ui/shared/nft/NftMedia.tsx
+3
-2
NftVideo.tsx
ui/shared/nft/NftVideo.tsx
+3
-1
NftVideoFullscreen.tsx
ui/shared/nft/NftVideoFullscreen.tsx
+1
-0
utils.ts
ui/shared/nft/utils.ts
+0
-1
TokenInventoryItem.tsx
ui/token/TokenInventoryItem.tsx
+1
-0
No files found.
ui/address/tokens/NFTItem.tsx
View file @
cc970931
...
@@ -31,6 +31,7 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P
...
@@ -31,6 +31,7 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P
animationUrl=
{
tokenInstance
?.
animation_url
??
null
}
animationUrl=
{
tokenInstance
?.
animation_url
??
null
}
imageUrl=
{
tokenInstance
?.
image_url
??
null
}
imageUrl=
{
tokenInstance
?.
image_url
??
null
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
autoplayVideo=
{
false
}
/>
/>
</
Link
>
</
Link
>
<
Flex
justifyContent=
"space-between"
w=
"100%"
flexWrap=
"wrap"
>
<
Flex
justifyContent=
"space-between"
w=
"100%"
flexWrap=
"wrap"
>
...
...
ui/shared/nft/NftMedia.tsx
View file @
cc970931
...
@@ -18,9 +18,10 @@ interface Props {
...
@@ -18,9 +18,10 @@ interface Props {
className
?:
string
;
className
?:
string
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
withFullscreen
?:
boolean
;
withFullscreen
?:
boolean
;
autoplayVideo
?:
boolean
;
}
}
const
NftMedia
=
({
imageUrl
,
animationUrl
,
className
,
isLoading
,
withFullscreen
}:
Props
)
=>
{
const
NftMedia
=
({
imageUrl
,
animationUrl
,
className
,
isLoading
,
withFullscreen
,
autoplayVideo
}:
Props
)
=>
{
const
[
isMediaLoading
,
setIsMediaLoading
]
=
React
.
useState
(
true
);
const
[
isMediaLoading
,
setIsMediaLoading
]
=
React
.
useState
(
true
);
const
[
isLoadingError
,
setIsLoadingError
]
=
React
.
useState
(
false
);
const
[
isLoadingError
,
setIsLoadingError
]
=
React
.
useState
(
false
);
...
@@ -71,7 +72,7 @@ const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen
...
@@ -71,7 +72,7 @@ const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen
switch
(
type
)
{
switch
(
type
)
{
case
'
video
'
:
case
'
video
'
:
return
<
NftVideo
{
...
props
}
/>;
return
<
NftVideo
{
...
props
}
autoPlay=
{
autoplayVideo
}
/>;
case
'
html
'
:
case
'
html
'
:
return
<
NftHtml
{
...
props
}
/>;
return
<
NftHtml
{
...
props
}
/>;
case
'
image
'
:
case
'
image
'
:
...
...
ui/shared/nft/NftVideo.tsx
View file @
cc970931
...
@@ -5,15 +5,17 @@ import { mediaStyleProps, videoPlayProps } from './utils';
...
@@ -5,15 +5,17 @@ import { mediaStyleProps, videoPlayProps } from './utils';
interface
Props
{
interface
Props
{
src
:
string
;
src
:
string
;
autoPlay
?:
boolean
;
onLoad
:
()
=>
void
;
onLoad
:
()
=>
void
;
onError
:
()
=>
void
;
onError
:
()
=>
void
;
onClick
?:
()
=>
void
;
onClick
?:
()
=>
void
;
}
}
const
NftVideo
=
({
src
,
onLoad
,
onError
,
onClick
}:
Props
)
=>
{
const
NftVideo
=
({
src
,
autoPlay
=
true
,
onLoad
,
onError
,
onClick
}:
Props
)
=>
{
return
(
return
(
<
chakra
.
video
<
chakra
.
video
{
...
videoPlayProps
}
{
...
videoPlayProps
}
autoPlay=
{
autoPlay
}
src=
{
src
}
src=
{
src
}
onCanPlayThrough=
{
onLoad
}
onCanPlayThrough=
{
onLoad
}
onError=
{
onError
}
onError=
{
onError
}
...
...
ui/shared/nft/NftVideoFullscreen.tsx
View file @
cc970931
...
@@ -18,6 +18,7 @@ const NftVideoFullscreen = ({ src, isOpen, onClose }: Props) => {
...
@@ -18,6 +18,7 @@ const NftVideoFullscreen = ({ src, isOpen, onClose }: Props) => {
src=
{
src
}
src=
{
src
}
maxH=
"90vh"
maxH=
"90vh"
maxW=
"90vw"
maxW=
"90vw"
autoPlay=
{
true
}
/>
/>
</
NftMediaFullscreenModal
>
</
NftMediaFullscreenModal
>
);
);
...
...
ui/shared/nft/utils.ts
View file @
cc970931
...
@@ -41,7 +41,6 @@ export const mediaStyleProps = {
...
@@ -41,7 +41,6 @@ export const mediaStyleProps = {
};
};
export
const
videoPlayProps
=
{
export
const
videoPlayProps
=
{
autoPlay
:
true
,
disablePictureInPicture
:
true
,
disablePictureInPicture
:
true
,
loop
:
true
,
loop
:
true
,
muted
:
true
,
muted
:
true
,
...
...
ui/token/TokenInventoryItem.tsx
View file @
cc970931
...
@@ -23,6 +23,7 @@ const TokenInventoryItem = ({ item, token, isLoading }: Props) => {
...
@@ -23,6 +23,7 @@ const TokenInventoryItem = ({ item, token, isLoading }: Props) => {
animationUrl=
{
item
.
animation_url
}
animationUrl=
{
item
.
animation_url
}
imageUrl=
{
item
.
image_url
}
imageUrl=
{
item
.
image_url
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
autoplayVideo=
{
false
}
/>
/>
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment