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 expand icon size. #10842

Merged
merged 1 commit into from
Feb 14, 2025
Merged
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
2 changes: 1 addition & 1 deletion components/frontend/src/widgets/HeaderWithDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function HeaderWithDetails({ children, header, item_uuid, level, settings
<AccordionSummary
aria-controls={showDetails ? `accordion-content-${item_uuid}` : null}
aria-label="Expand/collapse"
expandIcon={<CaretRight size={{ h1: "5em", h2: "4em", h3: "3em" }[level]} />}
expandIcon={<CaretRight size={{ h1: "48px", h2: "32px", h3: "24px" }[level]} />}
id={`accordion-header-${item_uuid}`}
sx={{
border: "0",
Expand Down
2 changes: 1 addition & 1 deletion components/frontend/src/widgets/buttons/ExpandButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CaretDown, CaretRight } from "../icons"
export function ExpandButton({ expand, onClick }) {
return (
<IconButton aria-label="Expand/collapse" onClick={onClick}>
{expand ? <CaretDown /> : <CaretRight />}
{expand ? <CaretDown size="1.5em" /> : <CaretRight size="1.5em" />}
</IconButton>
)
}
Expand Down
15 changes: 11 additions & 4 deletions components/frontend/src/widgets/icons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ import MoveDownIcon from "@mui/icons-material/MoveDown"
import OpenInNewIcon from "@mui/icons-material/OpenInNew"
import VisibilityIcon from "@mui/icons-material/Visibility"
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff"
import { string } from "prop-types"

export function AddItemIcon() {
return <AddIcon fontSize="inherit" sx={{ verticalAlign: "middle" }} />
}

export function CaretDown() {
return <ArrowDropDownIcon title="expand" sx={{ verticalAlign: "middle", fontSize: "1.5em" }} />
export function CaretDown({ size }) {
return <ArrowDropDownIcon title="expand" sx={{ verticalAlign: "middle", fontSize: size }} />
}
CaretDown.propTypes = {
size: string.isRequired,
}

export function CaretRight() {
return <ArrowRightIcon title="expand" sx={{ verticalAlign: "middle", fontSize: "1.5em" }} />
export function CaretRight({ size }) {
return <ArrowRightIcon title="expand" sx={{ verticalAlign: "middle", fontSize: size }} />
}
CaretRight.propTypes = {
size: string.isRequired,
}

export function CopyItemIcon() {
Expand Down
Loading