File tree Expand file tree Collapse file tree 4 files changed +32
-29
lines changed Expand file tree Collapse file tree 4 files changed +32
-29
lines changed Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import styled from 'styled-components' ;
3- import { Component1 } from './Comp ' ;
3+ import { Component1 } from './Component1 ' ;
44
55const BodyStyle = styled . div `
6- height: 60px;
76 background: blue;
8- width: 100%;
9- display: flex;
10- position: absolute;
11- padding: 0 1rem;
12-
13- @media (max-width: 1140px) {
14- padding-right: 0px;
15- }
7+ padding: 20px;
168` ;
179
1810const Header = styled . h2 `
1911 color: yellow;
2012` ;
2113
22- class App extends React . Component < { } , { isMounted : boolean } > {
23- state = {
24- isMounted : false
25- }
26- componentDidMount ( ) {
27- this . setState ( { isMounted : true } )
28- }
14+ class App extends React . Component < { } > {
15+
2916 render ( ) {
3017 return (
3118 < div >
3219 < BodyStyle >
3320 < Header > Welcome to Typescript Styled Components SSR</ Header >
34- {
35- this . state . isMounted &&
36- < div > Test Mounted</ div >
37- }
3821 < Component1 />
3922 </ BodyStyle >
4023 </ div >
Original file line number Diff line number Diff line change @@ -2,14 +2,16 @@ import * as React from 'react';
22import styled from 'styled-components' ;
33
44const Component1Style = styled . div `
5- height: 40px;
6- background: green;
7- width: 200;
8- display: flex;
5+ background: #fff;
6+ text-align: center;
97` ;
108
9+ const TextStyle = styled . h3 `
10+ color: #000;
11+ font-weight: bold;
12+ ` ;
1113export const Component1 : React . SFC = ( ) => (
1214 < Component1Style >
13- Test
15+ < TextStyle > SubComponent </ TextStyle >
1416 </ Component1Style >
1517)
Original file line number Diff line number Diff line change 22 "name" : " typescript-plugin-styled-components" ,
33 "version" : " 0.0.6" ,
44 "description" : " TypeScript transformer for improving the debugging experience of styled-components" ,
5- "main" : " distor /index.js" ,
5+ "main" : " dist /index.js" ,
66 "homepage" : " https://github.com/Igorbek/typescript-plugin-styled-components" ,
77 "repository" : {
88 "url" : " https://github.com/Igorbek/typescript-plugin-styled-components.git" ,
Original file line number Diff line number Diff line change @@ -5,10 +5,28 @@ export interface Options {
55 * Default strategy is to use bindingName if it's defined and use inference algorithm from filename otherwise.
66 */
77 getDisplayName ( filename : string , bindingName : string | undefined ) : string | undefined ;
8-
8+
9+ /**
10+ * This array allow to identify the node name in case of style-components wrapper functions
11+ */
912 styledIdentifiers : string [ ] ;
10-
13+
14+ /**
15+ * If set to true generates a unique componentId composed by the file path and the component name (default bindingName)
16+ * default value: false
17+ */
1118 ssr : boolean ;
19+
20+ /**
21+ * If set to true sets the component dispaly name
22+ * default value: true
23+ */
1224 displayName : boolean ;
25+
26+
27+ /**
28+ * String to determine what is the project root
29+ * default value: package.json
30+ */
1331 rootCheck : string ;
1432}
You can’t perform that action at this time.
0 commit comments