Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format code with standardjs and prettier #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
## react-svg-wrapper
> A react component for injecting a svg file (or string) into a DOM tree.

> A react component for injecting a svg file (or string) into a DOM tree.

#### demo
Check it out [here in sandbox 🔗](https://codesandbox.io/s/staging-brook-98ist?file=/src/App.js)

Check it out [here in sandbox 🔗](https://codesandbox.io/s/staging-brook-98ist?file=/src/App.js)

#### usage

props | description
--- | ---
`src` | **_required_**, svg file or string to be passed via this prop
`type` | _optional_, default value = `file`, if svg string has to be passed, we need to use `type='string'`
| props | description |
| ------ | -------------------------------------------------------------------------------------------------- |
| `src` | **_required_**, svg file or string to be passed via this prop |
| `type` | _optional_, default value = `file`, if svg string has to be passed, we need to use `type='string'` |

> Also, numerous vaild html, svg props can be passed to top-level too :), see example below for reference.


```jsx
import React from "react";
import SVGWrapper from "react-svg-wrapper";
Expand Down Expand Up @@ -44,11 +43,12 @@ export default MyComp;
```

#### motive & idea
* To make a zero-dependency and light-weight package ⚡ for injecting a svg into DOM tree.
* The problem was simple we wanted to use svg in our react apps directly and control it's behaviour based on some business logic.
* So, we thought of making a wrapper from ground-zero by using basic DFS and dom tree analysis.

- To make a zero-dependency and light-weight package ⚡ for injecting a svg into DOM tree.
- The problem was simple we wanted to use svg in our react apps directly and control it's behaviour based on some business logic.
- So, we thought of making a wrapper from ground-zero by using basic DFS and dom tree analysis.

#### in near future ...

- [ ] accepting svg's via hyperlinks
- [ ] reducing package size to 15Kb
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// babel.config.js
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: ["@babel/plugin-proposal-class-properties"],
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: ["@babel/plugin-proposal-class-properties"],
};
Loading