From b261643a8f425aea48152d609c8faddff9eed5f4 Mon Sep 17 00:00:00 2001 From: Ryan Laurie <30528226+iethree@users.noreply.github.com> Date: Mon, 21 Oct 2024 07:54:44 -0600 Subject: [PATCH] Make metabot centered again (#48912) --- .../components/HomeGreeting/HomeGreeting.tsx | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/frontend/src/metabase/home/components/HomeGreeting/HomeGreeting.tsx b/frontend/src/metabase/home/components/HomeGreeting/HomeGreeting.tsx index d30964bed19..dfb4fc83eb0 100644 --- a/frontend/src/metabase/home/components/HomeGreeting/HomeGreeting.tsx +++ b/frontend/src/metabase/home/components/HomeGreeting/HomeGreeting.tsx @@ -2,11 +2,10 @@ import { useEffect, useMemo, useState } from "react"; import { t } from "ttag"; import _ from "underscore"; -import Tooltip from "metabase/core/components/Tooltip"; import styles from "metabase/css/core/animation.module.css"; import { useSelector } from "metabase/lib/redux"; import { getUser } from "metabase/selectors/user"; -import { Box } from "metabase/ui"; +import { Box, Tooltip } from "metabase/ui"; import { getHasMetabotLogo } from "../../selectors"; @@ -24,14 +23,7 @@ export const HomeGreeting = (): JSX.Element => { return ( <GreetingRoot> - {showLogo && ( - <Tooltip - tooltip={t`Don't tell anyone, but you're my favorite.`} - placement="bottom" - > - <MetabotGreeting /> - </Tooltip> - )} + {showLogo && <MetabotGreeting />} <GreetingMessage data-testid="greeting-message" showLogo={showLogo}> {message} </GreetingMessage> @@ -87,25 +79,30 @@ const MetabotGreeting = () => { }, [buffer]); return ( - <Box - style={{ - position: "relative", - width: "62px", - height: "40px", - marginInlineEnd: "0.5rem", - }} + <Tooltip + label={t`Don't tell anyone, but you're my favorite.`} + position="bottom" > - <GreetingLogo - isCool={isCool} - className={`${styles.SpinOut} ${isCooling ? styles.SpinOutActive : ""}`} - variant="cool" - /> - <GreetingLogo - isCool={!isCool} - className={`${styles.SpinOut} ${isCooling ? styles.SpinOutActive : ""}`} - variant="happy" - /> - </Box> + <Box + style={{ + position: "relative", + width: "54px", + height: "40px", + marginInlineEnd: "0.5rem", + }} + > + <GreetingLogo + isCool={isCool} + className={`${styles.SpinOut} ${isCooling ? styles.SpinOutActive : ""}`} + variant="cool" + /> + <GreetingLogo + isCool={!isCool} + className={`${styles.SpinOut} ${isCooling ? styles.SpinOutActive : ""}`} + variant="happy" + /> + </Box> + </Tooltip> ); }; -- GitLab