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

InspireHome #12

Merged
merged 28 commits into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4d33385
desktop view ready inshallah
bahaadabbagh Jul 19, 2020
850a2dc
added Media Query
bahaadabbagh Jul 19, 2020
cb469c7
after installing i18n
bahaadabbagh Jul 19, 2020
26eaf00
added test file and configured translations from props
bahaadabbagh Jul 20, 2020
baa2e16
deleted media queries + px=>rem
bahaadabbagh Jul 20, 2020
67b6cf2
ran prettier
bahaadabbagh Jul 20, 2020
5755b92
Normalize all the line endings
bahaadabbagh Jul 20, 2020
4d7e5ef
fixed prettier issue
bahaadabbagh Jul 20, 2020
a25a13c
deleted bootstrap link in .html
bahaadabbagh Jul 21, 2020
586fb2d
resolved conflict and added circleCI
bahaadabbagh Jul 22, 2020
c8f9c0e
after tests of CircleCI and megring with dev
bahaadabbagh Jul 22, 2020
c0ff5af
fixed classNames and fixed line breaks to be reponsive instead of <br/>
bahaadabbagh Jul 22, 2020
e2dbf2b
remved font family and added a snapshot test
bahaadabbagh Jul 23, 2020
ced3f95
fixed tests to be snapshot and removed an extra line
bahaadabbagh Jul 23, 2020
a08b730
Merge branch 'dev' into inspire_home
bahaadabbagh Jul 23, 2020
b9eddbd
resolved conflicts and deleted extra space
bahaadabbagh Jul 23, 2020
e4497c5
Merge branch 'inspire_home' of https://github.com/ReCoded-Org/capston…
bahaadabbagh Jul 23, 2020
4570b16
fixed issue in package.json because test was failing in circleci
bahaadabbagh Jul 23, 2020
50b0295
deleted extra test
bahaadabbagh Jul 23, 2020
c5f3b5c
deleted one extra space after button
bahaadabbagh Jul 23, 2020
b2df6ca
fixed snapshot
bahaadabbagh Jul 23, 2020
4923269
fixed .prettierrc and added command to script to process snapshot
bahaadabbagh Jul 24, 2020
2642dd0
Merge branch 'dev' into inspire_home
bahaadabbagh Jul 24, 2020
2dbd1c0
fixed file name Home.jsx
bahaadabbagh Jul 24, 2020
8f89651
a step of fixing conflicts
bahaadabbagh Jul 24, 2020
cda56fc
Saving files before refreshing line endings
bahaadabbagh Jul 24, 2020
769c16f
fixed merge conflicts inshallah
bahaadabbagh Jul 24, 2020
cb6b2f9
fixing circle ci test
bahaadabbagh Jul 24, 2020
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
12 changes: 6 additions & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true
{
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
104 changes: 53 additions & 51 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
{
"name": "digital-world",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"bootstrap": "^4.5.0",
"firebase": "^7.16.0",
"i18next": "^19.6.2",
"i18next-browser-languagedetector": "^5.0.0",
"react": "^16.13.1",
"react-bootstrap": "^1.2.2",
"react-dom": "^16.13.1",
"react-i18next": "^11.7.0",
"react-scripts": "3.4.1",
"react-test-renderer": "^16.13.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"fix": "prettier --write 'src/**/*.js*' 'src/**/*.css' '!src/**/*/*.snap'"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"babel-eslint": "^10.1.0",
"eslint": "^6.6.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-react": "^7.20.3",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1"
}
}

"name": "digital-world",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"bootstrap": "^4.5.0",
"firebase": "^7.16.0",
"i18next": "^19.6.2",
"i18next-browser-languagedetector": "^5.0.0",
"react": "^16.13.1",
"react-bootstrap": "^1.2.2",
"react-dom": "^16.13.1",
"react-i18next": "^11.7.0",
"react-scripts": "3.4.1",
"react-test-renderer": "^16.13.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"fix": "prettier --write 'src/**/*.js*' 'src/**/*.css' '!src/**/*/*.snap'"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"babel-eslint": "^10.1.0",
"eslint": "^6.6.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-react": "^7.20.3",
"jest": "^24.9.0",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1"
}
}
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import Home from './containers/home/Home';
import 'bootstrap/dist/css/bootstrap.min.css';

