one thing people may miss, if you have parent route, like you have many sub routes under home page do not forget to set it with a start ✔ instead of ❌
@keithgoddard41922 жыл бұрын
I'm just starting to explore Ant Design, although I've got years of experience with React... and this was super helpful! Thank you so much for taking the time to put this together, I really appreciate it.
@CodeWithAamir2 жыл бұрын
You're very welcome!
@unanimedestino982 жыл бұрын
Your are the best, please don't stop to make ANT DESIGN VIDEOS
@CodeWithAamir2 жыл бұрын
This means a lot to me, thank you @Rodrigo García Real for the encouragement!
@zhuofeng10892 жыл бұрын
You must be the indian superman ! ! ! Thank you ! ! !
@CodeWithAamir2 жыл бұрын
Thanks Zhuo, by the way I am from Pakistan neighbourhood of India.
@vishalkumaryadav29245 ай бұрын
Thank you so much sir for this video it was really very helpful
@CodeWithAamir5 ай бұрын
Most welcome
@anmolarora5630 Жыл бұрын
Thank you brother, you are such a saviour
@CodeWithAamir Жыл бұрын
You are most welcome, thanks
@uboxtech Жыл бұрын
thanks for these wonderful tutorials brother
@CodeWithAamir Жыл бұрын
Glad you like them! Thank you!
@Pein94rap7 ай бұрын
Helpful. Thanks!
@CodeWithAamir6 ай бұрын
You're welcome!
@umakuwar8093 Жыл бұрын
I facing some issue like useNavigate()may be used only in the context of a component
@CodeWithAamir Жыл бұрын
Hi You can get rid of this error by wrapping your main App component inside the BrowserRouter. It will look something like below import { BrowserRouter } from "react-router-dom"; Please let me know if you still face any issues. Thanks
@itsahmedbasha Жыл бұрын
Thanks for the tutorial, it really helped me to creata a fixed sidebar for my POC, Thanks once again 🙂 Keep creating videos like this, Good Luck!
@CodeWithAamir Жыл бұрын
Glad it helped! Surely I will create more videos like this. Really appreciate for the encouraging feedback 😊 Thank you Ahmed
@computeraidedyami Жыл бұрын
Person Of Color?
@CodeWithAamir Жыл бұрын
Hi @computeraidedyami Did not get your questions, can you please elaborate a little more? Thanks
@itsahmedbasha Жыл бұрын
@@computeraidedyami POC, Proof of Concept
@rents11112 жыл бұрын
You helped me a lot. Thanks.
@CodeWithAamir2 жыл бұрын
Glad I could help!
@mutebiugofficial88272 жыл бұрын
How did you do with with react Router v6 to change components basing on menu items selected
@CodeWithAamir2 жыл бұрын
Hi @mutebi ug official, If I understood your question correctly, you mean how to do this in v6. Actually the tutorial uses v6 already to change components based on selected menu item. If you need more details on react router dom v6, please go through following video if not watched already. kzbin.info/www/bejne/h53WZWpjbd-CnZI Please let me know if I misunderstood your question or you need any more help on that. Thanks
@azizbekkomilov35892 жыл бұрын
Thanks Super Video! Best the best!!!!
@CodeWithAamir2 жыл бұрын
Glad you liked it!
@albertodelvillar29962 жыл бұрын
Aamir thank you !! great video
@CodeWithAamir2 жыл бұрын
Glad you liked it!
@regoresconde33022 жыл бұрын
Hi Aamir! Great vid as always! Was wondering how would you add a collapsible feature? or a responsive one? :D
@CodeWithAamir2 жыл бұрын
Thanks @Regor, I have a video on responsive ant design menu at below link which show full menu on larger resolution and converts to collapsed menu icon and show drawer menu on smaller screens, please let me know if that helps. kzbin.info/www/bejne/Z5OtkH-heK-Jhpo Thank you
@mostafafartaj72707 ай бұрын
Thanks for the tutorial, How I can create login with custom layout and route
@arhamfarman63642 жыл бұрын
Thanks Alot, good man!
@uboxtech Жыл бұрын
btw i have a question, how to handle the default selected key if we have nested route like /account/settings OR /account/dashboard like that
@CodeWithAamir Жыл бұрын
Hi @UBOX TECH In the case of nested routes the window -> location -> pathname will contain the whole path like /account/settings so you can split it based on / and put only the relevant path string inside the default selected keys array. I hope you got the idea , please let me know if you need any more information on that . Thanks.
@ameralkhodary80762 жыл бұрын
thank u so much
@CodeWithAamir2 жыл бұрын
Hi @Amer Alkhodary To move sidebar to right side just swap the Content and SideMenu like below It will move the side menu to right side of content but if you want the rest of the space to be fully occupied by content and sideMenu to be at very right side of screen then you can give a flex:1 to parent div of content component like below function Content() { return ( //Other children components like routes etc. will be same as in video ); } Hope it helps. Please let me know if you need any more help on that. Thanks
@anantjain96795 ай бұрын
thanks, i am facing a problem to add icon on submenu on collapsable menu
@BachelorsEntertainer Жыл бұрын
Nice Work
@CodeWithAamir Жыл бұрын
Thank you! Cheers!
@manjunath-sde9 ай бұрын
is there any way to make the sidebar alone unscrollable whilst the content being scrollable if there's any?
@singmantkpss7 ай бұрын
Same ask
@anilanaparthi698511 ай бұрын
How I can render login component without that layout header and sider
@mutebiugofficial88272 жыл бұрын
If I make the header fixed , it goes beyond the view, how possible can I make it to fit my page!!!. The same with side bar!...
@CodeWithAamir2 жыл бұрын
Hi @Mutebi, Can you please share your code snippet which is causing this issue. I will check and suggest the solution accordingly. You can share code via comment here or on codesandbox or via email at aamircodewith@gmail.com Thanks
@BachelorsEntertainer Жыл бұрын
❤❤❤❤You a good 👍👍👍
@CodeWithAamir Жыл бұрын
So nice! ❤❤❤
@SoulisYT Жыл бұрын
Hi there and thnx for the video. If I add a button/link.navlink in the content of the Dashboard and use navigate to go to Home the menu doesn't get active. Is this a bug with antd ? Do I have to use hooks to fix this ?
@CodeWithAamir Жыл бұрын
Hi @Soulis HCR2, Its not a bug in antd, actually and menu does not keep track of where you are in the browser link/path. So we can achieve that using the useEffect hook and as soon as the window location path changes we can highlight that particular menu item accordingly. It will look something like below. I have explained this code in following video near 1hr:16min timestamp at that video, you can look that for more details kzbin.info/www/bejne/rqelhpqagLqta8k import { AppstoreOutlined, ShopOutlined, ShoppingCartOutlined, UserOutlined, } from "@ant-design/icons"; import { Menu } from "antd"; import { useEffect, useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; function SideMenu() { const location = useLocation(); const [selectedKeys, setSelectedKeys] = useState("/"); useEffect(() => { const pathName = location.pathname; setSelectedKeys(pathName); }, [location.pathname]); const navigate = useNavigate(); return ( { //item.key navigate(item.key); }} selectedKeys={[selectedKeys]} items={[ { label: "Dashbaord", icon: , key: "/", }, { label: "Inventory", key: "/inventory", icon: , }, { label: "Orders", key: "/orders", icon: , }, { label: "Customers", key: "/customers", icon: , }, ]} > ); } export default SideMenu; Please let me know if you need any more help on that. Thanks
@SoulisYT Жыл бұрын
@@CodeWithAamir Thank you very much for the quick reply. Actually I looked at your code and realised that I was using the `defaultSelectedKeys` property. When I switched to `selectedKeys` it worked even without the useState and useEffect hook ;) Also in the `onClick={(item) => {` the item is deprecated and I use just key. thank you very much again !!!!
@CodeWithAamir Жыл бұрын
Thats great! @Soulis HCR2
@MilesWalker-g9v Жыл бұрын
Great tutorial, would be super helpful if you uploaded the code too!
@CodeWithAamir Жыл бұрын
Thank you @Miles I can share the code file via email, send me email aamircodewith@gmail.com. Code is Not uploaded to git as of yet. Best!
@shanmugamm40232 жыл бұрын
Which version of react router dom are you using
@CodeWithAamir2 жыл бұрын
Hi @Shanmugam M, It's version is 6.3.0 "react-router-dom": "^6.3.0" Please let me know if you need any more help on that. Thanks
@veervirk18252 жыл бұрын
Hey Amir I am facing issue while doing this.. routing is ok but menu selection is not happing when I click on menu's. please help regarding this.
@CodeWithAamir2 жыл бұрын
Hi @Veer Virk, Please share your current menu code so I can look into it and suggest the solution accordingly. Thanks
@veervirk18252 жыл бұрын
@@CodeWithAamir how I can share
@CodeWithAamir2 жыл бұрын
You can share via codesandbox etc. or email me at aamircodewith@gmail.com
@veervirk18252 жыл бұрын
Can we connect over Skype??
@CodeWithAamir2 жыл бұрын
We can zoom if needed, but for now I got the code snippet via email and checked it. To me it is working fine. Actually you are using menu mode="horizontal" so in that case it only highlight the text color and ads a bottom border which I can see its doing, if it is not the case at your end we can see it further over zoom or so. If you chose mode inline then you will see it is adding selection background color as seen in video tutorial. Hope it make sense. Please let me know if you need any more information on that. Thanks
@iamthewalrus732 жыл бұрын
Awesome!!
@CodeWithAamir2 жыл бұрын
Thank you! Cheers!
@mehakgupta71788 ай бұрын
how to make this side bar responsive? so that it collapses for mobile mode?
@maribee1273 Жыл бұрын
hi, Do you know why I get an error when I use AntD's Menu in Next.js? I have created a user sidebar in UserRoute. But I get an error. Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application It is a simple code, but I can't figure out why the error occurs. import { useState, useEffect } from "react"; import Link from "next/link"; import { Menu } from "antd"; import { useRouter } from "next/router"; import { UserOutlined, DollarOutlined, ProfileOutlined, StarOutlined, } from "@ant-design/icons"; import { useWindowWidth } from "@react-hook/window-size"; const UserNav = () => { const [current, setCurrent] = useState(""); const router = useRouter(); const currentPath = router.pathname; const onlyWidth = useWindowWidth(); useEffect(() => { process.browser && setCurrent(window.location.pathname); }, [process.browser && window.location.pathname]); const items = [ { key: "/user/dashboard", label: "user/dashboard"", icon: , link: "/user/dashboard", }, { key: "/user/payment-information", label: "user/payment-information"", icon: , link: "/user/payment-information", }, { key: "/user/portfolio", label: "/user/portfolio", icon: , link: "/user/portfolio", }, { key: "/user/content-list", label: "/user/content-list", icon: , link: "/user/content-list", }, ]; return ( ({ key: item.key, icon: item.icon, label: ( {item.label} ), }))} /> ); }; export default UserNav;
@muneebali4271 Жыл бұрын
I need your help with adding 404 to these routers
@CodeWithAamir Жыл бұрын
Yes please let me know with your details on aamircodewith@gmail.com
@BachelorsEntertainer Жыл бұрын
How can me make them responsive like when width is 768 or 800 side menu auto close and also button to close and open side menu
@CodeWithAamir Жыл бұрын
Hi @Tufail Mashwani I have a video on how to make the menu responsive at kzbin.info/www/bejne/Z5OtkH-heK-Jhpo May be try that if that helps or let me know if you still need any more information on that thing. Thanks
@khanhedo022 жыл бұрын
How to log out, exit the menu and move to a completely new login page
@CodeWithAamir2 жыл бұрын
Hi, To logout and move to a completely new page you need to create a Route for the login page and on click of logout button you can navigate to that login route. So for that you can create two main routes Home and Login and consider all of these menu routes as child of Home route so on login you move to Home routes and on logout you move to login route. I have explained how to create child routes in following video that might help kzbin.info/www/bejne/h53WZWpjbd-CnZI Please let me know if you need any more information on that. Thank you!
@АнастасияПонамарева-у8ь Жыл бұрын
If we click to goBack button on browser defaultSelectedKeys didn't work, why?
@CodeWithAamir Жыл бұрын
Hi @Анастасия Понамарева , You are right that defaultSelectedKeys will not work after the Menu is created and you press the back button so for that purpose you can use the selectedKeys props instead which is gets applied always instead of the default value. The other params/keys are the same for selectedKeys prop as well. If needed you can listen to the location change using the useEffect and then update the selectedKeys on each location change which will be called as soon as you press the back button. Please let me know if this makes sense or you need any more information on that. Thanks
@mutebiugofficial88272 жыл бұрын
I have a problem maybe it could be the absence of "./app.css". When I click a menu item ,i.e profile , it routes to a new layout. I want something like that one . When I click dashboard it displays dashboard component etc any help brother
@CodeWithAamir2 жыл бұрын
Hi @mutebi ug official, To be sure, may be you can create a App.css file and add following content inside that file to see whether it works. //App.css content starts here @import 'antd/dist/antd.css'; .App { text-align: center; min-height: 100vh; width: 100vw; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: calc(10px + 2vmin); color: black; } //App.css content ends here Also import App.css file in your .js file. Please let me know if that works now or have issues. Thanks
@SandeepSharma-lm1ye Жыл бұрын
maine eske jaisa hi bana raakha ha lekin sab koe component render karna chahta hu to use fade-in effect chahiye bus ye nahi kar pa raha hu. Please help
@CodeWithAamir Жыл бұрын
Hi, Aap antd Motion use kar sktey hen is case mai, jese iss link pa explained ha motion.ant.design/components/animate#components-animate-demo-simple still koi help chaye to let me know. Thanks
@kimkhisieuben Жыл бұрын
i use ant layout and it has get item, i put key on that but it not works, how do i solve, manny thanks
@CodeWithAamir Жыл бұрын
Hi @Anh Tu Tran, I am not able to get it what could be the issue in code, can you please share the code snippet so I can take a look and find the issue/solution on that. Thanks
@Manjusha907522 жыл бұрын
Hii amir how I can make sidebar menu items active based on the url typed by user for example if user type localhost/user/id then my users menuitem should be active. Please help!!!!
@CodeWithAamir2 жыл бұрын
Hi @Deadmax, If the url is same as the menu item key then you can use the defaultSelectedKeys to get it hightighted and if the url is not the exactly same as the menu item key then you can create a simple function to get the key which need to be highlighted like const getHighlightedKeys=()=>{ const path = window.location.pathname if(path==='/users'){ return ['/users'] }else if(String(path).startsWith('/users/'){//OR you can use any regex here to match return ['/users'] } //and it continues for other matches } I hope you got the idea. Please let me know if you need any more information on that. Thanks
@Manjusha907522 жыл бұрын
@@CodeWithAamir thx ill try this
@CodeWithAamir2 жыл бұрын
Sure, All the best!
@LearnOnTime1 Жыл бұрын
sir ap na app.js k andr content k function k andr jo routes bnay hain wo ma same as it is ak new .jsx file ma bnana chahta hn or app.js ma main srf login call krwana chahta hn lkn routes jb ma new file ma call krwata hn to wo work ni krta lkn app.js k andr likhu to proper work krta hain kindly mja help kr dain ya kasa ho ga .
@CodeWithAamir Жыл бұрын
Hi @Raja Fahad, It should work in same file as well as in a separate file. Can you please share your code snippet so I can check that code and see what could be the issue with that. Thanks
@mohammadmostafa7942 жыл бұрын
thanks
@sayeedabu7150 Жыл бұрын
Excellent tutorial. Bro could you send me the code please ?
@CodeWithAamir Жыл бұрын
Code has been shared via your email reply. Thanks.
@sayeedabu7150 Жыл бұрын
@@CodeWithAamir thank you 🙏
@mateusfilipe9723 Жыл бұрын
Nice Video. Could you please share the code, thank you very much
@CodeWithAamir Жыл бұрын
Thanks and code has been sent via email reply.
@tie.garcia6 ай бұрын
why i find this so late
@izooo31965 ай бұрын
can i get the github for this code please
@은선최-i6t2 жыл бұрын
Could you please share the code thank you
@CodeWithAamir2 жыл бұрын
Yes please send me an email at aamircodewith@gmail.com I will reply back with the tutorial code file attached. Thanks
@ВладимирЛитовченко-ш3н Жыл бұрын
как сделать переключатель "темную / светлая тема" для компонентов в Ant Design без использования своих CSS, а использования стилей или библиотек Ant Design
@CodeWithAamir Жыл бұрын
Hi, For the menu component you can use the theme prop like or you can make it based on variable like Please let me know if you need any more information on that. Thank you !
@dnic171 Жыл бұрын
Hi, this is a good tutorial. Could you please share the code?
@CodeWithAamir Жыл бұрын
Thank you, Please send me an email at aamircodewith@gmail.com I will reply back with the code file. Thanks
@dnic171 Жыл бұрын
@@CodeWithAamir I sent the email... thank you for the video again...
@satyasai86052 жыл бұрын
please add the resource code
@CodeWithAamir2 жыл бұрын
Hi @satya sai, Please send me an email at aamircodewith@gmail.com, I will reply back with the code file developed in this tutorial. Thanks
@zhuofeng10892 жыл бұрын
hi man can you share the source code plz?
@CodeWithAamir2 жыл бұрын
Sure @Zhuo, Please send me an email at aamircodewith@gmail.com I will reply back with tutorial code. Thanks
@krishnamalik5563 Жыл бұрын
Hi amir i need help I routing
@CodeWithAamir Жыл бұрын
Yes, please let me know what help you need, you can comment here or send me details on aamircodewith@gmail.com
@saikiran4422 Жыл бұрын
Please show app.css code also it will help
@CodeWithAamir Жыл бұрын
Hi, The app.css does not contain anything special because in the tutorial we used the style props to style the components, the app.css is there because I reused the app.js file for multiple tutorials. I have sent you email by the way. Thanks
@vietdungnguyen5357 Жыл бұрын
Can you share code of this video?
@CodeWithAamir Жыл бұрын
Yes @Việt Dũng Nguyễn, I have replied back to your email with the code file. Please let me know if you face any issues. Thanks
@santoshsambangi-bu2zb7 ай бұрын
bro please send source code
@deeksha56262 жыл бұрын
Could you please share the code
@CodeWithAamir2 жыл бұрын
Hi @Deeksha, Please send me an email at aamircodewith@gmail.com I will reply with code file attached there. Thanks
@deeksha56262 жыл бұрын
@@CodeWithAamiremail has sent
@CodeWithAamir2 жыл бұрын
Hi @Deeksha Alva, Code file has been shared with you, please check your email. Please let me know if you need any more help on that. Thanks
@deeksha56262 жыл бұрын
@@CodeWithAamir Thank you 😊
@PKarthikeyan-k7x6 ай бұрын
Send me the code please ?
@veervirk18252 жыл бұрын
code shared with you Aamir via mail. please check
@CodeWithAamir2 жыл бұрын
I got the code snippet and checked it. To me it is working fine. Actually you are using menu mode="horizontal" so in that case it only highlight the text color and ads a bottom border which I can see its doing, if it is not the case at your end we can see it further over zoom or so. If you chose mode inline then you will see it is adding selection background color as seen in video tutorial. Hope it make sense. Please let me know if you need any more information on that. Thanks
@ainguyenoffical2 жыл бұрын
Could you please share the code. I sent you an email
@CodeWithAamir2 жыл бұрын
Hi @Ái Nguyễn, I have shared the code via email reply. Please check your email. Please let me know if you need any more help on that. Thanks
@hyphamne Жыл бұрын
window.location.pathname
@romiean75272 жыл бұрын
i amir may you share ur code with me ? im already sent email to you thankyou :)
@CodeWithAamir2 жыл бұрын
Hi @Romie AN , I have shared code via email. Please let me know if you need any more help on that. Thanks
@sabirsayyad6459 Жыл бұрын
Could you plz send me thr code, I have sent you email