Skip to content

Commit

Permalink
[Workplace Search] Migrate shared LicenseBadge component (#82372)
Browse files Browse the repository at this point in the history
* [Enterprise Search] Migrate shared LicenseBadge component

* Move files to Workplace Search dir

I mistakenly thought these were shared at the Enterprise Search level
  • Loading branch information
scottybollinger committed Nov 3, 2020
1 parent c974f56 commit 77f56a2
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export { LicenseBadge } from './license_badge';
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

.wsLicenseBadge {
&__text {
color: white;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { shallow } from 'enzyme';

import { EuiBadge } from '@elastic/eui';

import { LicenseBadge } from './';

describe('LicenseBadge', () => {
it('renders', () => {
const wrapper = shallow(<LicenseBadge />);

expect(wrapper.find(EuiBadge)).toHaveLength(1);
expect(wrapper.find('span').text()).toEqual('Platinum Feature');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';

import { EuiBadge } from '@elastic/eui';

import './license_badge.scss';

const licenseColor = '#00A7B1';

export const LicenseBadge: React.FC = () => (
<EuiBadge className="wsLicenseBadge" color={licenseColor}>
<span className="wsLicenseBadge__text">Platinum Feature</span>
</EuiBadge>
);

0 comments on commit 77f56a2

Please sign in to comment.