Merge pull request #596 from react-bootstrap-table/redesign-gh-pages

Feature/ Introduce new logo to gh-pages
This commit is contained in:
Allen
2018-10-07 23:25:35 +08:00
committed by GitHub
13 changed files with 182 additions and 172 deletions

19
website/core/button.js Normal file
View File

@@ -0,0 +1,19 @@
const React = require('react');
class Button extends React.Component {
render() {
return (
<div className="pluginWrapper buttonWrapper">
<a className="button" href={this.props.href} target={this.props.target}>
{this.props.children}
</a>
</div>
);
}
}
Button.defaultProps = {
target: '_self',
};
module.exports = Button;

View File

@@ -0,0 +1,56 @@
const React = require('react');
const Button = require('./button');
const utils = require('./utils');
const siteConfig = require(process.cwd() + '/siteConfig.js');
const SplashContainer = props => (
<div className="homeContainer">
<div className="homeSplashFade">
<div className="wrapper homeWrapper">{props.children}</div>
</div>
</div>
);
const Logo = props => (
<div className="logo">
<img src={props.img_src} />
</div>
);
const ProjectTitle = () => (
<h2 className="projectTitle">
{siteConfig.title}
<small>{siteConfig.tagline}</small>
</h2>
);
const PromoSection = props => (
<div className="section promoSection">
<div className="promoRow">
<div className="pluginRowBlock">{props.children}</div>
</div>
</div>
);
class HomeSplash extends React.Component {
render() {
let language = this.props.language || '';
return (
<SplashContainer>
<Logo img_src={utils.imgUrl('logo/pure-color-square.svg')} />
<div className="inner">
<ProjectTitle />
<PromoSection>
<Button href={utils.docUrl('getting-started.html', language)}>Try It Out</Button>
<Button href='./storybook/index.html'>Live Demo</Button>
<Button href={utils.docUrl('table-props.html', language)}>Docs</Button>
</PromoSection>
</div>
</SplashContainer>
);
}
}
module.exports = HomeSplash;

View File

@@ -0,0 +1,19 @@
const siteConfig = require(process.cwd() + '/siteConfig.js');
const imgUrl = (img) => {
return siteConfig.baseUrl + 'img/' + img;
}
const docUrl = (doc, language) => {
return siteConfig.baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
}
const pageUrl = (page, language) => {
return siteConfig.baseUrl + (language ? language + '/' : '') + page;
}
module.exports = {
imgUrl,
docUrl,
pageUrl
}

View File

@@ -52,6 +52,7 @@
"API": "API",
"Help": "Help",
"Blog": "Blog",
"GitHub": "GitHub",
"Basic Usage": "Basic Usage",
"Remote Table": "Remote Table",
"Table Toolkits": "Table Toolkits",

View File

