forked from chanthasuon/lib-invoice-print
init create-react-library@3.1.1
This commit is contained in:
5
src/.eslintrc
Normal file
5
src/.eslintrc
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"env": {
|
||||
"jest": true
|
||||
}
|
||||
}
|
||||
7
src/index.test.tsx
Normal file
7
src/index.test.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ExampleComponent } from '.'
|
||||
|
||||
describe('ExampleComponent', () => {
|
||||
it('is truthy', () => {
|
||||
expect(ExampleComponent).toBeTruthy()
|
||||
})
|
||||
})
|
||||
10
src/index.tsx
Normal file
10
src/index.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react'
|
||||
import styles from './styles.module.css'
|
||||
|
||||
interface Props {
|
||||
text: string
|
||||
}
|
||||
|
||||
export const ExampleComponent = ({ text }: Props) => {
|
||||
return <div className={styles.test}>Example Component: {text}</div>
|
||||
}
|
||||
9
src/styles.module.css
Normal file
9
src/styles.module.css
Normal file
@@ -0,0 +1,9 @@
|
||||
/* add css module styles here (optional) */
|
||||
|
||||
.test {
|
||||
margin: 2em;
|
||||
padding: 0.5em;
|
||||
border: 2px solid #000;
|
||||
font-size: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
17
src/typings.d.ts
vendored
Normal file
17
src/typings.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Default CSS definition for typescript,
|
||||
* will be overridden with file-specific definitions by rollup
|
||||
*/
|
||||
declare module '*.css' {
|
||||
const content: { [className: string]: string };
|
||||
export default content;
|
||||
}
|
||||
|
||||
interface SvgrComponent extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {}
|
||||
|
||||
declare module '*.svg' {
|
||||
const svgUrl: string;
|
||||
const svgComponent: SvgrComponent;
|
||||
export default svgUrl;
|
||||
export { svgComponent as ReactComponent }
|
||||
}
|
||||
Reference in New Issue
Block a user