Skip to content

Conversation

@KKoukiou
Copy link
Contributor

Modals are rendered outside the Page component, so they don’t inherit its classes. Adding the 'anaconda' class directly to ensures consistent styling across the UI.

@KKoukiou KKoukiou requested a review from mvollmer September 10, 2025 06:31
Copy link
Member

@mvollmer mvollmer left a comment

Choose a reason for hiding this comment

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

Thanks! I'd like to avoid the "random" useEffect and add the class in the "client is initialized" callback.

export const StoragePage = ({ location, plot_state }) => {
const page = get_page_from_location(location);

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think I would prefer this in storaged.jsx, close to the client.init() call.

    componentDidMount() {
        client.addEventListener("changed", this.on_client_changed);
        cockpit.addEventListener("locationchanged", this.on_navigate);
        client.init(() => { 
            if (client.in_anaconda_mode()) {
                document.body.classList.add("anaconda");
            this.setState({ inited: true });
        });
        window.setTimeout(() => { if (!this.state.inited) this.setState({ slow_init: true }); }, 1000);
    }

Looking at this now, I would also prefer to move the client.init call to the init function in storaged.jsx, but that's something for another day.

Modals are rendered outside the Page component, so they don’t inherit its
classes. Adding the 'anaconda' class directly to <body> ensures consistent
styling across the UI.
@KKoukiou KKoukiou force-pushed the storage-branding-anaconda branch from ab59fd2 to 488ac99 Compare September 10, 2025 08:06
@KKoukiou KKoukiou requested a review from mvollmer September 10, 2025 09:56
client.init(() => { this.setState({ inited: true }) });
client.init(() => {
if (client.in_anaconda_mode()) {
document.body.classList.add("anaconda");
Copy link
Member

@mvollmer mvollmer Sep 10, 2025

Choose a reason for hiding this comment

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

Shouldn't we keep the changes to pages.jsx from the previous version of this PR?

- <Page id="storage" className={"no-masthead-sidebar" + (client.in_anaconda_mode() ? " anaconda" : "")}>
+ <Page id="storage" className="no-masthead-sidebar">

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.

2 participants