Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bpk-component-button

Package Overview
Dependencies
Maintainers
1
Versions
562
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpk-component-button - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

4

package.json
{
"name": "bpk-component-button",
"version": "0.0.6",
"version": "0.0.7",
"description": "Backpack button component.",

@@ -12,4 +12,4 @@ "main": "index.js",

"dependencies": {
"backpack": "git+http://git.prod.skyscanner.local/backpack/backpack.git#v0.0.1"
"backpack": "git+http://git.prod.skyscanner.local/backpack/backpack.git#v0.0.2"
}
}

@@ -14,2 +14,9 @@ jest.unmock('./BpkButton')

it('should render the correct element if an href is provided', () => {
const wrapper = shallow(<BpkButton href='#'>My button</BpkButton>)
expect(wrapper.children().length).toEqual(1)
expect(wrapper.name()).toEqual('a')
expect(wrapper.prop('href')).toEqual('#')
})
it('should render the correct class by default', () => {

@@ -16,0 +23,0 @@ const wrapper = shallow(<BpkButton>My button</BpkButton>)

import React, { PropTypes } from 'react'
import './bpk-button.scss'
const BpkButton = ({ secondary, selected, large, link, ...rest }) => {
const BpkButton = ({ href, submit, secondary, selected, large, link, ...rest }) => {
const classNames = [ 'bpk-button' ]

@@ -12,6 +12,14 @@

return <button type='button' className={classNames.join(' ')} {...rest} />
const className = classNames.join(' ')
if (href) {
return <a href={href} className={className} {...rest} />
}
return <button type={submit ? 'submit' : 'button'} className={className} {...rest} />
}
BpkButton.propTypes = {
href: PropTypes.string,
submit: PropTypes.bool,
secondary: PropTypes.bool,

@@ -24,2 +32,3 @@ selected: PropTypes.bool,

BpkButton.defaultProps = {
submit: false,
secondary: false,

@@ -26,0 +35,0 @@ selected: false,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc