@uiw/react-shields
Advanced tools
Comparing version 1.3.2 to 1.3.3
import React, { Component } from 'react'; | ||
export interface BaseProps { | ||
import type { AnchorHTMLAttributes, ImgHTMLAttributes } from 'react'; | ||
export interface BaseProps extends ImgHTMLAttributes<HTMLImageElement> { | ||
platform?: 'github' | 'coveralls' | 'npm'; | ||
@@ -10,2 +11,3 @@ type?: string; | ||
children?: React.ReactNode; | ||
anchor?: Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>; | ||
} | ||
@@ -12,0 +14,0 @@ export interface BaseState extends BaseProps { |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"]; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,2 +9,3 @@ value: true | ||
exports["default"] = void 0; | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
@@ -19,2 +20,3 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["href", "anchor"]; | ||
var Base = /*#__PURE__*/function (_Component) { | ||
@@ -43,16 +45,19 @@ (0, _inherits2["default"])(Base, _Component); | ||
value: function render() { | ||
var href = this.state.href; | ||
var _this$state = this.state, | ||
href = _this$state.href, | ||
anchor = _this$state.anchor, | ||
other = (0, _objectWithoutProperties2["default"])(_this$state, _excluded); | ||
if (href) { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)("a", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, anchor), {}, { | ||
href: href, | ||
children: [' ', /*#__PURE__*/(0, _jsxRuntime.jsx)("img", { | ||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", (0, _objectSpread2["default"])({ | ||
alt: "", | ||
src: this.getUrl() | ||
}), ' '] | ||
}); | ||
}, other)) | ||
})); | ||
} | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", (0, _objectSpread2["default"])({ | ||
alt: "", | ||
src: this.getUrl() | ||
}); | ||
}, other)); | ||
} | ||
@@ -59,0 +64,0 @@ }]); |
import React, { Component } from 'react'; | ||
export interface BaseProps { | ||
import type { AnchorHTMLAttributes, ImgHTMLAttributes } from 'react'; | ||
export interface BaseProps extends ImgHTMLAttributes<HTMLImageElement> { | ||
platform?: 'github' | 'coveralls' | 'npm'; | ||
@@ -10,2 +11,3 @@ type?: string; | ||
children?: React.ReactNode; | ||
anchor?: Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>; | ||
} | ||
@@ -12,0 +14,0 @@ export interface BaseState extends BaseProps { |
@@ -0,5 +1,6 @@ | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
var _excluded = ["href", "anchor"]; | ||
import React, { Component } from 'react'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
export default class Base extends Component { | ||
@@ -17,18 +18,21 @@ constructor(props, defaultState, forceState) { | ||
render() { | ||
var { | ||
href | ||
} = this.state; | ||
var _this$state = this.state, | ||
{ | ||
href, | ||
anchor | ||
} = _this$state, | ||
other = _objectWithoutPropertiesLoose(_this$state, _excluded); | ||
if (href) { | ||
return /*#__PURE__*/_jsxs("a", { | ||
return /*#__PURE__*/_jsx("a", _extends({}, anchor, { | ||
href: href, | ||
children: [' ', /*#__PURE__*/_jsx("img", { | ||
children: /*#__PURE__*/_jsx("img", _extends({ | ||
alt: "", | ||
src: this.getUrl() | ||
}), ' '] | ||
}); | ||
}, other)) | ||
})); | ||
} | ||
return /*#__PURE__*/_jsx("img", { | ||
return /*#__PURE__*/_jsx("img", _extends({ | ||
alt: "", | ||
src: this.getUrl() | ||
}); | ||
}, other)); | ||
} | ||
@@ -35,0 +39,0 @@ } |
{ | ||
"name": "@uiw/react-shields", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Shields.io for react component, Quality metadata badges for open source projects.", | ||
@@ -5,0 +5,0 @@ "author": "Kenny Wong <wowohoo@qq.com>", |
@@ -88,3 +88,3 @@ react-shields | ||
<> | ||
<Npm.Version scope="@uiw" packageName="react-shields" /> | ||
<Npm.Version scope="@uiw" packageName="react-shields" href="https://npmjs.com/@uiw/react-shields" /> | ||
<Npm> | ||
@@ -116,3 +116,3 @@ <Npm.Version scope="@uiw" packageName="react-github-corners" /> | ||
<> | ||
<Npm.Size scope="@uiw" packageName="react-shields" /> | ||
<Npm.Size scope="@uiw" packageName="react-shields" href="https://npmjs.com/@uiw/react-shields" /> | ||
<Npm> | ||
@@ -156,3 +156,3 @@ <Npm.Size format="minzip" scope="@uiw" packageName="react-github-corners" /> | ||
<> | ||
<Npm.Downloads scope="@uiw" packageName="react-shields" /> | ||
<Npm.Downloads scope="@uiw" packageName="react-shields" href="https://npmjs.com/@uiw/react-shields" /> | ||
<Npm> | ||
@@ -176,5 +176,5 @@ <Npm.Downloads interval="dw" scope="@uiw" packageName="react-github-corners" /> | ||
<> | ||
<Github.Issues user="uiwjs" repo="uiw" /> | ||
<Github.Issues user="uiwjs" repo="uiw" href="https://github.com/uiwjs/react-shields/issues" /> | ||
<Github user="uiwjs" repo="uiw"> | ||
<Github.Issues type="issues" /> | ||
<Github.Issues type="issues" href="https://github.com/uiwjs/react-shields/issues" /> | ||
<Github.Issues type="issues-raw" /> | ||
@@ -226,3 +226,3 @@ <Github.Issues type="issues-closed" /> | ||
<> | ||
<Github.Downloads user="uiwjs" repo="uiw" /> | ||
<Github.Downloads user="uiwjs" repo="uiw" href="https://github.com/uiwjs/uiw/issues" /> | ||
<Github user="uiwjs" repo="uiw"> | ||
@@ -249,5 +249,5 @@ <Github.Downloads /> | ||
<> | ||
<Github.Version user="uiwjs" repo="uiw" /> | ||
<Github.Version user="uiwjs" repo="uiw" href="https://github.com/uiwjs/uiw/issues" /> | ||
<Github user="uiwjs" repo="uiw"> | ||
<Github.Version type="version-tag" /> | ||
<Github.Version type="version-tag" href="https://github.com/uiwjs/uiw/issues" /> | ||
<Github.Version type="package-json" /> | ||
@@ -274,3 +274,3 @@ <Github.Version type="package-json" branch="dev" /> | ||
<> | ||
<Github.License user="uiwjs" repo="uiw" /> | ||
<Github.License user="uiwjs" repo="uiw" href="https://github.com/uiwjs/uiw/blob/master/LICENSE" /> | ||
<Github user="uiwjs" repo="uiw"> | ||
@@ -293,3 +293,3 @@ <Github.License /> | ||
<> | ||
<Github.Analysis user="uiwjs" repo="uiw" /> | ||
<Github.Analysis user="uiwjs" repo="uiw" href="https://github.com/uiwjs/uiw/issues" /> | ||
<Github user="uiwjs" repo="uiw"> | ||
@@ -313,3 +313,3 @@ <Github.Analysis type="languages-top" /> | ||
<> | ||
<Coverage.Coverages user="jaywcjlove" repo="hotkeys" /> | ||
<Coverage.Coverages user="jaywcjlove" repo="hotkeys" href="https://github.com/uiwjs/uiw/issues" /> | ||
<Coverage user="jaywcjlove" repo="hotkeys"> | ||
@@ -333,3 +333,3 @@ <Coverage.Coverages type="github" /> | ||
<> | ||
<Coverage.Codacy projectId="1c524e61cd8640e79b80d406eda8754b" /> | ||
<Coverage.Codacy projectId="1c524e61cd8640e79b80d406eda8754b" href="https://github.com/uiwjs/uiw/issues" /> | ||
<Coverage user="jaywcjlove" repo="hotkeys"> | ||
@@ -336,0 +336,0 @@ <Coverage.Codacy projectId="1c524e61cd8640e79b80d406eda8754b" branch="master" /> |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133543
3385