Skip to content

Commit 098aded

Browse files
committed
20221229
1 parent c19223e commit 098aded

File tree

3 files changed

+62
-123
lines changed

3 files changed

+62
-123
lines changed

public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
-->
2222

2323
<!DOCTYPE html>
24-
<html lang="en">
24+
<html lang="fa-IR" dir="rtl">
2525
<head>
2626
<meta charset="utf-8" />
2727
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
@@ -32,7 +32,7 @@
3232
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
3333
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
3434
</head>
35-
<body>
35+
<body direction="rtl">
3636
<noscript>You need to enable JavaScript to run this app.</noscript>
3737
<div id="root"></div>
3838
</body>

src/components/sidebar/components/SidebarCard.js

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13,72 +13,5 @@ export default function SidebarDocs() {
1313
const bgColor = "linear-gradient(135deg, #868CFF 0%, #4318FF 100%)";
1414
const borderColor = useColorModeValue("white", "navy.800");
1515

16-
return (
17-
<Flex
18-
justify='center'
19-
direction='column'
20-
align='center'
21-
bg={bgColor}
22-
borderRadius='30px'
23-
me='20px'
24-
position='relative'>
25-
<Flex
26-
border='5px solid'
27-
borderColor={borderColor}
28-
bg='linear-gradient(135deg, #868CFF 0%, #4318FF 100%)'
29-
borderRadius='50%'
30-
w='94px'
31-
h='94px'
32-
align='center'
33-
justify='center'
34-
mx='auto'
35-
position='absolute'
36-
left='50%'
37-
top='-47px'
38-
transform='translate(-50%, 0%)'>
39-
<Image src={logoWhite} w='40px' h='40px' />
40-
</Flex>
41-
<Flex
42-
direction='column'
43-
mb='12px'
44-
align='center'
45-
justify='center'
46-
px='15px'
47-
pt='55px'>
48-
<Text
49-
fontSize={{ base: "lg", xl: "18px" }}
50-
color='white'
51-
fontWeight='bold'
52-
lineHeight='150%'
53-
textAlign='center'
54-
px='10px'
55-
mb='14px'>
56-
Upgrade to PRO
57-
</Text>
58-
<Text
59-
fontSize='14px'
60-
color={"white"}
61-
px='10px'
62-
mb='14px'
63-
textAlign='center'>
64-
Improve your development process and start doing more with Horizon UI
65-
PRO!
66-
</Text>
67-
</Flex>
68-
<Link href='https://horizon-ui.com/pro'>
69-
<Button
70-
bg='whiteAlpha.300'
71-
_hover={{ bg: "whiteAlpha.200" }}
72-
_active={{ bg: "whiteAlpha.100" }}
73-
mb={{ sm: "16px", xl: "24px" }}
74-
color={"white"}
75-
fontWeight='regular'
76-
fontSize='sm'
77-
minW='185px'
78-
mx='auto'>
79-
Upgrade to PRO
80-
</Button>
81-
</Link>
82-
</Flex>
83-
);
16+
return <></>;
8417
}

