Skip to content

Commit a6a3bbb

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

File tree

57 files changed

+2045
-6280
lines changed

Some content is hidden

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

57 files changed

+2045
-6280
lines changed

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>

doc/src/pages/playground.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
import React, { Component } from 'react';
33
import PropTypes from 'prop-types';
4-
import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live';
4+
import {
5+
LiveProvider, LiveEditor, LiveError, LivePreview,
6+
} from 'react-live';
57
import { navigate } from 'gatsby';
68
import { componentList } from '../components/common/componentList';
79
import * as components from '../../../lib';
@@ -92,13 +94,13 @@ export default class Playground extends Component {
9294
/>
9395
<span>Select a component from the dropdown to edit it in playground.</span>
9496
</div>
95-
) : (
96-
<Preloader
97-
loader="colorCircleLoader"
98-
size="small"
99-
color="primary"
100-
/>
101-
)
97+
) : (
98+
<Preloader
99+
loader="colorCircleLoader"
100+
size="small"
101+
color="primary"
102+
/>
103+
)
102104
}
103105
<Button theme={theme} onClick={this.navigateBack} flat borderless>{`Go to ${prevPage}`}</Button>
104106
</div>

doc/src/pages/playground.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@
109109
}
110110

111111
.playground-editor {
112-
margin: 0 10% !important;
113-
overflow: scroll;
112+
margin: 0 10% 10% !important;
113+
overflow: auto;
114114
&::before {
115115
content: '// Edit the code here and preview the changes above.';
116116
display: flex;

doc/src/pages/usage.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class UsagePage 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 UsagePage 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/templates/landing-main/contrib-section/footer.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ const FooterSection = () => (
77
<div className="row">
88
{'Want us to build something for you? '}
99
{'Great! We would love to!'}
10-
<Button theme={theme} bordered href="https://codebrahma.com/contact/" >Let us know here!</Button>
10+
<Button theme={theme} bordered href="https://codebrahma.com/contact/">Let us know here!</Button>
11+
</div>
12+
<div className="row bottom-bar">
13+
Made with
14+
<span className="heart"></span>
15+
{' '}
16+
by
17+
<a target="blank" href="https://www.codebrahma.com"><span>Codebrahma</span></a>
1118
</div>
12-
<div className="row bottom-bar">Made with <span className="heart"></span> by<a target="blank" href="https://www.codebrahma.com"><span>Codebrahma</span></a></div>
1319
</div>
1420
);
1521

doc/src/templates/landing-main/contrib-section/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ div.contrib-section>div:nth-child(3) {
3535
color: rgb(228, 228, 228);
3636
font-weight: bold;
3737
align-items: center;
38+
text-align: center;
3839
width: 100%;
3940
background-color: transparent !important;
4041
&>* {

doc/src/templates/landing-main/features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const FeaturesSection = () => (
2222
<img src={quill} alt="lite-weight" />
2323
<p>Extremely Lite</p>
2424
</div>
25-
</div >
25+
</div>
2626
);
2727

2828

doc/src/templates/landing-main/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const LandingMain = () => (
2929
<div className="row">
3030
<div className="col">
3131
<p>Designed for all screen sizes.</p>
32-
<Link to="/usage" ><Button>Take a Tour</Button></Link>
32+
<Link to="/usage"><Button>Take a Tour</Button></Link>
3333
</div>
3434
</div>
3535
<ContributionSection />

doc/src/templates/landing-main/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
font-size: 1.5em;
7676
font-weight: bold;
7777
letter-spacing: 0.1rem;
78+
text-align: center;
7879
}
7980

8081
a {

0 commit comments

Comments
 (0)