Skip to content

Commit

Permalink
feat: rtl for modal
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp committed Feb 5, 2024
1 parent 6f45f8c commit f269b2f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/modal/src/modal/close-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const CloseButton = ({ onClick }) => (
border-radius: 3px;
position: absolute;
top: 0px;
right: 0px;
inset-inline-end: 0px;
}
button:hover {
background-color: ${colors.grey200};
Expand Down
17 changes: 16 additions & 1 deletion components/modal/src/modal/modal.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { SingleSelect, SingleSelectOption } from '@dhis2-ui/select'
import { Tooltip } from '@dhis2-ui/tooltip'
import { sharedPropTypes } from '@dhis2/ui-constants'
import React, { useState } from 'react'
import React, { useEffect, useState } from 'react'
import { ModalActions, ModalContent, ModalTitle } from '../index.js'
import { Modal } from './modal.js'

Expand Down Expand Up @@ -991,3 +991,18 @@ FluidBottom.args = {
position: 'bottom',
}
FluidBottom.storyName = 'Fluid (Bottom)'

export const RTL = (args) => {
useEffect(() => {
document.body.dir = 'rtl'
return () => {
document.body.dir = 'ltr'
}
}, [])
return (
<div dir="rtl">
<SmallTitleContentAction {...args} />
</div>
)
}
RTL.args = { small: true, onClose }

0 comments on commit f269b2f

Please sign in to comment.