react-support-ukraine-banner 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,24 +28,20 @@ yarn add react-support-ukraine-banner
28
28
 
29
29
  ## Usage
30
30
 
31
- Because this component is based on [React](https://reactjs.org/), you can use it in any React project. But to make it compatible with Next.js CSS needs to be imported separately.
32
-
33
31
  ```jsx
34
32
  import React from 'react';
35
33
  import SupportUkraineBanner from 'react-support-ukraine-banner';
36
- import 'react-support-ukraine-banner/dist/SupportUkraineBanner.css';
37
34
 
38
35
  const App = () => (
39
36
  <div>
40
- {/* ... other components */}
41
37
  <SupportUkraineBanner />
42
- {/* ... or other components */}
38
+ {/* Your application content goes here */}
43
39
  </div>
44
40
  );
45
41
 
46
42
  export default App;
47
43
  ```
48
-
44
+ Note: Since version 1.1.0, the component is now written in TypeScript and no longer requires importing CSS files separately.
49
45
 
50
46
  ## Customization
51
47
 
@@ -6,25 +6,50 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
- //import './SupportUkraineBanner.css';
10
-
11
9
  var SupportUkraineBanner = function SupportUkraineBanner() {
12
10
  return /*#__PURE__*/_react["default"].createElement("a", {
13
- className: "support-ukraine",
14
11
  href: "https://u24.gov.ua",
15
12
  target: "_blank",
16
13
  rel: "noopener noreferrer",
17
- title: "Donate to support freedom."
14
+ title: "Donate to support freedom.",
15
+ style: {
16
+ position: 'absolute',
17
+ left: 0,
18
+ top: 0,
19
+ right: 0,
20
+ background: '#000',
21
+ display: 'flex',
22
+ justifyContent: 'center',
23
+ padding: '0px 5px',
24
+ zIndex: 10000,
25
+ textDecoration: 'none',
26
+ fontFamily: 'arial'
27
+ }
18
28
  }, /*#__PURE__*/_react["default"].createElement("div", {
19
- className: "support-ukraine__flag",
20
29
  role: "img",
21
- "aria-label": "Flag of Ukraine"
30
+ "aria-label": "Flag of Ukraine",
31
+ style: {
32
+ height: '25px',
33
+ marginRight: '10px'
34
+ }
22
35
  }, /*#__PURE__*/_react["default"].createElement("div", {
23
- className: "support-ukraine__flag__blue"
36
+ style: {
37
+ width: '40px',
38
+ height: '12.5px',
39
+ background: '#005BBB'
40
+ }
24
41
  }), /*#__PURE__*/_react["default"].createElement("div", {
25
- className: "support-ukraine__flag__yellow"
42
+ style: {
43
+ width: '40px',
44
+ height: '12.5px',
45
+ background: '#FFD500'
46
+ }
26
47
  })), /*#__PURE__*/_react["default"].createElement("div", {
27
- className: "support-ukraine__label"
48
+ style: {
49
+ color: 'white',
50
+ fontSize: '12px',
51
+ lineHeight: '25px'
52
+ }
28
53
  }, "Donate to support freedom."));
29
54
  };
30
55
  var _default = exports["default"] = SupportUkraineBanner;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "react-support-ukraine-banner",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "description": "React component to show support for Ukraine with u24.gov.ua link on the top of the page.",
5
- "main": "dist/SupportUkraineBanner.js",
5
+ "main": "dist/SupportUkraineBanner.ts",
6
6
  "scripts": {
7
- "build": "babel src --out-dir dist --copy-files",
7
+ "build": "babel src --extensions '.ts,.tsx' --out-dir dist --copy-files",
8
8
  "prepublishOnly": "npm run build"
9
9
  },
10
10
  "repository": {
@@ -32,9 +32,12 @@
32
32
  "@babel/cli": "^7.23.0",
33
33
  "@babel/core": "^7.23.3",
34
34
  "@babel/preset-env": "^7.23.3",
35
- "@babel/preset-react": "^7.23.3"
35
+ "@babel/preset-react": "^7.23.3",
36
+ "@types/react": "^18.2.65",
37
+ "@types/react-dom": "^18.2.22",
38
+ "typescript": "^5.4.2"
36
39
  },
37
40
  "engines": {
38
41
  "node": ">=10.0.0"
39
42
  }
40
- }
43
+ }
@@ -1,47 +0,0 @@
1
- body {
2
- margin-top: 35px;
3
- }
4
-
5
- .support-ukraine,
6
- .support-ukraine:visited {
7
- position: absolute;
8
- left: 0;
9
- top: 0;
10
- right: 0;
11
- background: rgb(0, 0, 0);
12
- display: flex;
13
- justify-content: center;
14
- padding-top: 5px;
15
- padding-bottom: 5px;
16
- z-index: 10000;
17
- text-decoration: none;
18
- font-family: arial;
19
- }
20
-
21
- .support-ukraine:hover,
22
- .support-ukraine:active {
23
- background: rgb(80, 80, 80);
24
- }
25
-
26
- .support-ukraine__flag {
27
- height: 25px;
28
- margin-right: 10px;
29
- }
30
-
31
- .support-ukraine__flag__blue {
32
- width: 40px;
33
- height: 12.5px;
34
- background: #005BBB;
35
- }
36
-
37
- .support-ukraine__flag__yellow {
38
- width: 40px;
39
- height: 12.5px;
40
- background: #FFD500;
41
- }
42
-
43
- .support-ukraine__label {
44
- color: white;
45
- font-size: 12px;
46
- line-height: 25px;
47
- }