-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add RTL example * add quickfix makes the carousel functional, but just via overriding the direction * internal rtl support relying on a global attribute selector feels a bit hacky * fix import * simplify style * include dot group in rtl example for demonstration purposes * lint
- Loading branch information
Showing
6 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React from 'react'; | ||
import | ||
{ | ||
ButtonBack, | ||
ButtonFirst, | ||
ButtonLast, | ||
ButtonNext, | ||
CarouselProvider, | ||
Slide, | ||
Slider, | ||
ImageWithZoom, | ||
DotGroup, | ||
} from '../../..'; | ||
|
||
import s from '../../style.scss'; | ||
|
||
export default () => ( | ||
<CarouselProvider | ||
visibleSlides={2} | ||
totalSlides={8} | ||
step={1} | ||
naturalSlideWidth={400} | ||
naturalSlideHeight={500} | ||
> | ||
<h2 className={s.headline}>RTL</h2> | ||
<p> | ||
A carousel wrapped in an element with | ||
{' '} | ||
<code>dir="rtl"</code> | ||
, demonstrating support for use with right-to-left languages. | ||
</p> | ||
<div dir="rtl"> | ||
<Slider className={s.slider}> | ||
<Slide index={0}> | ||
<ImageWithZoom src="./media/img01.jpeg" /> | ||
</Slide> | ||
<Slide index={1}> | ||
<ImageWithZoom src="./media/img02.jpeg" /> | ||
</Slide> | ||
<Slide index={2}> | ||
<ImageWithZoom src="./media/img03.jpeg" /> | ||
</Slide> | ||
<Slide index={3}> | ||
<ImageWithZoom src="./media/img04.jpeg" /> | ||
</Slide> | ||
<Slide index={4}> | ||
<ImageWithZoom src="./media/img05.jpeg" /> | ||
</Slide> | ||
<Slide index={5}> | ||
<ImageWithZoom src="./media/img06.jpeg" /> | ||
</Slide> | ||
<Slide index={6}> | ||
<ImageWithZoom src="./media/img07.jpeg" /> | ||
</Slide> | ||
<Slide index={7}> | ||
<ImageWithZoom src="./media/img08.jpeg" /> | ||
</Slide> | ||
</Slider> | ||
<ButtonFirst>First</ButtonFirst> | ||
<ButtonBack>Back</ButtonBack> | ||
<ButtonNext>Next</ButtonNext> | ||
<ButtonLast>Last</ButtonLast> | ||
<DotGroup dotNumbers /> | ||
</div> | ||
</CarouselProvider> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Example14 from './Example14'; | ||
|
||
export default Example14; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,11 @@ | |
|
||
&Horizontal { | ||
float: left; | ||
|
||
[dir='rtl'] & { | ||
direction: rtl; | ||
transform: scaleX(-1); | ||
} | ||
} | ||
|
||
&Inner { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters