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

Feature/marshall/create user model #14

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5d48ee1
integrated tailwind and antdesign
justiceotuya Apr 20, 2019
f4d5f33
removed taiwindcss and rewrote the readme
justiceotuya Apr 21, 2019
7884570
Merge pull request #2 from team-helpme/feature/justiceotuya/integrate…
uimarshall Apr 21, 2019
24daa0b
finished the Landing Page
justiceotuya Apr 24, 2019
e6f1ab5
added next.config.js to .eslintignore
justiceotuya Apr 24, 2019
a1abd99
fixed linting errors for the front page
justiceotuya Apr 24, 2019
d8e3395
deletes hound.yml and make changes to travis.yml
uimarshall Apr 24, 2019
3cf3911
Merge pull request #4 from team-helpme/feature/marshall/delete-hound
justiceotuya Apr 25, 2019
501acef
fixed Landing page Bug reported by travis ci
justiceotuya Apr 25, 2019
8235020
Merge pull request #3 from team-helpme/feature/justiceotuya/finished-…
uimarshall Apr 25, 2019
d375028
fixed Landing page linting
justiceotuya Apr 26, 2019
c3851a1
Merge pull request #5 from team-helpme/fix/justiceotuya/fixed-linting…
uimarshall Apr 26, 2019
976ce3c
add basic expess server set up and database set up in mlab
uimarshall Apr 27, 2019
08ade0b
remove Uche Nnadi as author in package.json file
uimarshall Apr 27, 2019
2cfa498
Merge pull request #6 from team-helpme/feature/marshall/basic-express…
uimarshall Apr 29, 2019
0995fc0
Merge branch 'master' of https://github.com/team-helpme/helpme
uimarshall May 2, 2019
ad478aa
creates the user model and tests for basic crud operation
uimarshall May 2, 2019
f521f69
deleted test/package.json
uimarshall May 2, 2019
a55ecf8
add jest-mongodb-config file for jest testing
uimarshall May 4, 2019
cc6171c
make module.exports = User = mongoose.model('users', UserSchema); int…
uimarshall May 9, 2019
cf2e827
modified User.js to create a new PR
uimarshall May 9, 2019
8c6102b
added ds_store to gitignore
justiceotuya May 13, 2019
27e3f21
refactored the landing page
justiceotuya May 13, 2019
3c1c139
refactored landing page and layout
justiceotuya May 14, 2019
2ee7d8a
made changes to file
justiceotuya May 15, 2019
7649664
made changes to file
justiceotuya May 15, 2019
474bbe7
made changes to file
justiceotuya May 15, 2019
0f4a222
made changes to file
justiceotuya May 15, 2019
78a2893
made changes to file
justiceotuya May 15, 2019
7cd2e3e
Merge pull request #14 from team-helpme/feature/justiceotuya/refactor…
uimarshall May 15, 2019
4a8b49c
Merge branch 'master' of https://github.com/team-helpme/helpme
uimarshall May 17, 2019
0eb9aab
Merge branch 'master' into feature/marshall/create-user-model
uimarshall May 17, 2019
247a07a
modified User model and remove test folder
uimarshall May 17, 2019
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
26 changes: 26 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"development": {
"presets": [
"next/babel"
]
},
"production": {
"presets": [
"next/babel"
]
},
"test": {
"presets": [
[
"next/babel",
{
"preset-env": {
"modules": "commonjs"
}
}
]
]
}
}
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
/tests/fixtures/**
/tests/performance/**
/tmp/**
next.config.js


# Add any other files or folders that you want eslint to ignore
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ build/Release
node_modules/
jspm_packages/
package-lock.json

.DS_Store
# TypeScript v1 declaration files
typings/

Expand Down
4 changes: 0 additions & 4 deletions .hound.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
language: node_js
node_js:
- "node"
script:
- npm run lint
- npm test
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# project-template
Document your applications API and general usage
# Project Help Me #

Help Me is an app that connects Depressed people to each other, essentially, it is a social network for depressed people

## Development ##

* clone the repo *
* ```cd helpme```
* ```npm install```
* ```npm run dev```


Antdesign is also used for the components, check <http://ant.design/docs/react/introduce>
123 changes: 123 additions & 0 deletions components/LandingPage/components/LandingPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
.LandingPage_footer {
background: #001529;
color: #ffffff;
text-align: center;
}

.LandingPage_footer > img {
width: 50%;
height: 50%;
margin-bottom: 1em;
}

.LandingPage_footer > ul {
list-style-type: none;
padding: 0;
}

.LandingPage_hero {
padding: 24px;
background: #ffffff;
display: flex;
flex-direction: column;
justify-content: center;
}

.LandingPage_hero > img {
width: 100%;
margin: 2em 0;
}
.LandingPage_content__text {
text-align: center;
}

.LandingPage_button {
margin-bottom: 2em;
}

.column-section > img {
width: 50%;
margin: 0 auto;
}

@media screen and (min-width: 425px) and (max-width: 767px) {
.LandingPage_hero > img {
width: 65%;
margin: 2em auto;
}

.column-section > img {
width: 30%;
margin-top: 0;
}
}

@media screen and (min-width: 768px) {


.LandingPage_hero {
flex-direction: row;
align-items: center;
}
.LandingPage_content__text {
margin: 2em;
}
.LandingPage_hero > img {
width: 40%;
}

.LandingPage_body > section {
margin: 0 6em;
}

.reverse {
flex-direction: row-reverse;
}

.column-section {
flex-direction: column;
}

.column-section > div {
margin-bottom: 0;
}

.column-section > img {
width: 20%;
margin-top: 0;
}



.LandingPage_footer {
text-align: left;
display: flex;
justify-content: space-evenly;
padding: 5em 50px;
}

.LandingPage_content {
height: 100%;
margin-top: 0;
}

.LandingPage_footer > img {
width: 120px;
height: 30px;
margin-bottom: 0;
}


}

@media screen and (min-width: 1024px) {
.LandingPage_body > section {
/* padding: 0 3em; */
}