@@ -7,116 +7,48 @@
const React = require('react');
// Built-in library
const CompLibrary = require('../../core/CompLibrary.js');
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;
const siteConfig = require(process.cwd() + '/siteConfig.js');
function imgUrl(img) {
return siteConfig.baseUrl + 'img/' + img;
}
function docUrl(doc, language) {
return siteConfig.baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
}
function pageUrl(page, language) {
return siteConfig.baseUrl + (language ? language + '/' : '') + page;
}
class Button extends React.Component {
render() {
return (
<div className="pluginWrapper buttonWrapper">
<a className="button" href={this.props.href} target={this.props.target}>
{this.props.children}
</a>
</div>
);
}
}
Button.defaultProps = {
target: '_self',
};
const SplashContainer = props => (
<div className="homeContainer">
<div className="homeSplashFade">
<div className="wrapper homeWrapper">{props.children}</div>
</div>
</div>
);
const Logo = props => (
<div className="projectLogo">
<img src={props.img_src} />
</div>
);
const ProjectTitle = props => (
<h2 className="projectTitle">
{siteConfig.title}
<small>{siteConfig.tagline}</small>
</h2>
);
const PromoSection = props => (
<div className="section promoSection">
<div className="promoRow">
<div className="pluginRowBlock">{props.children}</div>
</div>
</div>
);
class HomeSplash extends React.Component {
render() {
let language = this.props.language || '';
return (
<SplashContainer>
{/* <Logo img_src={imgUrl('docusaurus.svg')} /> */}
<div className="inner">
<ProjectTitle />
<PromoSection>
<Button href={docUrl('getting-started.html', language)}>Try It Out</Button>
<Button href='./storybook/index.html'>Live Demo</Button>
<Button href={docUrl('table-props.html', language)}>Docs</Button>
</PromoSection>
</div>
</SplashContainer>
);
}
}
// Customized component and utils
const HomeSplash = require(process.cwd() + '/core/homeSplash.js');
const utils = require(process.cwd() + '/core/utils');
const imgUrl = utils.imgUrl;
const Block = props => (
<Container
padding={['bottom', 'top']}
id={props.id}
background={props.background}>
<GridBlock align={ props.align || 'center' } contents={props.children} layout={props.layout} />
>
<GridBlock
align={ props.align || 'center' }
layout={props.layout}
className={props.className}
contents={props.children}
/>
</Container>
);
const Features = props => (
<Block layout="fourColumn">
const Features = () => (
<Block layout="threeColumn" className="feature-block">
{[
{
content: 'Sortable, Row Selection, Cell Editor, Row Expand, Column Filter Pagination etc.',
// image: imgUrl('docusaurus.svg'),
image: imgUrl('icon/bulb.svg'),
imageAlign: 'top',
title: 'Rich Functionality',
},
{
content: 'Configurable and customizable table',
// image: imgUrl('docusaurus.svg'),
image: imgUrl('icon/tool.svg'),
imageAlign: 'top',
title: 'Customization',
},
{
content: 'Satisfy for Redux/Mobx or any other state management tool.',
// image: imgUrl('docusaurus.svg'),
image: imgUrl('icon/store.svg'),
imageAlign: 'top',
title: 'Remote',
},
@@ -124,20 +56,11 @@ const Features = props => (
</Block>
);
// const FeatureCallout = props => (
// <div
// className="productShowcaseSection paddingBottom"
// style={{textAlign: 'center'}}>
// <h2>Feature Callout</h2>
// <MarkdownBlock>These are features of this project</MarkdownBlock>
// </div>
// );
const LearnHow = props => (
<Block background="light" align="left">
const LearnHow = () => (
<Block align="left">
{[
{
content: 'Intuitive to use. <br/>Compatitable for Bootstrap 3 and 4. <br/>Better than legacy react-bootstrap-table2!!<br/>',
content: 'Intuitive to use. <br/>Compatible for Bootstrap 3 and 4. <br/>Better than legacy react-bootstrap-table!!<br/>',
image: imgUrl('react-bootstrap-table2-sample.png'),
imageAlign: 'right',
title: 'react-bootstrap-table2',
@@ -146,62 +69,6 @@ const LearnHow = props => (
</Block>
);
const TryOut = props => (
<Block id="try">
{[
{
content: 'Talk about trying this out',
image: imgUrl('docusaurus.svg'),
imageAlign: 'left',
title: 'Try it Out',
},
]}
</Block>
);
const Description = props => (
<Block background="dark">
{[
{
content: 'This is another description of how this project is useful',
image: imgUrl('docusaurus.svg'),
imageAlign: 'right',
title: 'Description',
},
]}
</Block>
);
const Showcase = props => {
if ((siteConfig.users || []).length === 0) {
return null;
}
const showcase = siteConfig.users
.filter(user => {
return user.pinned;
})
.map((user, i) => {
return (
<a href={user.infoLink} key={i}>
<img src={user.image} title={user.caption} />
</a>
);
});
return (
<div className="productShowcaseSection paddingBottom">
<h2>{"Who's Using This?"}</h2>
<p>This project is used by all these people</p>
<div className="logos">{showcase}</div>
<div className="more-users">
<a className="button" href={pageUrl('users.html', props.language)}>
More {siteConfig.title} Users
</a>
</div>
</div>
);
};
class Index extends React.Component {
render() {
let language = this.props.language || '';
@@ -211,11 +78,7 @@ class Index extends React.Component {
<HomeSplash language={language} />
<div className="mainContainer">
<Features />
{/* <FeatureCallout /> */}
<LearnHow />
{/* <TryOut />
<Description />
<Showcase language={language} /> */}
</div>
</div>
);

View File

@@ -4,46 +4,49 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const ORGANIZATION_NAME = 'react-bootstrap-table';
const PROJECT_NAME = 'react-bootstrap-table2';
const PRIMARY_COLOR = '#1976d2';
const SECONDARY_COLOR = '#1769aa';
/* List of projects/orgs using your project for the users page */
const users = [
{
caption: '',
// image: '/react-bootstrap-table2/img/docusaurus.svg',
image: '/react-bootstrap-table2/img/logo/pure-color-square.svg',
infoLink: 'https://github.com/react-bootstrap-table/react-bootstrap-table2',
pinned: true,
},
];
const siteConfig = {
title: 'react-bootstrap-table2' /* title for your website */,
title: PROJECT_NAME /* title for your website */,
tagline: 'Next Generation of react-bootstrap-table',
url: 'https://react-bootstrap-table.github.io' /* your website url */,
baseUrl: '/react-bootstrap-table2/' /* base url for your project */,
projectName: 'react-bootstrap-table2',
projectName: PROJECT_NAME,
headerLinks: [
{doc: 'about', label: 'Docs'},
{doc: 'table-props', label: 'API'},
{page: 'help', label: 'Help'},
{blog: true, label: 'Blog'},
{href: 'https://github.com/react-bootstrap-table/react-bootstrap-table2', label: 'GitHub' },
],
users,
/* path to images for header/footer */
// headerIcon: 'img/docusaurus.svg',
// footerIcon: 'img/docusaurus.svg',
// favicon: 'img/favicon.png',
headerIcon: 'img/logo/hybrid-white-large.svg',
favicon: 'img/favicon.ico',
disableHeaderTitle: true,
/* colors for website */
colors: {
primaryColor: '#294E80',
secondaryColor: '#3CA7F2',
primaryColor: PRIMARY_COLOR,
secondaryColor: SECONDARY_COLOR,
},
// This copyright info is used in /core/Footer.js and blog rss/atom feeds.
copyright:
'Copyright © ' +
new Date().getFullYear() +
' react-bootstrap-table2',
organizationName: 'react-bootstrap-table', // or set an env variable ORGANIZATION_NAME
projectName: 'react-bootstrap-table2', // or set an env variable PROJECT_NAME
copyright: `Copyright © ${new Date().getFullYear()} ${PROJECT_NAME}`,
organizationName: ORGANIZATION_NAME,
projectName: PROJECT_NAME,
highlight: {
// Highlight.js theme to use for syntax highlighting in code blocks
theme: 'default',

View File

@@ -13,4 +13,39 @@
}
@media only screen and (min-width: 1500px) {
}
}
/* Footer */
footer.nav-footer {
background-color: #202020;
}
/* Home */
.logo {
display: flex;
justify-content: center;
}
.logo img {
height: 100%;
max-height: 250px;
margin-bottom: 0px;
}
.homeContainer .homeWrapper .projectLogo {
justify-content: flex-start;
}
.feature-block .blockImage img {
width: 48px;
}
.buttonWrapper a.button {
border-radius: 24px;
min-width: 64px;
}
/* Navigation */
.navGroup ul {
background-color: #f9f9f9;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M3.55 18.54l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8zM11 22.45h2V19.5h-2v2.95zM4 10.5H1v2h3v-2zm11-4.19V1.5H9v4.81C7.21 7.35 6 9.28 6 11.5c0 3.31 2.69 6 6 6s6-2.69 6-6c0-2.22-1.21-4.15-3-5.19zm5 4.19v2h3v-2h-3zm-2.76 7.66l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 405 B

View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M20 4H4v2h16V4zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6h1zm-9 4H6v-4h6v4z"/>
</svg>

After

Width:  |  Height:  |  Size: 224 B

View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path clip-rule="evenodd" fill="none" d="M0 0h24v24H0z"/>
<path d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 338 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@@ -0,0 +1 @@
<svg id="layer_1" data-name="layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72"><defs><style>.cls-1{fill:#059ae6;}.cls-2{fill:#0058b7;}</style></defs><title>logo square</title><polygon class="cls-1" points="22.76 59 22.76 64.35 49.24 51.13 49.24 43.88 44.45 41.5 44.45 48.17 22.76 59"/><polygon class="cls-2" points="22.76 20.87 22.76 47.98 27.55 45.59 27.55 23.83 44.45 15.39 44.45 23.02 33.06 28.71 33.06 31.9 49.24 39.97 49.24 34.62 40.58 30.3 49.24 25.98 49.24 7.65 22.76 20.87"/></svg>

After

Width:  |  Height:  |  Size: 503 B