Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangWeiNgoh committed Jun 22, 2020
2 parents 3770cc0 + 923790f commit 994219e
Show file tree
Hide file tree
Showing 19 changed files with 16,082 additions and 143 deletions.
15,245 changes: 15,245 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
<<<<<<< HEAD
"name": "cpf-hackathon",
"version": "0.1.0",
"private": true,
Expand Down Expand Up @@ -42,4 +43,49 @@
"last 1 safari version"
]
}
=======
"name": "cpf-hackathon",
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.27",
"@fortawesome/free-solid-svg-icons": "^5.12.1",
"@fortawesome/react-fontawesome": "^0.1.8",
"@styled-icons/octicons": "^10.1.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"bootstrap": "^4.4.1",
"react": "^16.13.0",
"react-bootstrap": "^1.0.0-beta.17",
"react-dom": "^16.13.0",
"react-icons": "^3.9.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.0",
"styled-components": "^5.0.1",
"typeface-open-sans": "0.0.75",
"typeface-quicksand": "^1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"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"
]
}
>>>>>>> master
}
5 changes: 5 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link
href="https://fonts.googleapis.com/css?family=Lato&display=swap"
rel="stylesheet"
/>
<!--
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 All @@ -24,6 +28,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->

<title>React App</title>
</head>
<body>
Expand Down
Binary file removed public/logo512.png
Binary file not shown.
5 changes: 1 addition & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import React from "react";
import { BrowserRouter as Router, Switch } from "react-router-dom";

import routes from "./routes";

import Navbar from "./components/Navbar";
import Footer from "./components/Footer";

function App() {
export default function App() {
return (
<Router>
<div className="d-flex flex-column min-vh-100">
Expand All @@ -21,5 +20,3 @@ function App() {
</Router>
);
}

export default App;
32 changes: 32 additions & 0 deletions src/asset/favourites.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"0": {
"icon": "FaHome",
"title": "CPF Housing Usage",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae auctor eu augue ut lectus."
},
"1": {
"icon": "FaCalculator",
"title": "Mortgage Calculator",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Wres bes awer."
},
"2": {
"icon": "FaHome",
"title": "CPF Housing Usage with a very very long title",
"description": "Hard choices, easy life. Easy choices, hard life."
},
"3": {
"icon": "FaGraduationCap",
"title": "Education",
"description": "Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught."
},
"4": {
"icon": "FaRegMoneyBillAlt",
"title": "Investment",
"description": "Description goes here"
},
"5": {
"icon": "FaRegStickyNote",
"title": "Statements",
"description": "Description goes here"
}
}
56 changes: 56 additions & 0 deletions src/asset/recommendations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"0": {
"icon": "FaCalculator",
"title": "Ordinary Account (OA)",
"slug": "/ordinary_account",
"description": "Description goes here"
},
"1": {
"icon": "FaCalculator",
"title": "Special Account (SA)",
"slug": "/special_account",
"description": "Description goes here"
},
"2": {
"icon": "FaCalculator",
"title": "Medisave Account (MA)",
"slug": "/medisave_account",
"description": "Description goes here"
},
"3": {
"icon": "FaCalculator",
"title": "Apply/change GIRO for Repayment of Education Loan",
"slug": "/giro_education",
"description": "Description goes here"
},
"4": {
"icon": "FaCalculator",
"title": "Defer Repayment",
"slug": "/defer_repayment",
"description": "Description goes here"
},
"5": {
"icon": "FaCalculator",
"title": "Change Monthly Instalment",
"slug": "/monthly_instalment",
"description": "Description goes here"
},
"6": {
"icon": "FaCalculator",
"title": "CPFIS Self-Awareness Questionnaire (SAQ) Status",
"slug": "/saq_status",
"description": "Description goes here"
},
"7": {
"icon": "FaCalculator",
"title": "Apply to Withdraw",
"slug": "/apply_withdraw",
"description": "Description goes here"
},
"8": {
"icon": "FaCalculator",
"title": "Apply to Transfer",
"slug": "/apply_transfer",
"description": "Description goes here"
}
}
109 changes: 109 additions & 0 deletions src/components/FavouriteAddButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import React from "react";
import { MdAddCircle } from "react-icons/md";
import { IconContext } from "react-icons";
import styled from "styled-components";

const Wrapper = styled.div`
padding: 15px;
cursor: pointer;
`;

const Card = styled.div`
padding: 20px;
width: 280px;
height: 280px;
border-radius: 20px;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
`;

