react-spreadsheet-import icon indicating copy to clipboard operation
react-spreadsheet-import copied to clipboard

Support for RTL

Open eelior opened this issue 2 years ago • 3 comments

Hey guys, the built it support for translating the UI is perfect! How can I also change the UI direction to RTL? (Right-to-Left, for langueges such as Hebrew and Arabic) image

eelior avatar Aug 06 '22 07:08 eelior

I had unsuccessful quick try to add RTL support. I tried both ways mentioned in the Chakra-UI docs: https://chakra-ui.com/docs/styled-system/rtl-support#using-rtl-stylis-plugin

The farthest I have come was with the first method in the docs and it only helped me changing the direction of the two first buttons from the demo: image

But it didnt work for the component itself that stayed the same.

Check it out here: https://github.com/eelior/react-spreadsheet-import/tree/master-rtl-support

eelior avatar Aug 06 '22 14:08 eelior

Hey @eelior, I did a quick check, you can add this to theme

  customTheme={{
      Modal: {
      baseStyle: {
        dialog: {
          direction: "rtl",
        },
      },
    },
}}

With the table we are using (https://github.com/adazzle/react-data-grid) it's a bit more complicated - we need to pass a prop direction="rtl", so we would have to expose this in our props.

The end result would look like this: Screenshot 2022-08-07 at 14 02 04

Is this something close to what you are trying to achieve?

masiulis avatar Aug 07 '22 11:08 masiulis

@masiulis This looks perfect!! I over complicated this, I'm happy to see its so easy with the customTheme prop. Ill try to make you a PR for the table later this evening.

eelior avatar Aug 07 '22 13:08 eelior

rtl prop is available. Closing this as there should solve the discussed problem.

masiulis avatar May 24 '23 16:05 masiulis