Skip to content

Styling cleanup #4573

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

Merged
merged 11 commits into from
Jan 19, 2025
2 changes: 1 addition & 1 deletion ui/components/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlertTitle, Alert as MaterialAlert } from "@mui/lab";
import { AlertTitle, Alert as MaterialAlert } from "@mui/material";
import * as React from "react";
import styled from "styled-components";
import { ThemeTypes } from "../contexts/AppContext";
Expand Down
12 changes: 7 additions & 5 deletions ui/components/AlertListErrors.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Alert from "@mui/lab/Alert";
import { Box, Button, Collapse } from "@mui/material";
import Alert from "@mui/material/Alert";
import { sortBy, uniqBy } from "lodash";
import React, { FC, useEffect, useState } from "react";
import styled from "styled-components";
Expand Down Expand Up @@ -31,7 +31,8 @@ const BoxWrapper = styled(Box)`
}
.MuiAlert-icon {
.MuiSvgIcon-root {
display: none;
display: inline-flex;
color: ${(props) => props.theme.colors.alertMedium};
}
}
.MuiAlert-message {
Expand All @@ -43,6 +44,7 @@ const BoxWrapper = styled(Box)`
`;
const ErrorText = styled(Text)`
margin-left: 8px;
color: ${(props) => props.theme.colors.alertMedium};
`;
const NavButton = styled(Button)`
padding: 0;
Expand Down Expand Up @@ -86,9 +88,9 @@ export const AlertListErrors: FC<{
{!!filteredErrors[index] && (
<Alert severity="error" onClose={() => setShow(false)}>
<Flex align center>
<Icon type={IconType.ErrorIcon} size="medium" color="alertDark" />
<ErrorText data-testid="error-message" color="black">
{filteredErrors[index].clusterName}:&nbsp;
<ErrorText data-testid="error-message">
{filteredErrors[index].clusterName &&
filteredErrors[index].clusterName + ":&nbsp;"}
{filteredErrors[index].message}
</ErrorText>
</Flex>
Expand Down
6 changes: 6 additions & 0 deletions ui/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ const Button = styled(UnstyledButton)`
line-height: 1;
border-radius: ${(props) => props.theme.borderRadius.soft};
font-weight: 600;
&:hover {
background-color: ${(props) => props.theme.colors.blueWithOpacity};
}
}
&.MuiButton-outlined {
padding: 8px 12px;
Expand All @@ -58,6 +61,9 @@ export const IconButton = styled(UnstyledButton)`
min-width: 38px;
height: 38px;
padding: 0;
&:hover {
background-color: ${(props) => props.theme.colors.blueWithOpacity};
}
}
&.MuiButton-text {
padding: 0;
Expand Down
4 changes: 2 additions & 2 deletions ui/components/DagGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const GraphDiv = styled.div`

function DagGraph({ className, nodes }: Props) {
//zoom
const defaultZoomPercent = 85;
const defaultZoomPercent = 75;
const [zoomPercent, setZoomPercent] = React.useState(defaultZoomPercent);

//pan
Expand Down Expand Up @@ -192,7 +192,7 @@ export default styled(DagGraph).attrs({ className: DagGraph.name })`
width: 6px;
}
.MuiSlider-vertical .MuiSlider-thumb {
margin-left: -9px;
margin-left: 0px;
}
.MuiSlider-thumb {
width: 24px;
Expand Down
8 changes: 7 additions & 1 deletion ui/components/DarkModeSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ function DarkModeSwitch({ className, darkModeEnabled }: Props) {
export default styled(DarkModeSwitch).attrs({
className: DarkModeSwitch.name,
})`
.MuiSwitch-thumb {
.MuiSwitch-switchBase {
&:hover {
background-color: ${(props) => props.theme.colors.blueWithOpacity};
}
}
.MuiSwitch-thumb {
color: #fff;
background-image: url(${(props) =>
props.theme.mode === ThemeTypes.Dark
Expand All @@ -34,4 +39,5 @@ export default styled(DarkModeSwitch).attrs({
}
.MuiSwitch-track {
background-color: ${(props) => props.theme.colors.primary};
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ exports[`DataTable snapshots renders 1`] = `
background: rbga(255, 255, 255, 0.75);
height: 100%;
width: 100%;
border-left: 2px solid #d8d8d8;
border-left: 2px solid #BDBDBD;
padding: 24px;
padding-left: 32px;
}
Expand Down Expand Up @@ -202,7 +202,7 @@ exports[`DataTable snapshots renders 1`] = `
}

.c1 .MuiTableCell-root {
border-color: #d8d8d8;
border-color: #BDBDBD;
}

.c1 table {
Expand All @@ -211,7 +211,7 @@ exports[`DataTable snapshots renders 1`] = `

.c1 th {
padding: 0;
background: #F6F7F9;
background: #C2C9D7;
}

.c1 th .MuiCheckbox-root {
Expand Down Expand Up @@ -266,7 +266,7 @@ exports[`DataTable snapshots renders 1`] = `
className="c5"
>
<button
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-9wcwzo-MuiButtonBase-root-MuiButton-root"
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-1swlott-MuiButtonBase-root-MuiButton-root"
disabled={null}
id=":r0:"
onBlur={[Function]}
Expand Down Expand Up @@ -317,7 +317,7 @@ exports[`DataTable snapshots renders 1`] = `
className="c5"
>
<button
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-9wcwzo-MuiButtonBase-root-MuiButton-root"
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-1swlott-MuiButtonBase-root-MuiButton-root"
disabled={null}
id=":r1:"
onBlur={[Function]}
Expand Down Expand Up @@ -360,7 +360,7 @@ exports[`DataTable snapshots renders 1`] = `
className="c5"
>
<button
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-9wcwzo-MuiButtonBase-root-MuiButton-root"
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-1swlott-MuiButtonBase-root-MuiButton-root"
disabled={null}
id=":r2:"
onBlur={[Function]}
Expand Down Expand Up @@ -403,7 +403,7 @@ exports[`DataTable snapshots renders 1`] = `
className="c5"
>
<button
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-9wcwzo-MuiButtonBase-root-MuiButton-root"
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit MuiButton-root MuiButton-text MuiButton-textInherit MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorInherit c6 css-1swlott-MuiButtonBase-root-MuiButton-root"
disabled={null}
id=":r3:"
onBlur={[Function]}
Expand Down
3 changes: 1 addition & 2 deletions ui/components/ErrorList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Alert } from "@mui/lab";
import { Box, Collapse } from "@mui/material";
import { Alert, Box, Collapse } from "@mui/material";
import { sortBy, uniqBy } from "lodash";
import * as React from "react";
import styled from "styled-components";
Expand Down
20 changes: 19 additions & 1 deletion ui/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ArrowLeft, ArrowRight } from "@mui/icons-material";
import { IconButton, Tab, Tabs, Tooltip } from "@mui/material";
import { alpha } from "@mui/material/styles";
import _ from "lodash";
import React, { Dispatch, SetStateAction } from "react";
import styled from "styled-components";
import { ThemeTypes } from "../contexts/AppContext";
import { formatURL } from "../lib/nav";
import { PageRoute, V2Routes } from "../lib/types";
import { Fade } from "../lib/utils";
Expand Down Expand Up @@ -81,10 +83,20 @@ const NavContent = styled.div<{ collapsed: boolean }>`
//matches .MuiSvgIcon-root
transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
&.selected,
:hover {
&:hover {
background-color: ${(props) => props.theme.colors.blueWithOpacity};
}
}

.link-flex:hover,
.horizontal-tabs:hover {
background-color: ${(props) => props.theme.colors.blueWithOpacity};
}

.link-flex span:hover {
background-color: transparent;
}

.header {
opacity: ${(props) => (props.collapsed ? 0 : 1)};
letter-spacing: 1px;
Expand All @@ -97,6 +109,12 @@ const NavContent = styled.div<{ collapsed: boolean }>`
const CollapseButton = styled(IconButton)`
&.MuiIconButton-root {
margin: 0 18px 0 4px;
&:hover {
background-color: ${(props) =>
props.theme.mode === ThemeTypes.Dark
? alpha(props.theme.colors.primary10, 0.2)
: alpha(props.theme.colors.primary, 0.1)};
}
}
`;

Expand Down
4 changes: 2 additions & 2 deletions ui/components/ReconciliationGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const Graph = ({
const links = tree.links();

//zoom
const defaultZoomPercent = 85;
const defaultZoomPercent = 75;
const [zoomPercent, setZoomPercent] = React.useState(defaultZoomPercent);

//pan
Expand Down Expand Up @@ -179,7 +179,7 @@ export default styled(ReconciliationGraph)`
width: 6px;
}
.MuiSlider-vertical .MuiSlider-thumb {
margin-left: -9px;
margin-left: 0px;
}
.MuiSlider-thumb {
width: 24px;
Expand Down
12 changes: 11 additions & 1 deletion ui/components/SearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,20 @@ const Expander = styled(
),
)`
width: 0px;
transition: width 0.3s ease-in-out;
transition-property: opacity, width;
transition-duration: 0.5s;
transition-timing-function: cubic-bezier(0.46, 0.03, 0.52, 0.96);
margin-left: 4px;
opacity: 0;

&.expanded {
width: 200px;
opacity: 1;
}

input {
padding: 8px 10px;
border-bottom: 1px solid ${(props) => props.theme.colors.neutral40};
}
`;

Expand Down
9 changes: 9 additions & 0 deletions ui/components/SubRouterTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default styled(SubRouterTabs).attrs({ className: SubRouterTabs.name })`
width: 100%;
.MuiTabs-flexContainer {
border-bottom: 3px solid ${(props) => props.theme.colors.neutral20};

.MuiTab-root {
line-height: 1;
letter-spacing: 1px;
Expand All @@ -119,6 +120,14 @@ export default styled(SubRouterTabs).attrs({ className: SubRouterTabs.name })`
@media (min-width: 1440px) {
min-width: 132px;
}
&:hover {
background-color: ${(props) => props.theme.colors.blueWithOpacity};
color: ${(props) => props.theme.colors.primary10};
font-weight: 600;
span {
color: ${(props) => props.theme.colors.primary};
}
}
}
}
.MuiTabs-indicator {
Expand Down
2 changes: 1 addition & 1 deletion ui/components/Sync/ResumeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function ResumeIcon() {
<svg
width="24"
height="24"
viewBox="0 0 24 24"
viewBox="-2 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M4.08331 18.75V4.75H6.41665V18.75H4.08331ZM8.74998 18.75L20.4166 11.75L8.74998 4.75V18.75Z" />
Expand Down
18 changes: 15 additions & 3 deletions ui/components/Sync/SyncControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const IconButton = styled(Button)`
height: 32px;
padding: 0;

:disabled {
&.Mui-disabled {
svg {
fill: ${(props) =>
props.theme.mode === ThemeTypes.Dark
Expand All @@ -81,7 +81,7 @@ export const IconButton = styled(Button)`
}
}

:hover {
&:hover {
background-color: ${(props) =>
props.theme.mode === ThemeTypes.Dark
? alpha(props.theme.colors.primary10, 0.2)
Expand All @@ -90,6 +90,19 @@ export const IconButton = styled(Button)`
}
&.MuiButton-text {
padding: 0;

&.Mui-disabled {
color: ${(props) =>
props.theme.mode === ThemeTypes.Dark
? props.theme.colors.primary30
: props.theme.colors.neutral20};
svg {
fill: ${(props) =>
props.theme.mode === ThemeTypes.Dark
? props.theme.colors.primary30
: props.theme.colors.neutral20};
}
}
}
`;

Expand Down Expand Up @@ -230,7 +243,6 @@ export default styled(SyncControls)`

.rotate-icon {
color: ${(props) => props.theme.colors.primary10};

animation: 1s linear infinite ${rotateAnimation};
}
`;
Loading
Loading