Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render children inside AppBar #2573

Closed
wants to merge 3 commits into from

Conversation

astiag
Copy link

@astiag astiag commented Nov 26, 2018

this PR will render children inside AppBar component

@fzaninotto
Copy link
Member

please add documentation and example usage

@alanpoulain
Copy link
Contributor

Related to this: #2534

@fzaninotto
Copy link
Member

Let me rephrase my remark: please add documentation and example usage in the files of your PR (i.e. modify the react-admin documentation, not only the code).

@alanpoulain
Copy link
Contributor

I can but I am not the author of this PR 😅

@astiag
Copy link
Author

astiag commented Nov 28, 2018

I know your rules about having everything documented.
but the thing is you already have it here

btw your docs regarding to adding children to AppBar will cause some problems

const MyAppBar = props => (
    <AppBar {...props}>
        <Toolbar>
            <Typography variant="title" id="react-admin-title" />
        </Toolbar>
    </AppBar>
);

in this case you will have Toolbar inside Toolbar. see here

so I also will fix this one in a new commit in this PR

@alanpoulain
Copy link
Contributor

@astiag No I don't think it's the case. You are mixing up AppBar from @material-ui and AppBar from ra-ui-materialui. The first can take children (and a Toolbar), the second can't.

@astiag
Copy link
Author

astiag commented Nov 28, 2018

@alanpoulain you are right. didnt notice that.
anyway I'll add something in documents about having children inside AppBar

@astiag astiag force-pushed the render-appbar-children branch from 77a15c7 to 6ffbd8d Compare November 28, 2018 12:29
@astiag
Copy link
Author

astiag commented Nov 28, 2018

@fzaninotto please review again

docs/Theming.md Outdated
@@ -409,6 +409,22 @@ const MyAppBar = props => <AppBar {...props} userMenu={<MyUserMenu />} />;
const MyLayout = props => <Layout {...props} appBar={MyAppBar} />;
```

`AppBar` can accept children so you are able to add more custom components in it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably go inside the Using a Custom AppBar section.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change it asap

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@fzaninotto
Copy link
Member

Any progress?

@BartoGabriel
Copy link

I think it would be good to combine this feature, with the possibility of disabling the LoadingIndicator or the UserMenu of the AppBar.
Since the user having the ability to customize AppBar, he could create their own components, without having to make a new AppBar.
With two properties it could be solved.

@astiag
Copy link
Author

astiag commented Dec 25, 2018

Any progress?

@fzaninotto @djhi I've moved the description to Using a Custom AppBar section

@fzaninotto
Copy link
Member

Thanks for the PR, I've finally decided to do a slightly different implementation (replacing the content with children instead of appending the children to the default content) in #2777. So I'll close this PR.

@fzaninotto fzaninotto closed this Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants