Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ik_invoicing
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_frontend
ik_invoicing
Commits
428f0ce1
Commit
428f0ce1
authored
Jan 11, 2017
by
小明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构 components 下 TextGropu 组件代码
parent
abc179c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
src/components/TextGroup/index.js
+53
-0
src/components/TextGroup/tests/index.test.js
+11
-0
No files found.
src/components/TextGroup/index.js
0 → 100644
View file @
428f0ce1
/**
*
* IKTextGroup
*
*/
import
React
,
{
PureComponent
}
from
'react'
;
class
IKTextGroup
extends
PureComponent
{
// eslint-disable-line react/prefer-stateless-function
static
propTypes
=
{
position
:
React
.
PropTypes
.
string
,
title
:
React
.
PropTypes
.
string
,
className
:
React
.
PropTypes
.
string
,
};
constructor
(
props
)
{
super
(
props
);
}
render
()
{
const
props
=
$
({},
this
.
props
);
let
className
=
'ikmd-text-group-container'
;
let
groupClassName
=
'ikmd-text-group'
;
let
titleElm
=
null
;
if
(
props
.
title
)
{
titleElm
=
(
<
div
class
=
"ikmd-text-group-header"
>
{
props
.
title
}
<
/div
>
);
}
if
(
props
.
position
)
{
groupClassName
+=
` ikmd-text-group-
${
props
.
position
}
`
;
}
if
(
props
.
className
)
{
className
+=
`
${
props
.
className
}
`
;
}
return
(
<
div
className
=
{
className
}
>
{
titleElm
}
<
div
className
=
{
groupClassName
}
>
{
props
.
children
}
<
/div
>
<
/div
>
);
}
}
export
default
IKTextGroup
;
src/components/TextGroup/tests/index.test.js
0 → 100644
View file @
428f0ce1
// import IKTextGroup from '../index';
import
expect
from
'expect'
;
// import { shallow } from 'enzyme';
// import React from 'react';
describe
(
'<IKTextGroup />'
,
()
=>
{
it
(
'Expect to have unit tests specified'
,
()
=>
{
expect
(
true
).
toEqual
(
false
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment