rework position prop

This commit is contained in:
Ben Phelps 2023-08-01 16:39:46 +03:00
parent b77909a360
commit cd2c24d47b
8 changed files with 17 additions and 19 deletions

View file

@ -57,7 +57,7 @@ export default function Component({ service }) {
/>
{systemData && !systemError && (
<Block position={{bottom: 3, left: 3}}>
<Block position="bottom-3 left-3">
{systemData.linux_distro && (
<div className="text-xs opacity-50">
{systemData.linux_distro}
@ -76,7 +76,7 @@ export default function Component({ service }) {
</Block>
)}
<Block position={{bottom: 3, right: 3}}>
<Block position="bottom-3 right-3">
<div className="text-xs font-bold opacity-75">
{t("common.number", {
value: data.total,

View file

@ -76,7 +76,7 @@ export default function Component({ service }) {
/>
{currentRate && !error && (
<Block position={{bottom: 3, left: 3}}>
<Block position="bottom-3 left-3">
<div className="text-xs opacity-50">
{t("common.bitrate", {
value: currentRate.a,
@ -90,7 +90,7 @@ export default function Component({ service }) {
</Block>
)}
<Block position={{bottom: 3, right: 3}}>
<Block position="bottom-3 right-3">
<div className="text-xs opacity-75">
{t("common.bitrate", {
value: currentRate.a + currentRate.b,

View file

@ -54,7 +54,7 @@ export default function Component({ service }) {
/>
{data && !error && (
<Block position={{bottom: 3, left: 3}}>
<Block position="bottom-3 left-3">
{data.free && (
<div className="text-xs opacity-50">
{t("common.bytes", {
@ -75,7 +75,7 @@ export default function Component({ service }) {
</Block>
)}
<Block position={{bottom: 3, right: 3}}>
<Block position="bottom-3 right-3">
<div className="text-xs font-bold opacity-75">
{t("common.bytes", {
value: data.used,

View file

@ -64,7 +64,7 @@ export default function Component({ service }) {
})}
/>
<Block position={{bottom: 3, left: 3}}>
<Block position="bottom-3 left-3">
{interfaceData && interfaceData.interface_name && (
<div className="text-xs opacity-50">
{interfaceData.interface_name}
@ -79,7 +79,7 @@ export default function Component({ service }) {
</div>
</Block>
<Block position={{bottom: 3, right: 3}}>
<Block position="bottom-3 right-3">
<div className="text-xs opacity-75">
{t("common.bitrate", {
value: interfaceData.rx,

View file

@ -36,7 +36,7 @@ export default function Component({ service }) {
return (
<Container>
<Block position={{top: 4, right: 3, left: 3}}>
<Block position="top-4 right-3 left-3">
<div className="flex items-center text-xs">
<div className="grow" />
<div className="w-14 text-right italic">{t("resources.cpu")}</div>
@ -44,7 +44,7 @@ export default function Component({ service }) {
</div>
</Block>
<Block position={{bottom: 4, right: 3, left: 3}}>
<Block position="bottom-4 right-3 left-3">
<div className="pointer-events-none text-theme-900 dark:text-theme-200">
{ data.map((item) => <div key={item.pid} className="text-[0.75rem] h-[0.8rem]">
<div className="flex items-center">

View file

@ -62,7 +62,7 @@ export default function Component({ service }) {
/>
{sensorData && !error && (
<Block position={{bottom: 3, left: 3}}>
<Block position="bottom-3 left-3">
{sensorData.warning && (
<div className="text-xs opacity-50">
{sensorData.warning}{sensorData.unit} {t("glances.warn")}
@ -76,7 +76,7 @@ export default function Component({ service }) {
</Block>
)}
<Block position={{bottom: 3, right: 3}}>
<Block position="bottom-3 right-3">
<div className="text-xs opacity-75">
{t("common.number", {
value: sensorData.value,