├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── assets │ ├── css │ │ └── style.css │ ├── fonts │ │ ├── Vazir-Bold-FD.eot │ │ ├── Vazir-Bold-FD.ttf │ │ ├── Vazir-Bold-FD.woff │ │ └── Vazir-Bold-FD.woff2 │ └── img │ │ ├── favicon.ico │ │ ├── logo192.png │ │ └── logo512.png ├── index.html ├── manifest.json └── robots.txt ├── src ├── App.js ├── Aside.js ├── Layout.js ├── Main.js ├── assets │ ├── bg1.jpg │ └── logo.svg ├── index.js └── styles │ └── App.scss └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Preview 2 | [Demo](https://hamzehazizzadeh.ir/react-sidebar/) 3 | 4 | ## React Pro Sidebar 5 | This package is a Persian and straightforward example of the [react-pro-sidebar](https://github.com/azouaoui-med/react-pro-sidebar) package. 6 | 7 | ## Available Scripts 8 | 9 | In the project directory, you can run: 10 | 11 | ### `npm start` 12 | 13 | Runs the app in the development mode.
14 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 15 | 16 | The page will reload if you make edits.
17 | You will also see any lint errors in the console. 18 | 19 | ### `npm run build` 20 | 21 | Builds the app for production to the `build` folder.
22 | It correctly bundles React in production mode and optimizes the build for the best performance. 23 | 24 | The build is minified and the filenames include the hashes.
25 | Your app is ready to be deployed! 26 | 27 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 28 | 29 | ### `npm run eject` 30 | 31 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 32 | 33 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 34 | 35 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 36 | 37 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 38 | 39 | ## Learn More 40 | 41 | In this project, wherever the word Structure is used, you can change the name of your project 42 | 43 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 44 | 45 | To learn React, check out the [React documentation](https://reactjs.org/). 46 | 47 | ### Code Splitting 48 | 49 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 50 | 51 | ### Analyzing the Bundle Size 52 | 53 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 54 | 55 | ### Making a Progressive Web App 56 | 57 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 58 | 59 | ### Advanced Configuration 60 | 61 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 62 | 63 | ### Deployment 64 | 65 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 66 | 67 | ### `npm run build` fails to minify 68 | 69 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 70 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "homepage": "./", 5 | "private": true, 6 | "dependencies": { 7 | "@testing-library/jest-dom": "^4.2.4", 8 | "@testing-library/react": "^9.3.2", 9 | "@testing-library/user-event": "^7.1.2", 10 | "react": "^16.13.1", 11 | "react-dom": "^16.13.1", 12 | "react-icons": "^3.10.0", 13 | "react-pro-sidebar": "^0.4.4", 14 | "react-scripts": "3.4.1", 15 | "react-switch": "^5.0.1" 16 | }, 17 | "scripts": { 18 | "start": "react-scripts start", 19 | "build": "react-scripts build", 20 | "test": "react-scripts test", 21 | "eject": "react-scripts eject" 22 | }, 23 | "eslintConfig": { 24 | "extends": "react-app" 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | }, 38 | "devDependencies": { 39 | "node-sass": "^4.14.1" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /public/assets/css/style.css: -------------------------------------------------------------------------------- 1 | /*? Default Style */ 2 | 3 | /*? Font Vazir */ 4 | @font-face { 5 | font-family: "VazirB"; 6 | src: url("../fonts/Vazir-Bold-FD.eot"); /*? IE9 Compat Modes */ 7 | src: url("../fonts/Vazir-Bold-FD.eot") format("embedded-opentype"), 8 | /*? IE6-IE8 */ url("../fonts/Vazir-Bold-FD.woff2") format("woff2"), 9 | /*? Super Modern Browsers */ url("../fonts/Vazir-Bold-FD.woff") 10 | format("woff"), 11 | /*? Pretty Modern Browsers */ url("../fonts/Vazir-Bold-FD.woff") 12 | format("truetype"); /*? Safari, Android, iOS */ 13 | /*url('webfont.svg#svgFontName') format('svg'); !* Legacy iOS *!*/ 14 | } 15 | 16 | body { 17 | font-family: "VazirB" !important; 18 | } 19 | -------------------------------------------------------------------------------- /public/assets/fonts/Vazir-Bold-FD.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/public/assets/fonts/Vazir-Bold-FD.eot -------------------------------------------------------------------------------- /public/assets/fonts/Vazir-Bold-FD.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/public/assets/fonts/Vazir-Bold-FD.ttf -------------------------------------------------------------------------------- /public/assets/fonts/Vazir-Bold-FD.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/public/assets/fonts/Vazir-Bold-FD.woff -------------------------------------------------------------------------------- /public/assets/fonts/Vazir-Bold-FD.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/public/assets/fonts/Vazir-Bold-FD.woff2 -------------------------------------------------------------------------------- /public/assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/public/assets/img/favicon.ico -------------------------------------------------------------------------------- /public/assets/img/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/public/assets/img/logo192.png -------------------------------------------------------------------------------- /public/assets/img/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/public/assets/img/logo512.png -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | React Side Bar 19 | 20 | 21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Layout from "./Layout"; 3 | import "./styles/App.scss"; 4 | 5 | function App() { 6 | return ; 7 | } 8 | 9 | export default App; 10 | -------------------------------------------------------------------------------- /src/Aside.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | ProSidebar, 4 | Menu, 5 | MenuItem, 6 | SubMenu, 7 | SidebarHeader, 8 | SidebarFooter, 9 | SidebarContent, 10 | } from "react-pro-sidebar"; 11 | import { 12 | FaTachometerAlt, 13 | FaGem, 14 | FaList, 15 | FaGithub, 16 | FaRegLaughWink, 17 | FaHeart, 18 | } from "react-icons/fa"; 19 | import sidebarBg from "./assets/bg1.jpg"; 20 | 21 | const Aside = ({ image, collapsed, toggled, handleToggleSidebar }) => { 22 | return ( 23 | 31 | 32 |
43 | خوش آمدید 44 |
45 |
46 | 47 | 48 | 49 | } 51 | suffix={جديد} 52 | > 53 | داشبورد 54 | 55 | }> اجزاء 56 | 57 | 58 | 3} 60 | title="با پسوند" 61 | icon={} 62 | > 63 | زیر منو 1 64 | زیر منو 2 65 | زیر منو 3 66 | 67 | 3} 69 | title="با پیشوند" 70 | icon={} 71 | > 72 | زیر منو 1 73 | زیر منو 2 74 | زیر منو 3 75 | 76 | }> 77 | زیر منو 1 78 | زیر منو 2 79 | 80 | زیر منو 3.1 81 | زیر منو 3.2 82 | 83 | زیر منو 3.3.1 84 | زیر منو 3.3.2 85 | زیر منو 3.3.3 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 |
99 | 105 | 106 | مشاهده منبع 107 | 108 |
109 |
110 |
111 | ); 112 | }; 113 | 114 | export default Aside; 115 | -------------------------------------------------------------------------------- /src/Layout.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import Aside from "./Aside"; 3 | import Main from "./Main"; 4 | 5 | const Layout = () => { 6 | const [collapsed, setCollapsed] = useState(false); 7 | const [image, setImage] = useState(true); 8 | const [toggled, setToggled] = useState(false); 9 | 10 | const handleCollapsedChange = (checked) => { 11 | setCollapsed(checked); 12 | }; 13 | 14 | const handleImageChange = (checked) => { 15 | setImage(checked); 16 | }; 17 | 18 | const handleToggleSidebar = (value) => { 19 | setToggled(value); 20 | }; 21 | 22 | return ( 23 |
24 |
39 | ); 40 | }; 41 | 42 | export default Layout; 43 | -------------------------------------------------------------------------------- /src/Main.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Switch from "react-switch"; 3 | import { FaHeart, FaBars } from "react-icons/fa"; 4 | import reactLogo from "./assets/logo.svg"; 5 | 6 | const Main = ({ 7 | collapsed, 8 | image, 9 | handleToggleSidebar, 10 | handleCollapsedChange, 11 | handleImageChange, 12 | }) => { 13 | return ( 14 |
15 |
handleToggleSidebar(true)}> 16 | 17 |
18 |
19 |

20 | react logo React Sidebar 21 |

22 |

23 | کتابخانه نوار کناری را با منوهای کشویی و تعداد نامحدود زیر منوهای تو 24 | در تو واکنش نشان دهید 25 |

26 |
27 | 32 | GitHub stars 36 | 37 | 42 | GitHub forks 46 | 47 |
48 |
49 |
50 | 60 | بستن 61 |
62 |
63 | 73 | تصویر پس زمینه 74 |
75 | 76 | 102 |
103 | ); 104 | }; 105 | 106 | export default Main; 107 | -------------------------------------------------------------------------------- /src/assets/bg1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamzehazizzadeh/react-sidebar/5b09cae32453ed3001520fe30b3009bff476d6a1/src/assets/bg1.jpg -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render( 6 | 7 | 8 | , 9 | document.getElementById('root'), 10 | ); 11 | -------------------------------------------------------------------------------- /src/styles/App.scss: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Roboto&display=swap'); 2 | 3 | $sidebar-bg-color: #1d1d1d; 4 | $submenu-bg-color: rgba(255, 255, 255, 0.05); 5 | $submenu-bg-color-collapsed: rgba(29, 29, 29, 0.95); 6 | $sidebar-color: #adadad; 7 | $highlight-color: #d8d8d8; 8 | $icon-bg-color: rgba(255, 255, 255, 0.05); 9 | $icon-size: 35px; 10 | 11 | @import '~react-pro-sidebar/dist/scss/styles.scss'; 12 | body { 13 | margin: 0; 14 | height: 100vh; 15 | color: #353535; 16 | font-family: 'VazirB'; 17 | } 18 | 19 | #root { 20 | height: 100%; 21 | } 22 | 23 | .app { 24 | height: 100%; 25 | display: flex; 26 | position: relative; 27 | 28 | .btn-toggle { 29 | cursor: pointer; 30 | width: 35px; 31 | height: 35px; 32 | background: #353535; 33 | color: #fff; 34 | text-align: center; 35 | border-radius: 50%; 36 | display: flex; 37 | align-items: center; 38 | justify-content: center; 39 | font-size: 15px; 40 | display: none; 41 | } 42 | 43 | .sidebar-btn-wrapper { 44 | display: flex; 45 | align-items: center; 46 | justify-content: center; 47 | .sidebar-btn { 48 | padding: 1px 15px; 49 | border-radius: 40px; 50 | background: rgba(255, 255, 255, 0.05); 51 | color: #adadad; 52 | text-decoration: none; 53 | margin: 0 auto; 54 | height: 35px; 55 | display: flex; 56 | align-items: center; 57 | justify-content: center; 58 | text-overflow: ellipsis; 59 | overflow: hidden; 60 | span { 61 | margin-left: 5px; 62 | font-size: 13px; 63 | } 64 | &:hover { 65 | color: $highlight-color; 66 | } 67 | } 68 | } 69 | 70 | .collapsed { 71 | .sidebar-btn { 72 | display: inline-block; 73 | border-radius: 50%; 74 | width: 35px; 75 | height: 35px; 76 | line-height: 40px; 77 | padding: 0; 78 | } 79 | } 80 | 81 | main { 82 | padding: 24px; 83 | flex-grow: 1; 84 | display: flex; 85 | flex-direction: column; 86 | overflow-y: auto; 87 | header { 88 | margin-bottom: 40px; 89 | border-bottom: 1px solid #efefef; 90 | h1 { 91 | display: flex; 92 | align-items: center; 93 | transform: translateX(-20px); 94 | } 95 | } 96 | 97 | footer { 98 | margin-top: auto; 99 | color: #888; 100 | text-align: center; 101 | a { 102 | text-decoration: none; 103 | color: #888; 104 | &:hover { 105 | text-decoration: underline; 106 | } 107 | } 108 | } 109 | } 110 | .social-bagdes { 111 | margin-top: 10px; 112 | img { 113 | margin: 5px; 114 | } 115 | } 116 | 117 | .block { 118 | display: flex; 119 | margin-bottom: 24px; 120 | font-size: 14px; 121 | color: #545454; 122 | > span { 123 | margin-left: 10px; 124 | } 125 | } 126 | 127 | &.rtl { 128 | direction: rtl; 129 | text-align: right; 130 | 131 | header { 132 | h1 { 133 | transform: translateX(20px); 134 | } 135 | } 136 | .block { 137 | direction: rtl; 138 | > span { 139 | margin-left: 0; 140 | margin-right: 10px; 141 | } 142 | } 143 | .sidebar-btn-wrapper { 144 | .sidebar-btn { 145 | span { 146 | margin-left: 0; 147 | margin-right: 5px; 148 | } 149 | } 150 | } 151 | } 152 | 153 | @media (max-width: 767.98px) { 154 | overflow-x: hidden; 155 | header { 156 | h1 { 157 | font-size: 24px; 158 | } 159 | } 160 | } 161 | @media (max-width: $breakpoint-md) { 162 | .btn-toggle { 163 | display: flex; 164 | } 165 | 166 | &.rtl { 167 | .btn-toggle { 168 | margin-left: auto; 169 | } 170 | } 171 | } 172 | } 173 | 174 | .badge { 175 | padding: 3px 6px; 176 | font-size: 9px; 177 | border-radius: 15px; 178 | &.red { 179 | color: #ffffff; 180 | background: #d63030; 181 | } 182 | &.gray { 183 | color: #ffffff; 184 | background: #777777; 185 | } 186 | &.yellow { 187 | color: #000000; 188 | background: #ffd331; 189 | } 190 | } 191 | --------------------------------------------------------------------------------