Skip to content

Commit

Permalink
Merge pull request #1916 from TokkoLabs/development
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
aguescribano87 authored Jul 11, 2024
2 parents 440359b + ebc4e29 commit afc39c6
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,4 @@



window['STORIES'] = [];</script><script src="runtime~main.9390b27b.iframe.bundle.js"></script><script src="vendors~main.2eb898cf.iframe.bundle.js"></script><script src="main.3d7b12c0.iframe.bundle.js"></script></body></html>
window['STORIES'] = [];</script><script src="runtime~main.9390b27b.iframe.bundle.js"></script><script src="vendors~main.2eb898cf.iframe.bundle.js"></script><script src="main.6baa0b0c.iframe.bundle.js"></script></body></html>
3 changes: 0 additions & 3 deletions docs/main.3d7b12c0.iframe.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.3d7b12c0.iframe.bundle.js.map

This file was deleted.

3 changes: 3 additions & 0 deletions docs/main.6baa0b0c.iframe.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/main.6baa0b0c.iframe.bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/carousel/src/components/SliderSwap.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ export const SliderSwap = ({
setTranslateX(newTranslateX)
handleTraslate(newTranslateX)
}
const debouncedNextSlide = debounce(nextSlide, 250)
const debouncedPrevSlide = debounce(prevSlide, 250)
const debouncedNextSlide = debounce(nextSlide, 170)
const debouncedPrevSlide = debounce(prevSlide, 170)

const resetPosition = () => {
setCurrentTranslate(0)
Expand Down Expand Up @@ -278,12 +278,14 @@ export const SliderSwap = ({
cursor: 'pointer',
}}
onClick={(e) => e.stopPropagation()}
onDragStart={(e) => e.preventDefault()}
>
{imgErrors[img] ? (
<ImageErrorFallback fullscreen />
) : (
<img
className="imgFullScreenSlide"
style={{ pointerEvents: 'none' }}
src={img}
alt={fileType}
onError={() => handleImgError(img)}
Expand Down
20 changes: 8 additions & 12 deletions packages/carousel/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const Carousel = ({
const [followingImgWidth, setFollowingImgWidth] = useState(0)
const mainImageSkeletonRef = useRef()
const mainImageWidthSkeleton = mainImageSkeletonRef.current?.clientWidth

const allPictures = [...imgWithCover, ...bluePrintsWithCover]
if (video.length > 0) {
tabContainers.push('Videos')
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export const Carousel = ({
) {
return
}
if ([...imgWithCover, ...bluePrintsWithCover].length === 0) {
if (allPictures.length === 0) {
setTabSelected(
video.length > 0 ? 'videos' : video360.length > 0 ? 'video360' : ''
)
Expand Down Expand Up @@ -172,7 +172,6 @@ export const Carousel = ({
}
setTabSelected(fileFiltered.type)
}

return (
<Box
__css={{
Expand Down Expand Up @@ -222,7 +221,7 @@ export const Carousel = ({
{containerWidth < 786 ? (
<Box __css={{ width: '100%', height: '100%' }}>
<SliderSwap
files={[...imgWithCover, ...bluePrintsWithCover]}
files={allPictures}
setFullscreen={setFullscreen}
otherButton={otherButton}
handleImageClickToFullscreen={handleImageClickToFullscreen}
Expand Down Expand Up @@ -332,12 +331,13 @@ export const Carousel = ({
/>
) : (
index + 1 === followImgColumns * 2 &&
images.length > followImgColumns * 2 &&
images.length -
allPictures.length > followImgColumns * 2 &&
allPictures.length -
1 -
followImgColumns * 2 +
planos.length >
0 && (
0 &&
allPictures.length - 1 - followImgColumns * 2 > 0 && (
<Box
__css={{
borderRadius: '50%',
Expand All @@ -354,11 +354,7 @@ export const Carousel = ({
fontWeight: '700',
}}
>{`+${
images.length -
1 -
followImgColumns * 2 +
planos.length +
(frontCoverBlueprints ? 1 : 0)
allPictures.length - 1 - followImgColumns * 2
}`}</Box>
)
)}
Expand Down
8 changes: 8 additions & 0 deletions packages/carousel/styles/gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@
width: 100%;
height: 100%;
object-fit: contain;
outline: none;
user-select: none;
}
.imgFullScreenSlide:active {
outline: none;
}
.imgFullScreenSlide:focus {
outline: none;
}
.videoFullScreenSlide {
width: 100%;
Expand Down

0 comments on commit afc39c6

Please sign in to comment.