Skip to content

Commit c1d2d00

Browse files
committed
fix: group all ProfileExplorer action buttons, don't float new to the left
1 parent 4adf94b commit c1d2d00

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

plugins/plugin-codeflare/src/components/ProfileExplorer.tsx

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
Chip,
2929
ChipGroup,
3030
Flex,
31-
FlexItem,
3231
TreeView,
3332
TreeViewDataItem,
3433
} from "@patternfly/react-core"
@@ -587,37 +586,34 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
587586
}
588587

589588
private readonly nowrap = { default: "nowrap" as const }
590-
private readonly flex1 = { default: "flex_1" as const }
591-
private readonly flexEnd = { default: "justifyContentFlexEnd" as const }
589+
private readonly justify = { default: "justifyContentCenter" as const }
592590
private readonly spaceNone = { default: "spaceItemsNone" as const }
593591

594592
private footer() {
595593
return (
596-
<Flex flexWrap={this.nowrap} justifyContent={this.flexEnd} spaceItems={this.spaceNone}>
597-
<FlexItem flex={this.flex1}>
598-
<Tooltip position="top-start" content="Create a new profile">
599-
<Button variant="control" icon={<PlusSquareIcon />} onClick={this._onNew} />
600-
</Tooltip>
601-
</FlexItem>
602-
603-
<FlexItem>
604-
<Tooltip
605-
position="top-start"
606-
content={this.state.editable ? "Lock out changes" : "Unlock, allowing choices to be modified"}
607-
>
608-
<Button
609-
variant="control"
610-
icon={this.state.editable ? <LockOpenIcon /> : <LockIcon />}
611-
onClick={this._onToggleEditable}
612-
/>
613-
</Tooltip>
614-
<Tooltip position="top" content="Reset the choices in this profile">
615-
<Button variant="control" icon={<EraserIcon />} onClick={this._onReset} />
616-
</Tooltip>
617-
<Tooltip position="top" content="Delete this profile">
618-
<Button variant="control" icon={<TrashIcon />} onClick={this._onDelete} />
619-
</Tooltip>
620-
</FlexItem>
594+
<Flex flexWrap={this.nowrap} justifyContent={this.justify} spaceItems={this.spaceNone}>
595+
<Tooltip position="top-start" content="Create a new profile">
596+
<Button variant="control" icon={<PlusSquareIcon />} onClick={this._onNew} />
597+
</Tooltip>
598+
599+
<Tooltip
600+
position="top-start"
601+
content={
602+
this.state.editable ? "Cick to lock out changes" : "Click to unlock, allowing choices to be modified"
603+
}
604+
>
605+
<Button
606+
variant="control"
607+
icon={this.state.editable ? <LockOpenIcon /> : <LockIcon />}
608+
onClick={this._onToggleEditable}
609+
/>
610+
</Tooltip>
611+
<Tooltip position="top" content="Reset the choices in this profile">
612+
<Button variant="control" icon={<EraserIcon />} onClick={this._onReset} />
613+
</Tooltip>
614+
<Tooltip position="top" content="Delete this profile">
615+
<Button variant="control" icon={<TrashIcon />} onClick={this._onDelete} />
616+
</Tooltip>
621617
</Flex>
622618
)
623619
}

0 commit comments

Comments
 (0)