From 26d38e180de8ad96b1d576898944e97a02f01abc Mon Sep 17 00:00:00 2001 From: sajjad Date: Mon, 26 Aug 2019 16:11:37 +0430 Subject: [PATCH] fix: rtl support change direction of sideMenu icons. center sideMenu icon in phone size. --- src/components/SearchBox/styled.elements.tsx | 1 + src/components/SideMenu/styled.elements.ts | 1 + src/components/StickySidebar/ChevronSvg.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/src/components/SearchBox/styled.elements.tsx b/src/components/SearchBox/styled.elements.tsx index 647e71c8..9d5deb58 100644 --- a/src/components/SearchBox/styled.elements.tsx +++ b/src/components/SearchBox/styled.elements.tsx @@ -24,6 +24,7 @@ export const SearchInput = styled.input.attrs(() => ({ color: ${props => props.theme.menu.textColor}; background-color: transparent; outline: none; + text-align: ${({ theme }) => (theme.typography.direction === 'rtl') ? 'center' : 'inherit'}; `; export const SearchIcon = styled((props: { className?: string }) => ( diff --git a/src/components/SideMenu/styled.elements.ts b/src/components/SideMenu/styled.elements.ts index 68d543ed..1a247419 100644 --- a/src/components/SideMenu/styled.elements.ts +++ b/src/components/SideMenu/styled.elements.ts @@ -144,6 +144,7 @@ export const MenuItemLabel = styled.label.attrs((props: MenuItemLabelType) => ({ } ${ShelfIcon} { + transform: ${({ theme }) => (theme.typography.direction === 'rtl') ? 'rotate(0deg)' : 'none'}; height: ${({ theme }) => theme.menu.arrow.size}; width: ${({ theme }) => theme.menu.arrow.size}; polygon { diff --git a/src/components/StickySidebar/ChevronSvg.tsx b/src/components/StickySidebar/ChevronSvg.tsx index 5343ddb1..51a114e0 100644 --- a/src/components/StickySidebar/ChevronSvg.tsx +++ b/src/components/StickySidebar/ChevronSvg.tsx @@ -62,5 +62,6 @@ const ChevronContainer = styled.div` align-self: center; display: flex; flex-direction: column; + direction: ltr; color: ${props => props.theme.colors.primary.main}; `;