Skip to content

Commit 2f57801

Browse files
authored
New Menu Adjustments (#2450)
1 parent e7ec3fe commit 2f57801

File tree

8 files changed

+142
-117
lines changed

8 files changed

+142
-117
lines changed

portal-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"kbar": "^0.1.0-beta.34",
3131
"local-storage-fallback": "^4.1.1",
3232
"lodash": "^4.17.21",
33-
"mds": "https://github.com/minio/mds.git#v0.0.3",
33+
"mds": "https://github.com/minio/mds.git#v0.0.4",
3434
"minio": "^7.0.28",
3535
"moment": "^2.29.4",
3636
"react": "^18.1.0",

portal-ui/src/screens/Console/Common/Components/LicensedConsoleLogo.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

portal-ui/src/screens/Console/Common/PageHeader/PageHeader.tsx

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ import Grid from "@mui/material/Grid";
2121
import createStyles from "@mui/styles/createStyles";
2222
import withStyles from "@mui/styles/withStyles";
2323
import { AppState, useAppDispatch } from "../../../../store";
24-
import OperatorLogo from "../../../../icons/OperatorLogo";
25-
import ConsoleLogo from "../../../../icons/ConsoleLogo";
26-
import DirectPVLogo from "../../../../icons/DirectPVLogo";
2724

2825
import { CircleIcon, ObjectManagerIcon } from "../../../../icons";
2926
import { Box } from "@mui/material";
3027
import { toggleList } from "../../ObjectBrowser/objectBrowserSlice";
3128
import { selFeatures } from "../../consoleSlice";
3229
import { selDirectPVMode, selOpMode } from "../../../../systemSlice";
33-
import { Button } from "mds";
30+
import { ApplicationLogo, Button } from "mds";
3431

3532
const styles = (theme: Theme) =>
3633
createStyles({
@@ -57,9 +54,8 @@ const styles = (theme: Theme) =>
5754
},
5855
logo: {
5956
marginLeft: 34,
60-
fill: theme.palette.primary.main,
61-
"& .min-icon": {
62-
width: 120,
57+
"& svg": {
58+
width: 150,
6359
},
6460
},
6561
middleComponent: {
@@ -124,9 +120,20 @@ const PageHeader = ({
124120
const newItems = useSelector(
125121
(state: AppState) => state.objectBrowser.objectManager.newItems
126122
);
123+
const licenseInfo = useSelector(
124+
(state: AppState) => state?.system?.licenseInfo
125+
);
127126

128127
const [newObject, setNewObject] = useState<boolean>(false);
129128

129+
const { plan = "" } = licenseInfo || {};
130+
131+
let logoPlan = "AGPL";
132+
133+
if (plan === "STANDARD" || plan === "ENTERPRISE") {
134+
logoPlan = plan.toLowerCase();
135+
}
136+
130137
useEffect(() => {
131138
if (managerObjects.length > 0 && !managerOpen) {
132139
setNewObject(true);
@@ -159,10 +166,24 @@ const PageHeader = ({
159166
{!sidebarOpen && (
160167
<div className={classes.logo}>
161168
{!operatorMode && !directPVMode ? (
162-
<ConsoleLogo />
169+
<ApplicationLogo
170+
applicationName={"console"}
171+
subVariant={
172+
logoPlan as
173+
| "AGPL"
174+
| "simple"
175+
| "standard"
176+
| "enterprise"
177+
| undefined
178+
}
179+
/>
163180
) : (
164181
<Fragment>
165-
{directPVMode ? <DirectPVLogo /> : <OperatorLogo />}
182+
{directPVMode ? (
183+
<ApplicationLogo applicationName={"directpv"} />
184+
) : (
185+
<ApplicationLogo applicationName={"operator"} />
186+
)}
166187
</Fragment>
167188
)}
168189
</div>

portal-ui/src/screens/Console/Common/TooltipWrapper/TooltipWrapper.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,29 @@ interface ITooltipWrapperProps {
2121
tooltip: string;
2222
children: any;
2323
errorProps?: any;
24+
placement?:
25+
| "bottom-end"
26+
| "bottom-start"
27+
| "bottom"
28+
| "left-end"
29+
| "left-start"
30+
| "left"
31+
| "right-end"
32+
| "right-start"
33+
| "right"
34+
| "top-end"
35+
| "top-start"
36+
| "top";
2437
}
2538

2639
const TooltipWrapper = ({
2740
tooltip,
2841
children,
2942
errorProps = null,
43+
placement,
3044
}: ITooltipWrapperProps) => {
3145
return (
32-
<Tooltip title={tooltip}>
46+
<Tooltip title={tooltip} placement={placement}>
3347
<span>
3448
{errorProps ? cloneElement(children, { ...errorProps }) : children}
3549
</span>

portal-ui/src/screens/Console/Menu/MenuSectionHeader.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ const MenuSectionHeader = ({ label }: IMenuSectionHeader) => {
2424
return (
2525
<div
2626
style={{
27-
fontSize: 18,
28-
color: "#fff",
27+
fontSize: 15,
28+
color: "#b3c9d9",
2929
marginTop: 20,
3030
marginBottom: 10,
31+
borderBottom: "#0F446C 1px solid",
32+
marginRight: 25,
33+
paddingBottom: 5,
3134
}}
3235
className={"menuHeader"}
3336
>

portal-ui/src/screens/Console/Menu/MenuStyleUtils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
export const menuItemContainerStyles: any = {
18-
padding: "12px 0",
18+
padding: "7px 0",
1919
"div:nth-of-type(2)": {
2020
flexGrow: 0,
2121
marginRight: "15px",
2222
},
2323

2424
"&.active": {
2525
background:
26-
"transparent linear-gradient(270deg, #00000000 0%, #051d39 53%, #54545400 100%) 0% 0% no-repeat padding-box",
26+
"transparent linear-gradient(270deg, #00000000 0%, #005F81 53%, #54545400 100%) 0% 0% no-repeat padding-box",
2727
backgroundBlendMode: "multiply",
2828

2929
"& span": {

0 commit comments

Comments
 (0)