Skip to content

Commit

Permalink
Merge pull request #39 from cinaaaa/refactor/new
Browse files Browse the repository at this point in the history
Refactor/new
  • Loading branch information
cinaaaa committed Mar 31, 2023
2 parents 8008faf + 78b77c3 commit 563952f
Show file tree
Hide file tree
Showing 45 changed files with 12,671 additions and 12,966 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

22 changes: 0 additions & 22 deletions .circleci/config.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"standard-with-typescript"
],
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ dist

# TernJS port file
.tern-port
packages/my-site/src/App.tsx
.DS_Store
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# npm run lint
# yarn lint-staged
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Thanks for your interest in React Tagify. We welcome all forms of contribution -

## Team members

Elemental is built by [@E-RROR](https://github.com/E-RROR)
Elemental is built by [@cinaaaa](https://github.com/cinaaaa)

# Bug triage

This sections explains how bug triaging is done for your project. Help beginners by including examples to good bug reports and providing them questions they should look to answer.

* You can help report bugs by filing them here: [Issue Tracker](https://github.com/E-RROR/react-tagify/issues)
* You can look through the existing bugs here: [Bugs](https://github.com/E-RROR/react-tagify/labels/bug).
* You can help report bugs by filing them here: [Issue Tracker](https://github.com/cinaaaa/react-tagify/issues)
* You can look through the existing bugs here: [Bugs](https://github.com/cinaaaa/react-tagify/labels/bug).

* You can help us diagnose and fix existing bugs by asking and providing answers for the following:

Expand Down
160 changes: 60 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1,72 @@
# React Tagify
📛 React Component For Extracting Hashtags, Mentions, Links In Your React App
![React Tagify Promo Tweet](https://github.com/cinaaaa/react-tagify/blob/refactor/new/packages/site/src/assets/promo-tweet.png)
# React Tagify #️@🔥
Empower your React applications with effortless #tag and @mention support ❤️
<br />
<br />
<img src="https://img.shields.io/github/package-json/v/E-RROR/react-tagify/master?color=green&label=Version&style=flat-square"/>
<span>
<img src="https://img.shields.io/npm/v/react-tagify?color=red&style=flat-square" />
</span>
<span>
<img src="https://img.shields.io/codefactor/grade/github/E-RROR/react-tagify?style=flat-square" />
</span>

### Install
```
$ yarn add react-tagify
```
or
```
$ npm i react-tagify
```
### Usage
```jsx
import React from "react";
import ReactDOM from "react-dom";
import { ReactTagify } from "react-tagify";

function App() {
return (
<div>
<ReactTagify
colors={"red"}
tagClicked={(tag)=> alert(tag)}>
<p>
“You might not think that #programmers are #artists,
but programming is an extremely creative #profession.
Its logic-based creativity”
@JohnRomero
</p>
</ReactTagify>
</div>
);
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
```
<img src="https://img.shields.io/github/package-json/v/cinaaaa/react-tagify/master?color=green&label=Version&style=flat-square"/>

### Demo
React Tagify is a powerful and pure React component for handling hashtags and mentions in your React app with ease. Give your users the ability to mention others and add tags to their content seamlessly.

![oie_3162851d5gaPaFm](https://user-images.githubusercontent.com/25178257/71611319-e0e2e180-2bbd-11ea-8cc5-e9e2c2b91a7f.gif)
For more information and demo, visit our website [here](https://cinaaaa.github.io/react-tagify/).

![oie_3163031dwZ6pVBw](https://user-images.githubusercontent.com/25178257/71611320-e0e2e180-2bbd-11ea-9c73-5fd21359a393.gif)
## Features

![oie_3162943PEBY6ic9](https://user-images.githubusercontent.com/25178257/71611321-e0e2e180-2bbd-11ea-8822-9e6d63a5779c.gif)
- 🚀 Easy to integrate
- 🎨 Customizable colors and styles
- 🔗 Supports #HashTags and @Mentions
- 📦 Lightweight

![oie_31641480Ic8MPad](https://user-images.githubusercontent.com/25178257/71611397-70889000-2bbe-11ea-863e-3ac79b8342ec.gif)
## Installation

Install the package using npm or yarn:

### Use custom styling
Provide custom styling to tags and mentions
```bash
npm i react-tagify
```

or

```bash
yarn add react-tagify
```
## Usage

1. Import the Tagify component:

```js
import { Tagify } from 'react-tagify';
```

2. Wrap your content with the Tagify component:

```jsx
import React from "react";
import ReactDOM from "react-dom";
import { ReactTagify } from "react-tagify";

function App() {
const tagStyle = {
color: 'red',
fontWeight: 500,
cursor: 'pointer'
};

const mentionStyle = {
color: 'green',
textDecoration: 'underline',
cursor: 'pointer'
}

return (
<div>
<ReactTagify
tagStyle={tagStyle}
mentionStyle={mentionStyle}
tagClicked={(tag) => alert(tag)}
>
<p>
“You might not think that #programmers are #artists,
but programming is an extremely creative #profession.
Its logic-based creativity”
@JohnRomero
</p>
</ReactTagify>
</div>
);
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
<Tagify
onClick={(type, value) => console.log(type, value)}
tagStyle={{ fontWeight: 'bold' }}
mentionStyle={{ fontStyle: 'italic' }}
detectHashtags
detectMentions
>
<p>
This is an example of a #hashtag and a @mention inside a Tagify component.
</p>
</ReactTagify>
```

### Props/Options

| Name | Type| Default | Description |
| --- | --- | --- | --- |
| tagClicked | PropTypes.func | null | Trigger a function and Its Return You The Tag Clicked |
| colors | PropTypes.string | '#0073e6' (Navy Blue) | Custom Color on Tags |
| tagStyle | PropTypes.object | undefined | Custom style for tags |
| linkStyle | PropTypes.object | undefined | Custom style for links |
| mentionStyle | PropTypes.object | undefined | Custom style for mentions |
| detectHashtags | PropTypes.bool | true | detecting Hashtags enabled |
| detectMentions | PropTypes.bool | true | detecting Mentions enabled |
## Props

| Prop | Type | Default | Description |
|----------------|----------|---------|-------------------------------------------------------------------|
| children | ReactNode | - | The content to be processed for tags and mentions. |
| colors | string | '#0073e6' | The color of the tags and mentions. |
| onClick | function | - | A callback function that is called when a tag or mention is clicked. Receives the clicked element as an argument. |
| tagStyle | object | - | The CSS style object for hashtag styling. |
| mentionStyle | object | - | The CSS style object for mention styling. |
| detectHashtags | boolean | true | Enable or disable the detection of hashtags. |
| detectMentions | boolean | true | Enable or disable the detection of mentions. |


## Contributing
Please feel free to contribute by submitting a pull request or reporting any issues you encounter while using this component.

## License
React Tagify is licensed under the MIT License.
2 changes: 0 additions & 2 deletions lib/ReactTagify.js

This file was deleted.

14 changes: 0 additions & 14 deletions lib/ReactTagify.js.LICENSE.txt

This file was deleted.

12 changes: 0 additions & 12 deletions lib/module.d.ts

This file was deleted.

Loading

0 comments on commit 563952f

Please sign in to comment.