Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate grommet #11

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion kit/views/ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const Html = ({ head, html, state, scripts, chunkManifest, css }) => (
<meta httpEquiv="Content-Language" content="en" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{head.meta.toComponent()}
<link rel="stylesheet" href={css} />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/grommet/1.3.4/grommet.min.css" />
<link rel="stylesheet" type="text/css" href={css} />
{head.title.toComponent()}
<script
dangerouslySetInnerHTML={{
Expand Down
1 change: 1 addition & 0 deletions kit/views/webpack.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta httpEquiv="Content-Language" content="en" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/grommet/1.3.4/grommet.min.css">
<title>ReactQL</title>
</head>
<body>
Expand Down
13 changes: 12 additions & 1 deletion kit/webpack/browser_dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ const cssLoader = {
},
};

const sassLoader = {
loader: 'sass-loader',
options: {
outputStyle: 'expanded',
includePaths: [
'./node_modules',
],
sourceMap: true,
},
};

export default new WebpackConfig().extend({
'[root]/browser.js': conf => {
// Add `webpack-dev-server` polyfills needed to communicate with the browser
Expand Down Expand Up @@ -125,7 +136,7 @@ export default new WebpackConfig().extend({
'style-loader',
cssLoader,
'resolve-url-loader',
'sass-loader?sourceMap',
sassLoader,
],
},
// LESS processing. Parsed through `less-loader` first
Expand Down
13 changes: 12 additions & 1 deletion kit/webpack/browser_prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ const cssLoader = {
},
};

// SASS/SCSS loader
const sassLoader = {
loader: 'sass-loader',
options: {
outputStyle: 'compressed',
includePaths: [
'./node_modules',
],
},
};

// Extend the `browser.js` config
export default new WebpackConfig().extend({
'[root]/browser.js': config => {
Expand Down Expand Up @@ -108,7 +119,7 @@ export default new WebpackConfig().extend({
cssLoader,
'postcss-loader',
'resolve-url-loader',
'sass-loader?sourceMap',
sassLoader,
],
fallback: 'style-loader',
}),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"webpack-node-externals": "^1.5.4"
},
"dependencies": {
"grommet": "^1.3.4",
"isomorphic-fetch": "^2.2.1",
"koa": "^2.2.0",
"koa-helmet": "^3.1.0",
Expand Down
29 changes: 28 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ import Helmet from 'react-helmet';
// Helper to merge expected React PropTypes to Apollo-enabled component
import { mergeData } from 'kit/lib/apollo';

import App from 'grommet/components/App';
import Header from 'grommet/components/Header';
import Footer from 'grommet/components/Footer';
import Title from 'grommet/components/Title';

// Styles
import 'grommet/scss/vanilla/index.scss';
import css from './styles.css';
import sass from './styles.scss';
import less from './styles.less';
Expand Down Expand Up @@ -91,7 +97,7 @@ class GraphQLMessage extends React.PureComponent {
}),
),
}),
}
};

render() {
const { data } = this.props;
Expand Down Expand Up @@ -146,5 +152,26 @@ export default () => (
<hr />
<p>Stylesheet examples:</p>
<Styles />
<hr />
<App centered={false}>
<Header
direction="row"
justify="between"
size="large"
pad={{ horizontal: 'medium' }}>
<Title>Grommet</Title>
</Header>
<Footer
primary
appCentered
direction="column"
align="center"
pad="small"
colorIndex="grey-1">
<p>
Build your ideas with <a href="http://grommet.io" rel="noopener noreferrer" target="_blank">Grommet</a>!
</p>
</Footer>
</App>
</div>
);