Skip to content

Commit

Permalink
feat(DIST-1904): Max width for slider (#553)
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Scarciofolo <scarmarco@gmail.com>
  • Loading branch information
scarciofolomarco and Marco Scarciofolo authored Jan 11, 2023
1 parent d416fd6 commit 10f9b53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/embed/src/css/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@include backdrop;

.tf-v1-iframe-wrapper {
max-width: calc(100vw - 26px);
height: 100%;
position: absolute;
top: 0;
Expand Down Expand Up @@ -60,6 +61,7 @@

.tf-v1-iframe-wrapper {
width: 100% !important;
max-width: 100vw;
height: 100%;
transition: unset;

Expand Down
6 changes: 4 additions & 2 deletions packages/embed/src/factories/create-slider/create-slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import { SliderOptions } from './slider-options'

export type Slider = EmbedPopup

const buildSlider = (position: 'right' | 'left') => {
type Position = 'right' | 'left'

const buildSlider = (position: Position) => {
const slider = document.createElement('div')
slider.className = `tf-v1-slider ${position}`
slider.dataset.testid = 'tf-v1-slider'
Expand All @@ -32,7 +34,7 @@ const buildSpinner = () => {
return spinner
}

const buildWrapper = (position: 'right' | 'left', width: number) => {
const buildWrapper = (position: Position, width: number) => {
const wrapper = document.createElement('div')
wrapper.className = 'tf-v1-iframe-wrapper'
wrapper.style[position] = '-100%'
Expand Down

0 comments on commit 10f9b53

Please sign in to comment.