@hashicorp/hashi-alert-banner
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -83,6 +83,17 @@ 'use strict'; | ||
var classes = ['g-alert-banner']; | ||
// add theme class | ||
classes.push(theme ? theme : 'default'); | ||
// add has-large-tag class if needed | ||
if (tag.length > 3) classes.push('has-large-tag'); | ||
// add show class based on state | ||
if (this.state.show) classes.push('show'); | ||
return preact.h( | ||
'div', | ||
{ | ||
'class': 'g-alert-banner ' + (theme || '') + ' ' + (this.state.show ? 'show' : ''), | ||
'class': classes.join(' '), | ||
ref: function ref(banner) { | ||
@@ -89,0 +100,0 @@ return _this2.banner = banner; |
12
index.js
@@ -16,6 +16,16 @@ import { h, Component } from 'preact' | ||
const { url, tag, theme, text, link_text } = { ...this.props } | ||
const classes = ['g-alert-banner'] | ||
// add theme class | ||
classes.push(theme ? theme : 'default') | ||
// add has-large-tag class if needed | ||
if (tag.length > 3) classes.push('has-large-tag') | ||
// add show class based on state | ||
if (this.state.show) classes.push('show') | ||
return ( | ||
<div | ||
class={`g-alert-banner ${theme || ''} ${this.state.show ? 'show' : ''}`} | ||
class={classes.join(' ')} | ||
ref={banner => (this.banner = banner)} | ||
@@ -22,0 +32,0 @@ data-state={this.props._state} |
{ | ||
"name": "@hashicorp/hashi-alert-banner", | ||
"description": "alert banner with text and a link", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "dist", | ||
@@ -18,3 +18,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "568afed0a4e4a2b9006d2327f140f39a397ce045" | ||
"gitHead": "263ef7a79695418e81d65ac503bccdf046fd6ba3" | ||
} |
@@ -20,3 +20,3 @@ const props = {} | ||
value: 'consul', | ||
options: ['default', 'consul', 'terraform'] | ||
options: ['default', 'consul', 'nomad', 'terraform', 'vault'] | ||
}, | ||
@@ -23,0 +23,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
20376
693