From 3ae4113043d6edc86d4dc3704afce242609c7e65 Mon Sep 17 00:00:00 2001 From: Ben Phelps Date: Sun, 25 Sep 2022 19:38:02 +0300 Subject: [PATCH] refactor docker stats open/close --- src/components/services/item.jsx | 109 ++++++++++++++++--------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/src/components/services/item.jsx b/src/components/services/item.jsx index 7eb111aac..93fa83ac3 100644 --- a/src/components/services/item.jsx +++ b/src/components/services/item.jsx @@ -1,6 +1,6 @@ import Image from "next/future/image"; -import { useContext } from "react"; -import { Disclosure } from "@headlessui/react"; +import classNames from "classnames"; +import { useContext, useState } from "react"; import Status from "./status"; import Widget from "./widget"; @@ -27,72 +27,75 @@ function resolveIcon(icon) { export default function Item({ service }) { const hasLink = service.href && service.href !== "#"; const { settings } = useContext(SettingsContext); + const [statsOpen, setStatsOpen] = useState(false); return (
  • - -
    -
    - {service.icon && - (hasLink ? ( - - logo - - ) : ( -
    - logo -
    - ))} - - {hasLink ? ( +
    +
    + {service.icon && + (hasLink ? ( -
    - {service.name} -

    {service.description}

    -
    + logo
    ) : ( -
    -
    - {service.name} -

    {service.description}

    -
    +
    + logo
    - )} + ))} - {service.container && ( - - - - )} -
    - - -
    - + {hasLink ? ( + +
    + {service.name} +

    {service.description}

    +
    +
    + ) : ( +
    +
    + {service.name} +

    {service.description}

    +
    - + )} + + {service.container && ( + + )} +
    - {service.widget && } +
    +
    - + + {service.widget && } +
  • ); }