How to use the @grafana/ui.useTheme function in @grafana/ui

To help you get started, we’ve selected a few @grafana/ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github grafana / grafana / public / app / plugins / datasource / loki / configuration / DerivedFields.tsx View on Github external
export const DerivedFields = (props: Props) => {
  const { value, onChange } = props;
  const theme = useTheme();
  const styles = getStyles(theme);

  const [showDebug, setShowDebug] = useState(false);

  return (
    <>
      <h3>Derived fields</h3>

      <div>
        Derived fields can be used to extract new fields from the log message and create link from it's value.
      </div>

      <div>
        {value &amp;&amp;
          value.map((field, index) =&gt; {
            return (</div>
github grafana / grafana / public / app / features / admin / ActionButton.tsx View on Github external
export const ActionButton: FC = (props: Props) =&gt; {
  const { onClick, text, className } = props;
  const theme = useTheme();
  const styles = getStyles(theme);
  const buttonClassName = cx(styles.button);

  return (
    <span>
      <a type="button">
        {text}
      </a>
    </span>
  );
};
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / explore / LiveTailButton.tsx View on Github external
export function LiveTailButton(props: LiveTailButtonProps) {
  const { start, pause, resume, isLive, isPaused, stop, splitted } = props;
  const theme = useTheme();
  const styles = getStyles(theme);

  const onClickMain = isLive ? (isPaused ? resume : pause) : start;

  return (
    &lt;&gt;
github grafana / grafana / public / app / features / explore / LiveTailButton.tsx View on Github external
export function LiveTailButton(props: LiveTailButtonProps) {
  const { start, pause, resume, isLive, isPaused, stop, splitted } = props;
  const theme = useTheme();
  const styles = getStyles(theme);

  const onClickMain = isLive ? (isPaused ? resume : pause) : start;

  return (
    &lt;&gt;
github grafana / grafana / public / app / features / explore / TimeSyncButton.tsx View on Github external
export function TimeSyncButton(props: TimeSyncButtonProps) {
  const { onClick, isSynced } = props;
  const theme = useTheme();
  const styles = getStyles(theme);

  const syncTimesTooltip = () =&gt; {
    const { isSynced } = props;
    const tooltip = isSynced ? 'Unsync all views' : 'Sync all views to this time range';
    return &lt;&gt;{tooltip};
  };

  return (
    
      <button aria-label="{isSynced"> onClick()}</button>