const Button = styled.div`
height: 70px;
width: 70px;
margin-bottom: 1rem;
border-radius: 40px;
box-shadow: 0 5px 15px 0 rgba(70, 70, 70, 0.15);
background: #40514e;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
&:hover {
box-shadow: 0 5px 15px 0 rgba(70, 70, 70, 0.5);
transition: all 0.5s ease-out;
}
`;

export default function AddButton(props) {
const { addButtonHandler } = props;

return (
<Wrapper>
<Card>
<Button
onClick={() => {
addButtonHandler();
}}
>
<IconContext.Provider value={{ color: "#ffffff", size: "36px" }}>
<MdAddCircle />
</IconContext.Provider>
</Button>
<p>Add items</p>
</Card>
</Wrapper>
);
}

// import React from "react";
// import { Button, Col, Container } from "react-bootstrap";
// // import Favourites_card from "./Favourites_card";
// import { IoIosAddCircle } from "react-icons/io";
// import { IconContext } from "react-icons";
// import styled from "styled-components";
// import Favourites_addon from "./Favourites_addon";

// const Add_Button = styled(Button)`
// background-color: gray;
// border-radius: 100%;
// `;

// const Container_ = styled(Container)`
// // border-style: solid;
// height: 300px;
// // padding-top: 50px;
// // padding-right: 50px;
// // padding-bottom: 50px;
// // padding-left: 50px;
// padding: 40%;
// text-align: center;
// `;

// function Favourites_addbutton(props) {
// const [modalShow, setModalShow] = React.useState(false);
// const { Items, data } = props;
// console.log(Items);
// return (
// <Col sm={4}>
// <Container_>
// <Add_Button variant="secondary" onClick={() => setModalShow(true)}>
// <IconContext.Provider value={{ size: "45px", color: "white" }}>
// <IoIosAddCircle />
// </IconContext.Provider>
// </Add_Button>
// <Favourites_addon
// Items={Items}
// data={data}
// show={modalShow}
// onHide={() => setModalShow(false)}
// />
// </Container_>
// </Col>
// );
// }

// export default Favourites_addbutton;
104 changes: 104 additions & 0 deletions src/components/FavouriteCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import React from "react";
import * as FAIcon from "react-icons/fa";
import { IconContext } from "react-icons";
import styled from "styled-components";

const Wrapper = styled.div`
padding: 15px;
`;

const Card = styled.div`
padding: 20px;
width: 280px;
height: 280px;
border-radius: 20px;
overflow: hidden;
cursor: pointer;
&:hover {
box-shadow: 0 5px 15px 0 rgba(70, 70, 70, 0.5);
transition: all 0.5s ease-out;
}
${props => {
if (props.selected) {
return `
box-shadow: 0 5px 15px 0 rgba(70, 70, 70, 0.5);
border: rgba(17, 153, 158, 0.7);
border-width: 2px;
border-style: solid;
transition: all 0.5s ease-out;
`;
} else {
return `
box-shadow: 0 5px 15px 0 rgba(70, 70, 70, 0.15);
border: transparent;
border-width: 2px;
border-style: solid;
transition: all 0.5s ease-out;
`;
}
}}
`;

const defaults = require("../asset/favourites.json")["0"];

export default function FavouritesCard(props) {
const { icon, title, description } = props.data || defaults;
const selected = props.selected || false;
const handleClick = props.onClick;

return (
<Wrapper onClick={handleClick}>
<Card selected={selected}>
<IconContext.Provider value={{ color: "11999e", size: "64px" }}>
{React.createElement(FAIcon[icon])}
</IconContext.Provider>
<h2 className="my-2">
{title.length > 25 ? title.substring(0, 25) + "..." : title}
</h2>
<p>
{description.length > 85
? description.substring(0, 85) + "..."
: description}
</p>
</Card>
</Wrapper>
);
}

// import React from "react";
// import { Row, Container } from "react-bootstrap";
// import * as MaterialDesign from "react-icons/fa";
// import { IconContext } from "react-icons";
// import styled from "styled-components";
// import "./test.css";

// const IconContext_ = styled(IconContext)`
// // border-style: solid;
// align: center;
// `;

// function Favourites_card(props) {
// console.log(props);
// const { icon, header, description } = props.data;
// const mdIcon = MaterialDesign[icon];
// const size_ = props.size;
// console.log(size_);
// console.log({ mdIcon });
// return (
// <Container>
// <IconContext_.Provider value={{ color: "11999e", size: size_ }}>
// <Row>{React.createElement(mdIcon)}</Row>
// </IconContext_.Provider>
// <Row>
// <h4 className="title">{header}</h4>
// </Row>
// <Row className="hide">
// <p className="body p">{description}</p>
// </Row>
// </Container>
// );
// }

// export default Favourites_card;
Loading

0 comments on commit 994219e

Please sign in to comment.