Skip to content

Commit

Permalink
Add initial working code for library flex-banner
Browse files Browse the repository at this point in the history
Signed-off-by: isamrish <[email protected]>
  • Loading branch information
isamrish committed Jan 20, 2020
0 parents commit 9a1d578
Show file tree
Hide file tree
Showing 23 changed files with 19,074 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
*-error.log
example/node_modules/
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- 9
- 8
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# flex-banner

> Fully responsive react banner for websites
[![NPM](https://img.shields.io/npm/v/flex-banner.svg)](https://www.npmjs.com/package/flex-banner) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save flex-banner
```

## Usage

```tsx
import * as React from "react";

import BannerComponent from "flex-banner";

class Example extends React.Component {
render() {
return <BannerComponent />;
}
}
```

## License

MIT © [isamrish](https://github.com/isamrish)
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Example for flex-banner
20 changes: 20 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "flex-banner-example",
"homepage": "https://isamrish.github.io/flex-banner",
"version": "0.0.0",
"license": "MIT",
"private": true,
"dependencies": {
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts": "^1.1.4",
"flex-banner": "link:.."
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
20 changes: 20 additions & 0 deletions example/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">

<link rel="manifest" href="%PUBLIC_URL%/manifest.json">

<title>flex-banner</title>
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>

<div id="root"></div>
</body>
</html>
8 changes: 8 additions & 0 deletions example/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"short_name": "flex-banner",
"name": "flex-banner",
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
43 changes: 43 additions & 0 deletions example/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from "react";

import BannerComponent from "flex-banner";
const App = () => {
const config = {
title: "Title of banner",
link: {
title: "Google",
url: `https://google.com`
},
delayTimeToShowBanner: 1,
slidingTime: 1,
center: true, // Whether Align the main block items center or not
timeForCookie: false, // in days { default is false or number } = number represents days to keep
isCross: true,
wrapperStyle: {
backgroundColor: "blue",
paddingLeft: "24px",
paddingRight: "24px",
textAlign: "center"
},
mainStyle: {
color: "white",
textAlign: "center",
margin: "10px"
},
crossStyle: {
fontSize: "16px"
}
};
return (
<div>
<BannerComponent config={config} />
<div
style={{ height: "200px", padding: "30px", backgroundColor: "green" }}
>
<h2 style={{ margin: "0px" }}>This is dummy image!!!</h2>
</div>
</div>
);
};

export default App;
5 changes: 5 additions & 0 deletions example/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
7 changes: 7 additions & 0 deletions example/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom'

import './index.css'
import App from './App'

ReactDOM.render(<App />, document.getElementById('root'))
Loading

0 comments on commit 9a1d578

Please sign in to comment.