Open ashishjaswal2002 opened 11 hours ago
Where did you get this from? Is it a template from the mui store?
It is a component from material ui https://mui.com/toolpad/core/react-dashboard-layout/
This is a Toolpad component (which is a product of our company), I'm transfering to the correct repo :+1:
So how can i access a tag im material ui app provider so i can change the route.
What you're looking for is the branding
prop of the AppProvider
. You can do something like:
branding={{
logo: <img src="https://mui.com/static/logo.png" alt="MUI logo" />,
title: 'MUI',
}}
Ref this demo: https://mui.com/toolpad/core/react-dashboard-layout/#branding
@bharatkashyap please read the issue again.
Let me mention Again I mentioned the Dashboard Layout code above When i click on the image it redirects to the home page and on inspect i can see anchor tag . which is redirecting to the home page '/' what i want is that i want to redirect to the custom route when user click on the image i just want to change the href link. This is my issue. So how can i code so it redirects to the '/custom-route'.
in.
branding={{
logo: (
<Link to="/dashboard'>
</img src="https://mui.com/stxZXatic/logo.png" alt="MUI logo" />
</Link>)
title: 'MUI',
}}
If i set like this it is giving me anchor tag erros or a tag inside descendant errors......
When will i get the solution for this?
Understood. The default route is set in the Link
component here https://github.com/mui/toolpad/blob/master/packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx#L369 and I don't see a way to change it via props currently
We could potentially add a branding.home
property to the branding
prop and let that be the default before falling back to /
. Wdyt @apedroferreira? Did I miss a possible way to customize this route?
how ?
branding.home ={{
}}
@bharatkashyap is there any other way? what should i do now? please give me guidance
@bharatkashyap is there any other way? what should i do now? please give me guidance
Hi Ashish, the fastest way to see this feature land would be to contribute a PR that adds branding.home
- feel free to create one and we can gather everyone else's opinions there, if it merges we can add it to the next version which is planned to be released today
For this i have to clone repo? please give me guidance step by steps
Yes, clone the repo, make the changes on your local, push it to your fork on a new branch and then create a Pull Request
Understood. The default route is set in the
Link
component here https://github.com/mui/toolpad/blob/master/packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx#L369 and I don't see a way to change it via props currentlyWe could potentially add a
branding.home
property to thebranding
prop and let that be the default before falling back to/
. Wdyt @apedroferreira? Did I miss a possible way to customize this route?
Yeah, currently there's no way to override this.
The quickest way to allow for it would probably be to provide a new slot so that the whole link and its content in the header can be overridden.
And then if eventually we find more use cases for it or this becomes a common use case, we could add something like a homeUrl
to the branding.
@apedroferreira when it is going to be drop?
Steps to reproduce
Steps:
Current behavior
I am using Dashboard Layout i have an error when i click on the logo it is redirecting to the '/' layout and if i add
it is giving me error of a descendant elements because is already defined with '/' route. What i want is that to change the '/' route inside a tag how to access this anchor tag so i can change the route.
As you can see the code i am accessing the classes of material ui so i can add my own style inside createTheme.
Please reply fast and i cannot provide the live link because it is against the company.
Expected behavior
Your environment
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```npx @mui/envinfo
Search keywords: Dashboard
Search keywords: