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

fix: render Ordertab only when it is active #6583

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/volto/news/6492.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You can now render the order side panel only when the 'Order' tab is active. Previously, the panel would render unnecessarily even when not active.@Abhishek-17h
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
You can now render the order side panel only when the 'Order' tab is active. Previously, the panel would render unnecessarily even when not active.@Abhishek-17h
The Order side panel now renders only when the "Order" tab is active. Previously, the panel would render unnecessarily even when inactive. @Abhishek-17h

Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ const BlocksForm = (props) => {
<>
{isMainForm &&
isClient &&
document.getElementById('sidebar-order') &&
createPortal(
<div>
<Order
Expand Down Expand Up @@ -353,7 +354,6 @@ const BlocksForm = (props) => {
editable,
showBlockChooser: selectedBlock === childId,
detached: isContainer,
// Properties to pass to the BlocksForm to match the View ones
content: properties,
history,
location,
Expand All @@ -373,5 +373,4 @@ const BlocksForm = (props) => {
</>
);
};

export default BlocksForm;
27 changes: 14 additions & 13 deletions packages/volto/src/components/manage/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,20 @@ const Sidebar = (props) => {
},
!!orderTab && {
menuItem: intl.formatMessage(messages.order),
pane: (
<Tab.Pane
key="order"
className="tab-wrapper"
id="sidebar-order"
>
<Icon
className="tab-forbidden"
name={forbiddenSVG}
size="48px"
/>
</Tab.Pane>
),
pane:
tab === 2 ? (
<Tab.Pane
key="order"
className="tab-wrapper"
id="sidebar-order"
>
<Icon
className="tab-forbidden"
name={forbiddenSVG}
size="48px"
/>
</Tab.Pane>
) : null,
},
!!settingsTab && {
menuItem: intl.formatMessage(messages.settings),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,6 @@ Array [
xmlns=""
/>
</div>
<div
className="ui bottom attached segment tab tab-wrapper"
id="sidebar-order"
>
<svg
className="icon tab-forbidden"
dangerouslySetInnerHTML={
Object {
"__html": undefined,
}
}
onClick={null}
style={
Object {
"fill": "currentColor",
"height": "48px",
"width": "auto",
}
}
viewBox=""
xmlns=""
/>
</div>
</div>
</div>,
<div
Expand Down
Loading