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
7ed1aa9f
Commit
7ed1aa9f
authored
Jan 31, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix fullscreen
parent
fe81cfe6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
106 deletions
+16
-106
NftHtmlFullscreen.tsx
ui/shared/nft/NftHtmlFullscreen.tsx
+2
-2
NftHtmlWithFullscreen.tsx
ui/shared/nft/NftHtmlWithFullscreen.tsx
+0
-33
NftImageFullscreen.tsx
ui/shared/nft/NftImageFullscreen.tsx
+12
-3
NftImageWithFullscreen.tsx
ui/shared/nft/NftImageWithFullscreen.tsx
+0
-29
NftVideoFullscreen.tsx
ui/shared/nft/NftVideoFullscreen.tsx
+2
-2
NftVideoWithFullscreen.tsx
ui/shared/nft/NftVideoWithFullscreen.tsx
+0
-37
No files found.
ui/shared/nft/NftHtmlFullscreen.tsx
View file @
7ed1aa9f
...
...
@@ -9,7 +9,7 @@ interface Props {
onClose
:
()
=>
void
;
}
const
NftHtml
With
Fullscreen
=
({
src
,
isOpen
,
onClose
}:
Props
)
=>
{
const
NftHtmlFullscreen
=
({
src
,
isOpen
,
onClose
}:
Props
)
=>
{
return
(
<
NftMediaFullscreenModal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
>
<
chakra
.
iframe
...
...
@@ -22,4 +22,4 @@ const NftHtmlWithFullscreen = ({ src, isOpen, onClose }: Props) => {
);
};
export
default
NftHtml
With
Fullscreen
;
export
default
NftHtmlFullscreen
;
ui/shared/nft/NftHtmlWithFullscreen.tsx
deleted
100644 → 0
View file @
fe81cfe6
import
{
chakra
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
NftHtml
from
'
./NftHtml
'
;
import
NftMediaFullscreenModal
from
'
./NftMediaFullscreenModal
'
;
interface
Props
{
src
:
string
;
onLoad
:
()
=>
void
;
onError
:
()
=>
void
;
}
const
NftHtmlWithFullscreen
=
({
src
,
onLoad
,
onError
}:
Props
)
=>
{
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
return
(
<>
<
NftHtml
src=
{
src
}
onLoad=
{
onLoad
}
onError=
{
onError
}
onClick=
{
onOpen
}
/>
<
NftMediaFullscreenModal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
>
<
chakra
.
iframe
w=
"90vw"
h=
"90vh"
src=
{
src
}
sandbox=
"allow-scripts"
onLoad=
{
onLoad
}
onError=
{
onError
}
/>
</
NftMediaFullscreenModal
>
</>
);
};
export
default
NftHtmlWithFullscreen
;
ui/shared/nft/NftImageFullscreen.tsx
View file @
7ed1aa9f
...
...
@@ -11,12 +11,21 @@ interface Props {
onClose
:
()
=>
void
;
}
const
NftImageWithFullscreen
=
({
src
,
isOpen
,
onClose
}:
Props
)
=>
{
const
NftImageFullscreen
=
({
src
,
isOpen
,
onClose
}:
Props
)
=>
{
const
imgRef
=
React
.
useRef
<
HTMLImageElement
>
(
null
);
const
checkWidth
=
React
.
useCallback
(()
=>
{
if
(
imgRef
.
current
?.
getBoundingClientRect
().
width
===
0
)
{
imgRef
.
current
.
style
.
width
=
'
90vw
'
;
imgRef
.
current
.
style
.
height
=
'
90vh
'
;
}
},
[
]);
return
(
<
NftMediaFullscreenModal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
>
<
Image
src=
{
src
}
alt=
"Token instance image"
maxH=
"90vh"
maxW=
"90vw"
/>
<
Image
src=
{
src
}
alt=
"Token instance image"
maxH=
"90vh"
maxW=
"90vw"
ref=
{
imgRef
}
onLoad=
{
checkWidth
}
/>
</
NftMediaFullscreenModal
>
);
};
export
default
NftImage
With
Fullscreen
;
export
default
NftImageFullscreen
;
ui/shared/nft/NftImageWithFullscreen.tsx
deleted
100644 → 0
View file @
fe81cfe6
import
{
Image
,
useDisclosure
,
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
NftImage
from
'
./NftImage
'
;
import
NftMediaFullscreenModal
from
'
./NftMediaFullscreenModal
'
;
interface
Props
{
src
:
string
;
onLoad
:
()
=>
void
;
onError
:
()
=>
void
;
}
const
NftImageWithFullscreen
=
({
src
,
onLoad
,
onError
}:
Props
)
=>
{
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
return
(
<>
<
NftImage
src=
{
src
}
onLoad=
{
onLoad
}
onError=
{
onError
}
onClick=
{
onOpen
}
/>
<
NftMediaFullscreenModal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
>
<
Image
src=
{
src
}
alt=
"Token instance image"
maxH=
"90vh"
maxW=
"90vw"
/>
</
NftMediaFullscreenModal
>
</>
);
};
export
default
NftImageWithFullscreen
;
ui/shared/nft/NftVideoFullscreen.tsx
View file @
7ed1aa9f
...
...
@@ -10,7 +10,7 @@ interface Props {
onClose
:
()
=>
void
;
}
const
NftVideo
With
Fullscreen
=
({
src
,
isOpen
,
onClose
}:
Props
)
=>
{
const
NftVideoFullscreen
=
({
src
,
isOpen
,
onClose
}:
Props
)
=>
{
return
(
<
NftMediaFullscreenModal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
>
<
chakra
.
video
...
...
@@ -23,4 +23,4 @@ const NftVideoWithFullscreen = ({ src, isOpen, onClose }: Props) => {
);
};
export
default
NftVideo
With
Fullscreen
;
export
default
NftVideoFullscreen
;
ui/shared/nft/NftVideoWithFullscreen.tsx
deleted
100644 → 0
View file @
fe81cfe6
import
{
chakra
,
useDisclosure
,
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
NftMediaFullscreenModal
from
'
./NftMediaFullscreenModal
'
;
import
NftVideo
from
'
./NftVideo
'
;
import
{
videoPlayProps
}
from
'
./utils
'
;
interface
Props
{
src
:
string
;
onLoad
:
()
=>
void
;
onError
:
()
=>
void
;
}
const
NftVideoWithFullscreen
=
({
src
,
onLoad
,
onError
}:
Props
)
=>
{
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
return
(
<>
<
NftVideo
src=
{
src
}
onLoad=
{
onLoad
}
onError=
{
onError
}
onClick=
{
onOpen
}
/>
<
NftMediaFullscreenModal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
>
<
chakra
.
video
{
...
videoPlayProps
}
src=
{
src
}
onCanPlayThrough=
{
onLoad
}
onError=
{
onError
}
maxH=
"90vh"
maxW=
"90vw"
/>
</
NftMediaFullscreenModal
>
</>
);
};
export
default
NftVideoWithFullscreen
;
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