function App() {
bahaadabbagh marked this conversation as resolved.
Show resolved Hide resolved
return (
Expand Down
37 changes: 37 additions & 0 deletions src/components/inspire/Inspire.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.inspireContainer {
text-align: center;
margin: 0 15%;
}

.inspireHeader {
font-size: 2.875rem;
}

.pinkInspire {
color: #e87a80;
}

.purpleInspire {
color: #6c567c;
}

.heroText {
color: #4a474d;
font-size: 1.875rem;
}

.inspireButton {
background-color: #6c567b;
color: white;
cursor: pointer;
width: 18.75rem;
height: 6.25rem;
font-size: 3.75rem;
border-radius: 3.125rem;
border-style: hidden;
box-shadow: 0 0.6875rem 1.5rem -0.4375rem #b3b3b3;
}

.inspireButton:hover {
background-color: #f8b195;
}
20 changes: 20 additions & 0 deletions src/components/inspire/Inspire.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import './Inspire.css';
import Button from 'react-bootstrap/Button';

export default function Inspire(props) {
return (
<div className="inspireContainer" data-testid="inspireContainer">
<h2 className="inspireHeader">
<span className="purpleInspire">{props.header0}</span>{' '}
<span className="pinkInspire">{props.header1}</span>
<span className="purpleInspire">{props.header2}</span>{' '}
<span className="pinkInspire">{props.header3}</span>
</h2>
<p className="heroText">
{props.heroText} <br />
</p>
<Button className="inspireButton">{props.button}</Button>
</div>
);
}
8 changes: 8 additions & 0 deletions src/components/inspire/Inspire.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import Inspire from './Inspire';
import renderer from 'react-test-renderer';

it('renders correctly', () => {
const tree = renderer.create(<Inspire />).toJSON();
expect(tree).toMatchSnapshot();
});
38 changes: 38 additions & 0 deletions src/components/inspire/__snapshots__/Inspire.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders correctly 1`] = `
<div
className="inspireContainer"
data-testid="inspireContainer"
>
<h2
className="inspireHeader"
>
<span
className="purpleInspire"
/>

<span
className="pinkInspire"
/>
<span
className="purpleInspire"
/>

<span
className="pinkInspire"
/>
</h2>
<p
className="heroText"
>

<br />
</p>
<button
className="inspireButton btn btn-primary"
disabled={false}
type="button"
/>
</div>
`;
18 changes: 14 additions & 4 deletions src/containers/home/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import React from 'react';
import Inspire from '../../components/inspire/Inspire';
import { useTranslation } from 'react-i18next';
import Quotes from '../../components/quotes/Quotes';

const Home = () => {
export default function Home() {
const { t } = useTranslation();

return (
<div>
<Quotes />
<Inspire
header0={t('home.inspire.header.header0')}
header1={t('home.inspire.header.header1')}
header2={t('home.inspire.header.header2')}
header3={t('home.inspire.header.header3')}
heroText={t('home.inspire.heroText')}
button={t('home.inspire.button')}
/>
</div>
);
};

export default Home;
}
10 changes: 10 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"home": {
"inspire": {
"header": {
"header0": "Give hope.",
"header1": "Inspire.",
"header2": "Change lives.",
"header3": "Share your story today"
},
"heroText": "YOU have a powerful story to share. Your story can help women and girls around the world. Please help build our inspiring collection of stories by, sharing some aspects of your journey to empowerment",
"button": "Share"
},
"quotes": {
"sayHerName": {
"hashtag": "#SayHerName",
Expand Down