Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit 3607db6

Browse files
authored
New design and migration to emotion(css-in-js) (#107)
* modify landingpage according to mockup * test netlify deploys * few suggestion from #41 (comment) * migrated header and footer to emotion * migrated hero and learn section to emotion * use preact in production * fix some responsive issues * add vscode support css autocomplete for emotion * fix responsive padding issues * change export routes * disable eslint and add editorconfig * make breakpoints consistent * move images to cloudinary * few improvements from lighthouse * fix test and lint issues * update readme * extract subject card to file * migrate space page to emotion * migrate learn index page to emotion * trim subtitle text * change webp to png as most browser doesnt support it * wip events page * wip subject page * update text and youtube link * change white button hover color * disable emotion cache * fix padding issue in learn section * disable preact due to hydrate bug * revert hover color on buttons * reduce timeline icons size * shadow for buttons removed * fixed on hover of menu bar items * transform on card of learn removed,this might change later * remove semantic-ui-react and ignore .vscode * remove .vscode/* and jsconfig.json from git cache * extract prettier config to .prettierrc file * fix link in discord btn * disable user-select and add login page * configure yarnclean
1 parent 63bc330 commit 3607db6

Some content is hidden

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

51 files changed

+1787
-2459
lines changed

Diff for: .babelrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
},
1313
"plugins": [
1414
[
15-
"lodash",
15+
"emotion",
1616
{
17-
"id": ["lodash", "semantic-ui-react"]
17+
"inline": true
1818
}
1919
]
2020
]

Diff for: .editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = false
9+
insert_final_newline = false

Diff for: .gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ node_modules
4545

4646
# IDE - VSCode
4747
.vscode/*
48-
!.vscode/settings.json
49-
!.vscode/tasks.json
50-
!.vscode/launch.json
51-
!.vscode/extensions.json
48+
jsconfig.json
5249

5350
### Linux ###
5451
*~

Diff for: .prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 120,
3+
"semi": true,
4+
"trailingComma": "es5",
5+
"singleQuote": true
6+
}

Diff for: .yarnclean

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# test directories
2+
__tests__
3+
test
4+
tests
5+
powered-test
6+
7+
# asset directories
8+
docs
9+
doc
10+
website
11+
images
12+
assets
13+
14+
# examples
15+
example
16+
examples
17+
18+
# code coverage directories
19+
coverage
20+
.nyc_output
21+
22+
# build scripts
23+
Makefile
24+
Gulpfile.js
25+
Gruntfile.js
26+
27+
# configs
28+
appveyor.yml
29+
circle.yml
30+
codeship-services.yml
31+
codeship-steps.yml
32+
wercker.yml
33+
.tern-project
34+
.gitattributes
35+
.editorconfig
36+
.*ignore
37+
.eslintrc
38+
.jshintrc
39+
.flowconfig
40+
.documentup.json
41+
.yarn-metadata.json
42+
.travis.yml
43+
44+
# misc
45+
*.md

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
This project mainly uses
1212

1313
- [Next.js](https://github.com/zeit/next.js/)
14-
- [Semantic UI React](http://react.semantic-ui.com/introduction)
14+
- [emotion](https://emotion.sh) As css-in-js library
1515

1616
### [Join our community here](https://www.coderplex.org)
1717

Diff for: __tests__/__snapshots__/common-banner.test.js.snap

-22
This file was deleted.

Diff for: __tests__/__snapshots__/header.test.js.snap

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Testing Header of \`components/header\` Check the snapshot 1`] = `<NavBar />`;

Diff for: __tests__/common-banner.test.js

-38
This file was deleted.

Diff for: __tests__/header.test.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React from 'react';
2+
import { shallow } from 'enzyme';
3+
4+
import Header from '../components/common/header';
5+
6+
describe('Testing Header of `components/header`', () => {
7+
const shallowWrapper = shallow(<Header />);
8+
9+
it('Check the snapshot', () => {
10+
expect(shallowWrapper).toMatchSnapshot();
11+
});
12+
/**
13+
* Disable for now
14+
it('should have title tag rendered', () => {
15+
expect(shallowWrapper.find('h1').length).toBe(1);
16+
});
17+
18+
it('should have subtitle tag rendered', () => {
19+
expect(shallowWrapper.find('h2').length).toBe(1);
20+
});
21+
22+
describe('should render the props', () => {
23+
const pageTitle = 'title of the page';
24+
const pageSubTitle = 'Subtitle of the page';
25+
const rootWrapper = shallow(<CommonBanner pageTitle={pageTitle} pageSubTitle={pageSubTitle} />);
26+
27+
it('should display title', () => {
28+
const headerElement = rootWrapper.find('.headline');
29+
expect(headerElement.props().children).toEqual(pageTitle);
30+
});
31+
32+
it('should display subtitle', () => {
33+
const subHeaderElement = rootWrapper.find('h2');
34+
expect(subHeaderElement.props().children).toEqual(pageSubTitle);
35+
});
36+
});
37+
*/
38+
});

Diff for: __tests__/index.test.js

-5
This file was deleted.

Diff for: components/common-banner.js

-37
This file was deleted.

Diff for: components/common/banner.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import styled from 'react-emotion';
3+
import { space } from 'styled-system';
4+
5+
import { Container, Title, SubTitle } from '../../utils/base.styles';
6+
7+
const BannerSection = styled.section`
8+
background: #fbfbfb;
9+
background-image: url('https://res.cloudinary.com/coderplex/image/upload/v1510788480/website__assets/pattern.png');
10+
min-height: 150px;
11+
text-align: center;
12+
${space};
13+
`;
14+
15+
export default ({ title, subTitle, textInverted = false }) => (
16+
<BannerSection py={[2, 3]} px={[2, 1]}>
17+
<Container>
18+
<Title inverted={textInverted}>{title}</Title>
19+
<SubTitle inverted={textInverted}>{subTitle}</SubTitle>
20+
</Container>
21+
</BannerSection>
22+
);

0 commit comments

Comments
 (0)