Skip to content

Commit

Permalink
chore(layout) Add footer layout
Browse files Browse the repository at this point in the history
- ensure there is a mobile resposive footer layout
- ensure there is a desktop footer layout

[Finishes #167697967]
  • Loading branch information
tohbay committed Aug 8, 2019
1 parent d2cd98b commit 0e73fff
Show file tree
Hide file tree
Showing 19 changed files with 209 additions and 4 deletions.
1 change: 1 addition & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ratings:
exclude_paths:
- "**/*_test.go"
- "**/*spec.js"
- "**/src/assets/**"
- "*_test.go"
- "vendor/"

25 changes: 22 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ module.exports = {
testPathIgnorePatterns: ['/node_modules/'],
transformIgnorePatterns: ['<rootDir>/node_modules/'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js'
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js',
'^@config(.*)$': '<rootDir>/src/config$1',
'^@components(.*)$': '<rootDir>/src/components$1',
'^@containers(.*)$': '<rootDir>/src/containers$1',
'^@actions(.*)$': '<rootDir>/src/actions$1',
'^@pages(.*)$': '<rootDir>/src/pages$1',
'@/(.*)$': '<rootDir>/src$1'
},
collectCoverageFrom: [
'**/*.{js,jsx}',
Expand All @@ -23,6 +29,19 @@ module.exports = {
'!webpack.common.js',
'!webpack.config.js',
'!**/coverage/**',
'!**/tests/**'
'!**/tests/**',
'!src/actions/**',
'!src/assets/**',
'!src/reducers/**',
'!src/store/**',
'!src/index.js',
'!src/config/**',
'!src/containers/**',
'!index.js',
'!src/pages/home.js',
'!postcss.config.js',
'!src/utils/**',
'!**/cypress/**',
'!**/*.css'
]
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
"style-loader": "^0.23.1",
"tailwindcss": "^1.0.6",
"terser-webpack-plugin": "^1.3.0",
"react-svg-loader": "^3.0.3",
"@svgr/webpack": "^4.3.2",
"webpack": "^4.38.0",
"webpack-cli": "^3.3.6",
"webpack-merge": "^4.2.1"
Expand Down
Binary file modified src/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions src/assets/icons/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/icons/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import YoutubeIcon from './youtube.svg';
import FacebookIcon from './facebook.svg';
import LinkedInIcon from './linkedin.svg';
import InstagramIcon from './instagram.svg';
import TwitterIcon from './twitter.svg';

export { YoutubeIcon, FacebookIcon, LinkedInIcon, InstagramIcon, TwitterIcon };
12 changes: 12 additions & 0 deletions src/assets/icons/instagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/icons/linkedin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/icons/youtube.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Routes from '../routes/AppRouter';
import Footer from './Footer/Footer';

const App = () => {
return (
<Router>
<Routes />
<Footer />
</Router>
);
};
Expand Down
9 changes: 9 additions & 0 deletions src/components/Footer/Footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700,800,900|Roboto&display=swap');


.footer {
font-family: 'Poppins', sans-serif;
position: fixed;
left: 0px;
bottom: 0px;
}
41 changes: 41 additions & 0 deletions src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
import './Footer.css';

import {
YoutubeIcon,
FacebookIcon,
LinkedInIcon,
InstagramIcon,
TwitterIcon
} from '../../assets/icons';

const Footer = () => {
return (
<footer className="footer flex flex-wrap w-full justify-center px-5">
<div className="sm:w-1/2 h-8">
<p className=" flex justify-start">Designed by Kifaru Team</p>
</div>
<div className="sm:w-1/2 h-8">
<ul className="flex justify-end items-center">
<li className="mx-1 px-2 py-1 cursor-pointer">
<TwitterIcon />
</li>
<li className="mx-1 px-2 py-1 cursor-pointer">
<FacebookIcon />
</li>
<li className="mx-1 px-2 py-1 cursor-pointer">
<InstagramIcon />
</li>
<li className="mx-1 px-2 py-1 cursor-pointer">
<YoutubeIcon />
</li>
<li className="mx-1 px-2 py-1 cursor-pointer">
<LinkedInIcon />
</li>
</ul>
</div>
</footer>
);
};

export default Footer;
2 changes: 2 additions & 0 deletions src/pages/hompage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Link } from 'react-router-dom';
import logo from '../assets/images/logo.png';
import Footer from '../components/Footer/Footer';

const Homepage = () => {
return (
Expand All @@ -17,6 +18,7 @@ const Homepage = () => {
Login
</button>
</Link>
<Footer />
</div>
);
};
Expand Down
12 changes: 12 additions & 0 deletions tests/Footer.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import toJson from 'enzyme-to-json';
import { shallow } from './enzyme';
import Footer from '../src/components/Footer/Footer';

describe('Footer layout', () => {
it('should render without crashing', () => {
const wrapper = shallow(<Footer />);

expect(toJson(wrapper)).toMatchSnapshot();
});
});
2 changes: 2 additions & 0 deletions tests/__snapshots__/App.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ exports[`Application test should work fine Home Page 1`] = `
Login
</button>
</Link>
<Footer />
</div>
`;

exports[`Application test should work fine on App 1`] = `
<BrowserRouter>
<Routes />
<Footer />
</BrowserRouter>
`;

Expand Down
50 changes: 50 additions & 0 deletions tests/__snapshots__/Footer.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Footer layout should render without crashing 1`] = `
<footer
className="footer flex flex-wrap w-full justify-center px-5"
>
<div
className="sm:w-1/2 h-8"
>
<p
className=" flex justify-start"
>
Designed by Kifaru Team
</p>
</div>
<div
className="sm:w-1/2 h-8"
>
<ul
className="flex justify-end items-center"
>
<li
className="mx-1 px-2 py-1 cursor-pointer"
>
<[object Object] />
</li>
<li
className="mx-1 px-2 py-1 cursor-pointer"
>
<[object Object] />
</li>
<li
className="mx-1 px-2 py-1 cursor-pointer"
>
<[object Object] />
</li>
<li
className="mx-1 px-2 py-1 cursor-pointer"
>
<[object Object] />
</li>
<li
className="mx-1 px-2 py-1 cursor-pointer"
>
<[object Object] />
</li>
</ul>
</div>
</footer>
`;
17 changes: 16 additions & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,22 @@ module.exports = {
}
},
{
test: /\.(svg|png|jpeg|jpg)$/,
test: /\.svg$/,
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: {
removeViewBox: false
}
}
}
}
]
},
{
test: /\.(png|jpeg|jpg)$/,
use: {
loader: 'file-loader',
options: {
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const commonConfig = require('./webpack.common');

Expand Down

0 comments on commit 0e73fff

Please sign in to comment.