Skip to content

Commit 5c07648

Browse files
committed
add basic Star button component
1 parent 10598ec commit 5c07648

File tree

7 files changed

+34
-26
lines changed

7 files changed

+34
-26
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ dist
2020
npm-debug.log*
2121
yarn-debug.log*
2222
yarn-error.log*
23+
24+
# VS Code
25+
.vscode

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
language: node_js
22
node_js:
3+
- 'stable'
4+
- 11
5+
- 10
36
- 9
47
- 8
8+
install:
9+
- npm install
10+
script:
11+
# - npm run lint
12+
- npm test

example/src/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React, { Component } from 'react'
1+
import React, { Component } from 'react';
22

3-
import ExampleComponent from 'react-github-buttons'
3+
import { Star } from 'react-github-buttons';
44

55
export default class App extends Component {
66
render () {
77
return (
88
<div>
9-
<ExampleComponent text='Modern React component module' />
9+
<Star />
1010
</div>
1111
)
1212
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-github-buttons",
33
"version": "1.0.0",
4-
"description": "React Components for dynamic buttons for github repo&#x27;s start, fork etc.",
4+
"description": "React Components for dynamic buttons for github repo&#x27;s star, fork etc.",
55
"author": "vaibhavhrt",
66
"license": "MIT",
77
"repository": "vaibhavhrt/react-github-buttons",

src/index.tsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
/**
2-
* @class ExampleComponent
3-
*/
1+
import Star from "./star";
42

5-
import * as React from 'react'
6-
7-
import styles from './styles.css'
8-
9-
export type Props = { text: string }
10-
11-
export default class ExampleComponent extends React.Component<Props> {
12-
render() {
13-
const {
14-
text
15-
} = this.props
16-
17-
return (
18-
<div className={styles.test}>
19-
Example Component: {text}
20-
</div>
21-
)
22-
}
23-
}
3+
export { Star };

src/star.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @function Star
3+
*/
4+
import * as React from "react";
5+
6+
export default function Star(){
7+
return (
8+
<div>
9+
Github Star
10+
</div>
11+
);
12+
}

tslint.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"quotemark": [true, "double", "jsx-double"]
4+
}
5+
}

0 commit comments

Comments
 (0)