src/layouts/admin/index.js

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import { Portal, Box, useDisclosure } from "@chakra-ui/react";
33
import Footer from "components/footer/FooterAdmin.js";
44
// Layout components
5-
import Navbar from "components/navbar/NavbarAdmin.js";
5+
import Navbar from "components/navbar/NavbarRTL.js";
66
import Sidebar from "components/sidebar/Sidebar.js";
77
import { SidebarContext } from "contexts/SidebarContext";
8+
import { RtlProvider } from "components/rtlProvider/RtlProvider.js";
89
import React, { useState } from "react";
910
import { Redirect, Route, Switch } from "react-router-dom";
1011
import routes from "routes.js";
@@ -17,7 +18,7 @@ export default function Dashboard(props) {
1718
const [toggleSidebar, setToggleSidebar] = useState(false);
1819
// functions for changing the states from components
1920
const getRoute = () => {
20-
return window.location.pathname !== "/admin/full-screen-maps";
21+
return window.location.pathname !== "/rtl/full-screen-maps";
2122
};
2223
const getActiveRoute = (routes) => {
2324
let activeRoute = "Default Brand Text";
@@ -109,61 +110,66 @@ export default function Dashboard(props) {
109110
}
110111
});
111112
};
112-
document.documentElement.dir = "ltr";
113+
document.documentElement.dir = "rtl";
113114
const { onOpen } = useDisclosure();
114115
return (
115-
<Box>
116-
<SidebarContext.Provider
117-
value={{
118-
toggleSidebar,
119-
setToggleSidebar,
120-
}}>
121-
<Sidebar routes={routes} display='none' {...rest} />
122-
<Box
123-
float='right'
124-
minHeight='100vh'
125-
height='100%'
126-
overflow='auto'
127-
position='relative'
128-
maxHeight='100%'
129-
w={{ base: "100%", xl: "calc( 100% - 290px )" }}
130-
maxWidth={{ base: "100%", xl: "calc( 100% - 290px )" }}
131-
transition='all 0.33s cubic-bezier(0.685, 0.0473, 0.346, 1)'
132-
transitionDuration='.2s, .2s, .35s'
133-
transitionProperty='top, bottom, width'
134-
transitionTimingFunction='linear, linear, ease'>
135-
<Portal>
136-
<Box>
137-
<Navbar
138-
onOpen={onOpen}
139-
logoText={"Horizon UI Dashboard PRO"}
140-
brandText={getActiveRoute(routes)}
141-
secondary={getActiveNavbar(routes)}
142-
message={getActiveNavbarText(routes)}
143-
fixed={fixed}
144-
{...rest}
145-
/>
146-
</Box>
147-
</Portal>
116+
<RtlProvider>
117+
<Box>
118+
<SidebarContext.Provider
119+
value={{
120+
toggleSidebar,
121+
setToggleSidebar,
122+
}}
123+
>
124+
<Sidebar routes={routes} display="none" {...rest} />
125+
<Box
126+
float="left"
127+
minHeight="100vh"
128+
height="100%"
129+
overflow="auto"
130+
position="relative"
131+
maxHeight="100%"
132+
w={{ base: "100%", xl: "calc( 100% - 290px )" }}
133+
maxWidth={{ base: "100%", xl: "calc( 100% - 290px )" }}
134+
transition="all 0.33s cubic-bezier(0.685, 0.0473, 0.346, 1)"
135+
transitionDuration=".2s, .2s, .35s"
136+
transitionProperty="top, bottom, width"
137+
transitionTimingFunction="linear, linear, ease"
138+
>
139+
<Portal>
140+
<Box>
141+
<Navbar
142+
onOpen={onOpen}
143+
logoText={"Horizon UI Dashboard PRO"}
144+
brandText={getActiveRoute(routes)}
145+
secondary={getActiveNavbar(routes)}
146+
message={getActiveNavbarText(routes)}
147+
fixed={fixed}
148+
{...rest}
149+
/>
150+
</Box>
151+
</Portal>
148152

149-
{getRoute() ? (
150-
<Box
151-
mx='auto'
152-
p={{ base: "20px", md: "30px" }}
153-
pe='20px'
154-
minH='100vh'
155-
pt='50px'>
156-
<Switch>
157-
{getRoutes(routes)}
158-
<Redirect from='/' to='/admin/default' />
159-
</Switch>
153+
{getRoute() ? (
154+
<Box
155+
mx="auto"
156+
p={{ base: "20px", md: "30px" }}
157+
pe="20px"
158+
minH="100vh"
159+
pt="50px"
160+
>
161+
<Switch>
162+
{getRoutes(routes)}
163+
<Redirect from="/" to="/rtl/rtl-default" />
164+
</Switch>
165+
</Box>
166+
) : null}
167+
<Box>
168+
<Footer />
160169
</Box>
161-
) : null}
162-
<Box>
163-
<Footer />
164170
</Box>
165-
</Box>
166-
</SidebarContext.Provider>
167-
</Box>
171+
</SidebarContext.Provider>
172+
</Box>
173+
</RtlProvider>
168174
);
169175
}

0 commit comments

Comments
 (0)