Skip to content

Commit

Permalink
Simplified battery UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwaalkens authored and martinbosma committed Feb 29, 2024
1 parent cc9cc73 commit b78fe4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const BatteriesOverview = ({ componentMode = "full", pageSelectorPropsSetter }:
width: boxSize.width,
height: height,
}}
classes="h-full flex w-[15rem] md:w-[17rem] lg:w-[22rem] xl:w-[26rem]"
/>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import { Styles } from "./Styles"
interface Props {
battery: Battery
boxSize: ISize
classes: string
}

const BatterySummary = ({ battery, boxSize, classes }: Props) => {
const BatterySummary = ({ battery, boxSize }: Props) => {
const activeStyles = applyStyles(boxSize, Styles)

return (
<div className={classNames("flex flex-col justify-center items-center w-full h-full gap-4", classes)}>
<div className="flex flex-col justify-center items-center w-full h-full max-w-[20rem]">
<ProgressCircle
percentage={battery.soc ?? null}
boxSize={{
Expand Down Expand Up @@ -50,7 +49,7 @@ const BatterySummary = ({ battery, boxSize, classes }: Props) => {
<></>
)}
</ProgressCircle>
<div className={classNames("truncate mt-2 w-[inherit] text-center", activeStyles.name)}>{battery.name}</div>
<div className={classNames("truncate mt-2 text-center", activeStyles.name)}>{battery.name}</div>
</div>
)
}
Expand Down
8 changes: 4 additions & 4 deletions src/app/Marine2/components/ui/BatterySummary/Styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ import { BreakpointStylesType } from "../../../utils/media"
export const Styles: BreakpointStylesType = {
default: {
voltage: "hidden",
name: "text-base",
name: "text-base max-w-[20rem]",
state: "text-2xs",
},
"xs-xs": {
voltage: "text-sm",
batteryState: "text-xs",
name: "text-base",
name: "text-base max-w-[10rem]",
state: "text-xs",
},
"sm-s": {
voltage: "text-base",
batteryState: "text-sm",
name: "text-base",
name: "text-base max-w-[12rem]",
state: "text-sm",
},
"sm-m": {
voltage: "text-lg",
batteryState: "text-base",
name: "text-lg",
name: "text-lg max-w-[20rem]",
state: "text-base",
},
}

0 comments on commit b78fe4f

Please sign in to comment.