Skip to content

Commit a6a3bbb

Browse files
authored
Merge pull request #263 from Codebrahma/development
Development
2 parents 5d105a9 + cbc58b4 commit a6a3bbb

57 files changed

Lines changed: 2045 additions & 6280 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/src/components/WithComponentsBar/WithComponentBar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import './styles.scss';
1414

1515
class WithComponentBar extends React.Component {
1616
componentDidUpdate(prevProps) {
17-
if (this.props.activeComponent !== prevProps.activeComponent) {
17+
const { activeComponent } = this.props;
18+
if (activeComponent !== prevProps.activeComponent) {
1819
const element = document.querySelector('div[data-react-active-component=active]');
1920
const { top, height } = element.getBoundingClientRect();
2021
const { parentNode } = document.querySelector('div[data-react-active-component=active]');

doc/src/components/common/componentData/Button/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const componentData = {
122122
this.style = {
123123
buttonContainer: {
124124
display: "grid",
125-
gridTemplateColumns: "repeat(auto-fill, 150px)",
125+
gridTemplateColumns: "repeat(auto-fit, 150px)",
126126
gridGap: 20,
127127
alignItems: "center"
128128
}

doc/src/components/common/componentData/Pagination/index.js

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const componentData = {
4545
{
4646
prop: 'navigationButtons',
4747
type: 'boolean',
48-
defaultValue: 'false',
48+
defaultValue: 'true',
4949
description: 'Shows navigation buttons when `true`.',
5050
},
5151
],
@@ -83,16 +83,50 @@ export const componentData = {
8383
<Pagination total={10}/>
8484
`,
8585
componentUsage: `
86-
class Demo extends React.Component {
86+
// Component.js
87+
88+
class Demo extends React.Component {
8789
render() {
8890
return (
89-
<div>
91+
<PreviewElements>
9092
<PreviewBlock header="Pagination">
91-
<Pagination total={10}/>
93+
<PreviewElements>
94+
95+
{/* Default Pagination Component */}
96+
<Pagination total={10}/>
97+
98+
</PreviewElements>
9299
</PreviewBlock>
93-
</div>
100+
<PreviewBlock header="Custom Pagination">
101+
<PreviewElements>
102+
103+
{/* Custom themed Pagination Component, Refer theme.scss below */}
104+
<Pagination total={5} theme={componentTheme} navigationButtons={false}/>
105+
106+
</PreviewElements>
107+
</PreviewBlock>
108+
</PreviewElements>
94109
)
95110
}
96111
}
97112
`,
113+
componentUsageTheme: `
114+
// theme.scss
115+
116+
:local(.pagination-steps) {
117+
border-color: transparent;
118+
color: #8047c7;
119+
}
120+
121+
:local(.active) {
122+
color: #ff8600;
123+
}
124+
125+
:local(.dots) {
126+
span {
127+
height: 0.3em;
128+
width: 0.3em;
129+
}
130+
}
131+
`,
98132
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:local(.pagination-steps) {
2+
border-color: transparent;
3+
color: #8047c7;
4+
}
5+
6+
:local(.active) {
7+
color: #ff8600;
8+
}
9+
10+
:local(.dots) {
11+
span {
12+
height: 0.3em;
13+
width: 0.3em;
14+
}
15+
}

doc/src/components/common/componentData/Toggle/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const componentData = {
102102
/>
103103
104104
</PreviewBlock>
105-
<PreviewBlock header="Toggle with switch on (with toggable)">
105+
<PreviewBlock header="Custom Toggle">
106106
107107
{/* Custom Toggle, Refer theme.scss */}
108108
<Toggle

doc/src/components/common/componentData/theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@import './Modal/theme.scss';
99
@import './MultiSelect/theme.scss';
1010
@import './Navbar/theme.scss';
11+
@import './Pagination/theme.scss';
1112
@import './Select/theme.scss';
1213
@import './Slider/theme.scss';
1314
@import './TextInput/theme.scss';

doc/src/components/header.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,22 @@ const Header = ({ location }) => (
1919
<Link
2020
to="/documentation"
2121
activeClassName="active-link"
22-
>Documentation
22+
>
23+
Documentation
2324
</Link>
2425
<Link
2526
to="/usage"
2627
activeClassName="active-link"
27-
>Usage
28+
>
29+
Usage
2830
</Link>
2931
<Link
3032
to="/playground"
3133
activeClassName="active-link"
32-
>Playground
34+
>
35+
Playground
3336
</Link>
34-
<a href="https://www.github.com/Codebrahma/react-lite-ui/" >
37+
<a href="https://www.github.com/Codebrahma/react-lite-ui/">
3538
<svg xmlns="http://www.w3.org/2000/svg" width="69" height="23" viewBox="0 0 69 23">
3639
<g fill="#FFF" fillRule="evenodd">
3740
<text fontFamily="Roboto-Bold, Roboto" fontSize="20" transform="translate(29 -1)">

doc/src/components/usage/Usage.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const PreviewBlock = ({ children, header }) => (
2222
);
2323

2424
const PreviewElements = ({ children, style }) => (
25-
<div className="preview-elements" style={style} >
25+
<div className="preview-elements" style={style}>
2626
{children}
2727
</div>
2828
);
@@ -36,6 +36,7 @@ class Usage extends React.Component {
3636
componentDidUpdate() {
3737
highlightAll();
3838
}
39+
3940
renderComponentUsage = componentData => (
4041
<LiveProvider
4142
scope={{
@@ -88,6 +89,11 @@ PreviewBlock.propTypes = {
8889

8990
PreviewElements.propTypes = {
9091
children: PropTypes.oneOfType([PropTypes.node]).isRequired,
92+
style: PropTypes.oneOfType([PropTypes.object]),
93+
};
94+
95+
PreviewElements.defaultProps = {
96+
style: undefined,
9197
};
9298

9399
export default Usage;

doc/src/pages/documentation.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class DocumentationPage extends React.Component {
1919
}
2020

2121
componentDidMount() {
22-
const { search } = this.props.location;
22+
const { location } = this.props;
23+
const { search } = location;
2324
const queryComponent = this.getQueryComponent(search);
2425
if (queryComponent.length) {
2526
// eslint-disable-next-line react/no-did-mount-set-state
@@ -31,7 +32,8 @@ class DocumentationPage extends React.Component {
3132
}
3233

3334
componentDidUpdate(prevProps) {
34-
const { search } = this.props.location;
35+
const { location } = this.props;
36+
const { search } = location;
3537
if (search !== prevProps.location.search) {
3638
const queryComponent = this.getQueryComponent(search);
3739
if (queryComponent.length) {

doc/src/pages/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class IndexPage extends Component {
1010
super(props);
1111
this.heroBottom = null;
1212
}
13+
1314
componentDidMount() {
1415
window.addEventListener('scroll', this.registerScroll);
1516
// eslint-disable-next-line react/no-find-dom-node
@@ -49,7 +50,8 @@ class IndexPage extends Component {
4950
<div className="hero-content">
5051
<img src={liteLogo} alt="react-lite-ui-logo" />
5152
<div>
52-
<h2>React Lite UI</h2><br />
53+
<h2>React Lite UI</h2>
54+
<br />
5355
<p>A set of light weight React Components</p>
5456
</div>
5557
</div>

0 commit comments

Comments
 (0)