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 14 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
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
"@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": "^9.0.10",
"react-scripts": "3.4.1"
"react-i18next": "^11.7.0",
"react-scripts": "3.4.1",
"react-test-renderer": "^16.13.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
5 changes: 1 addition & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Women Empowerment"
/>
<meta name="description" content="Women Empowerment" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
7 changes: 6 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from "react";
import Home from "./containers/home/home";

function App() {
bahaadabbagh marked this conversation as resolved.
Show resolved Hide resolved
return <div className="App"></div>;
return (
<div className="App">
<Home />
</div>
);
}

export default App;
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;
}
21 changes: 21 additions & 0 deletions src/components/inspire/Inspire.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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>{" "}
bahaadabbagh marked this conversation as resolved.
Show resolved Hide resolved
bahaadabbagh marked this conversation as resolved.
Show resolved Hide resolved
</div>
);
}
14 changes: 14 additions & 0 deletions src/components/inspire/Inspire.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import ReactDOM from "react-dom";
import Inspire from "./Inspire";
import renderer from "react-test-renderer";

it("renders with no crash", () => {
const div = document.createElement("div");
ReactDOM.render(<Inspire />, div);
bahaadabbagh marked this conversation as resolved.
Show resolved Hide resolved
});
bahaadabbagh marked this conversation as resolved.
Show resolved Hide resolved

it("renders correctly", () => {
const tree = renderer.create(<Inspire />).toJSON();
expect(tree).toMatchSnapshot();
});
40 changes: 40 additions & 0 deletions src/components/inspire/__snapshots__/Inspire.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 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>
`;
20 changes: 20 additions & 0 deletions src/containers/home/home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import Inspire from "../../components/inspire/Inspire";
import { useTranslation } from "react-i18next";

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

return (
<div>
<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>
);
}
15 changes: 14 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{}
{
"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"
}
}
}
Loading