Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rtl support for embla carousel (Slider component) #11995

Merged
merged 4 commits into from
Jan 24, 2024

Conversation

wackerow
Copy link
Member

Builds on #11905 -- DO NOT MERGE before that PR

Description

  • Updates useRtlFlip hook to also return isRtl and direction for convenience in niche cases where these may be needed to further adjust a component for RTL details.
  • Pass direction ("rtl" | "ltr") to useEmblaCarousel (see embla docs)
Screen.Recording.2024-01-20.at.10.49.29.mov

Related Issue

@github-actions github-actions bot added review needed 👀 tooling 🔧 Changes related to tooling of the project labels Jan 20, 2024
@wackerow wackerow changed the base branch from nx-ltr-en-content to dev January 21, 2024 00:27
Copy link

netlify bot commented Jan 21, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 7dd710c
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/65b04314136922000802cbe5
😎 Deploy Preview https://deploy-preview-11995--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the content 🖋️ This involves copy additions or edits label Jan 21, 2024
@pettinarip
Copy link
Member

@wackerow we've merged #11905 but I still see the commits from that PR here 🤔 we might need to update this PR?

@wackerow
Copy link
Member Author

@pettinarip Okay, I'll take a look, thanks!

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wackerow I could test it anyway. Nice job, well done.

export interface IProps {
children?: React.ReactNode
onSlideChange?: (slideIndex: number) => void
}

const Slider: React.FC<IProps> = ({ children, onSlideChange }) => {
const [emblaRef, embla] = useEmblaCarousel()
const { flipForRtl, direction } = useRtlFlip()
const [emblaRef, embla] = useEmblaCarousel({ direction })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@corwintines corwintines merged commit be0333a into dev Jan 24, 2024
9 of 10 checks passed
@corwintines corwintines deleted the rtl-embla-carousel branch January 24, 2024 04:45
This was referenced Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants