Sfoglia il codice sorgente

Plugins: update beta notice style (#16928)

Ryan McKinley 6 anni fa
parent
commit
b08cf1e7ac
1 ha cambiato i file con 16 aggiunte e 4 eliminazioni
  1. 16 4
      public/app/features/plugins/PluginStateInfo.tsx

+ 16 - 4
public/app/features/plugins/PluginStateInfo.tsx

@@ -1,18 +1,29 @@
 import React, { FC, useContext } from 'react';
 import React, { FC, useContext } from 'react';
 import { css } from 'emotion';
 import { css } from 'emotion';
 import { PluginState, Tooltip, ThemeContext } from '@grafana/ui';
 import { PluginState, Tooltip, ThemeContext } from '@grafana/ui';
+import { PopperContent } from '@grafana/ui/src/components/Tooltip/PopperController';
 
 
 interface Props {
 interface Props {
   state?: PluginState;
   state?: PluginState;
 }
 }
 
 
-function getPluginStateInfoText(state?: PluginState): string | null {
+function getPluginStateInfoText(state?: PluginState): PopperContent<any> | null {
   switch (state) {
   switch (state) {
     case PluginState.alpha:
     case PluginState.alpha:
-      return 'Plugin in alpha state. Means work in progress and updates may include breaking changes.';
+      return (
+        <div>
+          <h5>Alpha Plugin</h5>
+          <p>This plugin is a work in progress and updates may include breaking changes.</p>
+        </div>
+      );
 
 
     case PluginState.beta:
     case PluginState.beta:
-      return 'Plugin in beta state. Means there could be bugs and minor breaking changes.';
+      return (
+        <div>
+          <h5>Beta Plugin</h5>
+          <p>There could be bugs and minor breaking changes to this plugin.</p>
+        </div>
+      );
   }
   }
   return null;
   return null;
 }
 }
@@ -34,10 +45,11 @@ const PluginStateinfo: FC<Props> = props => {
     font-size: 13px;
     font-size: 13px;
     padding: 4px 8px;
     padding: 4px 8px;
     margin-left: 16px;
     margin-left: 16px;
+    cursor: help;
   `;
   `;
 
 
   return (
   return (
-    <Tooltip content={text}>
+    <Tooltip content={text} theme={'info'} placement={'top'}>
       <div className={styles}>
       <div className={styles}>
         <i className="fa fa-warning" /> {props.state}
         <i className="fa fa-warning" /> {props.state}
       </div>
       </div>