visuddhinanda 2 ani în urmă
părinte
comite
a143d4b6a6

+ 11 - 8
dashboard/src/components/auth/Avatar.tsx

@@ -20,8 +20,9 @@ const { Title } = Typography;
 
 
 interface IWidget {
 interface IWidget {
   placement?: TooltipPlacement;
   placement?: TooltipPlacement;
+  style?: React.CSSProperties;
 }
 }
-const AvatarWidget = ({ placement = "bottomRight" }: IWidget) => {
+const AvatarWidget = ({ style, placement = "bottomRight" }: IWidget) => {
   const intl = useIntl();
   const intl = useIntl();
   const navigate = useNavigate();
   const navigate = useNavigate();
   const [userName, setUserName] = useState<string>();
   const [userName, setUserName] = useState<string>();
@@ -82,13 +83,15 @@ const AvatarWidget = ({ placement = "bottomRight" }: IWidget) => {
   return (
   return (
     <>
     <>
       <Popover content={user ? userCard : login} placement={placement}>
       <Popover content={user ? userCard : login} placement={placement}>
-        <Avatar
-          style={{ backgroundColor: user ? "#87d068" : "gray" }}
-          icon={<UserOutlined />}
-          size="small"
-        >
-          {user ? nickName?.slice(0, 1) : undefined}
-        </Avatar>
+        <span style={style}>
+          <Avatar
+            style={{ backgroundColor: user ? "#87d068" : "gray" }}
+            icon={<UserOutlined />}
+            size="small"
+          >
+            {user ? nickName?.slice(0, 1) : undefined}
+          </Avatar>
+        </span>
       </Popover>
       </Popover>
     </>
     </>
   );
   );

+ 20 - 15
dashboard/src/components/auth/ToStudio.tsx

@@ -5,27 +5,32 @@ import { Link } from "react-router-dom";
 import { useAppSelector } from "../../hooks";
 import { useAppSelector } from "../../hooks";
 import { currentUser as _currentUser } from "../../reducers/current-user";
 import { currentUser as _currentUser } from "../../reducers/current-user";
 
 
-const ToStudioWidget = () => {
+interface IWidget {
+  style?: React.CSSProperties;
+}
+const ToStudioWidget = ({ style }: IWidget) => {
   const intl = useIntl();
   const intl = useIntl();
 
 
   const user = useAppSelector(_currentUser);
   const user = useAppSelector(_currentUser);
 
 
   if (typeof user !== "undefined") {
   if (typeof user !== "undefined") {
     return (
     return (
-      <Button
-        type="primary"
-        style={{
-          paddingLeft: 18,
-          paddingRight: 18,
-          backgroundColor: "#52974e",
-        }}
-      >
-        <Link to={`/studio/${user.realName}/home`} target="_blank">
-          {intl.formatMessage({
-            id: "columns.studio.title",
-          })}
-        </Link>
-      </Button>
+      <span style={style}>
+        <Button
+          type="primary"
+          style={{
+            paddingLeft: 18,
+            paddingRight: 18,
+            backgroundColor: "#52974e",
+          }}
+        >
+          <Link to={`/studio/${user.realName}/home`} target="_blank">
+            {intl.formatMessage({
+              id: "columns.studio.title",
+            })}
+          </Link>
+        </Button>
+      </span>
     );
     );
   } else {
   } else {
     return <></>;
     return <></>;

+ 5 - 2
dashboard/src/components/general/SearchButton.tsx

@@ -2,9 +2,12 @@ import { Button } from "antd";
 import { Link } from "react-router-dom";
 import { Link } from "react-router-dom";
 import { SearchOutlined } from "@ant-design/icons";
 import { SearchOutlined } from "@ant-design/icons";
 
 
-const SearchButtonWidget = () => {
+interface IWidget {
+  style?: React.CSSProperties;
+}
+const SearchButtonWidget = ({ style }: IWidget) => {
   return (
   return (
-    <Button type="text" size="small">
+    <Button type="text" size="small" style={style}>
       <Link to="/search/home" target={"_blank"}>
       <Link to="/search/home" target={"_blank"}>
         <SearchOutlined style={{ color: "white" }} />
         <SearchOutlined style={{ color: "white" }} />
       </Link>
       </Link>