.layout_header-desktop {
padding: 0 6em;
}


}
59 changes: 59 additions & 0 deletions components/LandingPage/components/LandingPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from 'react';
import 'antd/dist/antd.css';
import { Layout, Divider } from 'antd';
import './LandingPage.css';
import Paragraph from 'antd/lib/typography/Paragraph';
import LandingPageContent from './LandingPageContent';
import PageLayout from '../../Layout';
import { landingPageContents, pageTitle } from '../constants';

/**
* Function for displaying the landing page
*
* @function
* @return {Object} The landing page
*/

const LandingPage = () => (
<PageLayout
IsSiderPresent={false}
isFooterPresent
isAuthenticated={false}
title={pageTitle}
>
{
landingPageContents.map(landingPageContent => {
const {
paragraphText,
isButtonPresent,
columnSection,
isImagePresent,
imageLink,
level,
title,
reverseSection,
buttonText,
buttonLink,
} = landingPageContent;

return (
<LandingPageContent
key={paragraphText}
isButtonPresent={isButtonPresent}
columnSection={columnSection}
isImagePresent={isImagePresent}
imageLink={imageLink}
level={level}
paragraphText={paragraphText}
title={title}
reverseSection={reverseSection}
buttonText={buttonText}
buttonLink={buttonLink}
/>
);
})
}
</PageLayout>
);

export default LandingPage;
10 changes: 10 additions & 0 deletions components/LandingPage/components/LandingPage.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom';
import LandingPage from './index';

describe('LandingPage', () => {
it('should renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<LandingPage />, div);
});
});
83 changes: 83 additions & 0 deletions components/LandingPage/components/LandingPageContent.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import React from 'react';
import { Button, Typography } from 'antd';
import PropTypes from 'prop-types';
import { normalize } from 'path';
import Link from 'next/link';

const { Title, Paragraph } = Typography;

/**
* Function used to generate section layout content for landing page
* @function
* @param {Number} level - The Number from 1-5 representing the header level h1-h5
* @param {String} title- The Title of that Section
*@param {String} paragraphText- The Text of that section
* @param {Boolean} isButtonPresent- If true, a button is shown on that section
* @param {String} buttonText- the text on the button
* @param {String} buttonLink- the link that the button leads to
* @param {String} imageLink- the link to an image in the section
* @param {Boolean} reverseSection - if true, the image and section position is swapped
* @param {Boolean} isImagePresent - if true, the image is shown
* @param {Boolean} columnSection - if true, the section will be stacked
* @return {Object} The landing page content component which is used to populate the landing page
*/

export default function LandingPageContent(props) {
const {
level,
title,
paragraphText,
isButtonPresent,
buttonText,
buttonLink,
imageLink,
isImagePresent,
reverseSection,
columnSection,
} = props;

let className;

// this helps to structure the section, the section can be normalize, reversed or columnized
if (!reverseSection && !columnSection) {
className = 'LandingPage_hero';
} else if (reverseSection && !columnSection) {
className = 'LandingPage_hero reverse';
} else if (columnSection) {
className = 'LandingPage_hero column-section';
}

return (
<section className={className}>
<div className="LandingPage_content__text">
<Title level={level}>{title}</Title>
<Paragraph>{paragraphText}</Paragraph>
{/* displays button in a section */}
{
isButtonPresent ? (
<Button className="LandingPage_button" type="primary">
<Link href={buttonLink}>
<a>{buttonText}</a>
</Link>
</Button>
) : null
}
</div>

{/* displays image in a section */}
{isImagePresent ? <img src={imageLink} alt={`${title} image`} /> : null}
</section>
);
}
LandingPageContent.propTypes = {
level: PropTypes.number,
title: PropTypes.string,
paragraphText: PropTypes.string,
isButtonPresent: PropTypes.bool,
buttonText: PropTypes.string,
buttonLink: PropTypes.string,
isImagePresent: PropTypes.bool,
imageLink: PropTypes.string,
reverseSection: PropTypes.bool,
columnSection: PropTypes.bool,
};
4 changes: 4 additions & 0 deletions components/LandingPage/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

import LandingPage from './LandingPage';

export default LandingPage;
Loading