Skip to content

Commit

Permalink
feat: add content generator
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertAZ1992 committed Aug 2, 2020
1 parent 6c2b11a commit 491dfbf
Show file tree
Hide file tree
Showing 8 changed files with 1,201 additions and 212 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
],
'react/jsx-props-no-spreading': OFF,
'func-names': OFF,
'lines-between-class-members': OFF,
'max-classes-per-file': OFF,
Expand All @@ -73,7 +74,20 @@ module.exports = {
'no-unused-expressions': OFF,
'no-useless-constructor': OFF,
'no-empty-function': OFF,
'unicorn/no-null': OFF,
'unicorn/prevent-abbreviations': OFF,
'unicorn/no-process-exit': OFF,
'unicorn/filename-case': [
ERROR,
{
cases: {
kebabCase: false,
camelCase: true,
snakeCase: false,
pascalCase: true,
},
},
],
'@typescript-eslint/no-empty-function': OFF,
'@typescript-eslint/no-useless-constructor': ERROR,
},
Expand Down
11 changes: 11 additions & 0 deletions example/ClampText.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
export interface ClampTextProps {
autoresize?: boolean;
maxLines: number;
maxHeight: number | string;
ellipsis?: string;
expanded?: boolean;
content: string;
}
declare const ClampText: React.FC<ClampTextProps>;
export default ClampText;
13 changes: 13 additions & 0 deletions example/clamp.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
export interface ReactSimpleClampProps<T> {
autoresize?: boolean;
maxLines: number;
maxHeight: number | string;
ellipsis?: string;
expanded?: boolean;
content: T;
renderContent: () => React.ReactElement;
renderClampedContent: (offset: number, ellipsis: string) => React.ReactElement;
}
declare const ReactSimpleClamp: React.FC<ReactSimpleClampProps<string | Array<string>>>;
export default ReactSimpleClamp;
13 changes: 2 additions & 11 deletions example/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
import React from 'react';
export interface ReactSimpleClampProps {
autoresize?: boolean;
maxLines: number;
maxHeight: number | string;
ellipsis?: string;
expanded: boolean;
content: string;
}
declare const ReactSimpleClamp: React.FC<ReactSimpleClampProps>;
export default ReactSimpleClamp;
import ClampText from './ClampText';
export default ClampText;
Loading

0 comments on commit 491dfbf

Please sign in to comment.