Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
99f5d94
Install npm and create component folder
amxra Sep 23, 2019
6012bd1
Install formik and create form component
amxra Sep 23, 2019
5cdfea1
Build SignUp form component
amxra Sep 23, 2019
ae7455e
created landing-page added components
SoosheBot Sep 23, 2019
dd4efcc
Install and import styled-component in sign-up.js
amxra Sep 23, 2019
eb4a10b
added data,renamed home and article content pages
SoosheBot Sep 23, 2019
16f493f
Style signUp form
amxra Sep 23, 2019
b38cd8a
added store, axioswithauth, newtutorial page
Sep 23, 2019
906fe07
updated home and data
SoosheBot Sep 23, 2019
5f79711
Pull Forrest's code
amxra Sep 23, 2019
0387251
Merge branch 'susheela' of https://github.com/Lambda-How-To-Build-Wee…
Sep 23, 2019
d4074e4
updated home
SoosheBot Sep 23, 2019
55ec7a5
Merge branch 'susheela' of https://github.com/Lambda-How-To-Build-Wee…
Sep 23, 2019
cdef1ff
started recieving data front backend, building out components
Sep 23, 2019
ef0eb78
edits to home.js
SoosheBot Sep 23, 2019
6008de8
Install dependencies
amxra Sep 24, 2019
e5a7dae
Updated branch
amxra Sep 24, 2019
a5b6e28
Install dependencies
amxra Sep 24, 2019
1185c05
First input for log-in form
amxra Sep 24, 2019
ae143ef
Fixed dependencies
Sep 24, 2019
9396b9a
updated data.js
SoosheBot Sep 24, 2019
1b8476f
Finished reducers and set up a finished tutorial card
Sep 24, 2019
4fc83a2
added home button to app.js, modified index.js to include Router
SoosheBot Sep 24, 2019
8fb9d88
articles displaying on page with errors
SoosheBot Sep 24, 2019
8703754
removed repeating form on home
SoosheBot Sep 24, 2019
1a96437
Complete Log-in page
amxra Sep 24, 2019
608b546
Fixed merge conflict
Sep 24, 2019
71024e0
Finalized mege issues, so everyones code is up-to-date
Sep 24, 2019
b2a821c
Create route and link for log-in
amxra Sep 24, 2019
8f6e8a0
added tutorial button to articles
SoosheBot Sep 24, 2019
b459370
updated new-tutorial button in articles
SoosheBot Sep 24, 2019
4cb4e6d
Added redux dependencies and fixed up registration/login pages, also …
Sep 24, 2019
20aad17
fixed images
SoosheBot Sep 24, 2019
b37a300
updated data.js fixed button in articles
SoosheBot Sep 24, 2019
e0e9f78
merging code
SoosheBot Sep 24, 2019
b8641fa
added styling
SoosheBot Sep 25, 2019
da99fe0
search-form experimenting
SoosheBot Sep 25, 2019
2469059
added searchbar to articles
SoosheBot Sep 25, 2019
2b2754f
updated search on articles
SoosheBot Sep 25, 2019
1251e3b
fixed login path on app.js for consistency
SoosheBot Sep 25, 2019
dde33ed
corrected syntax on login-form
SoosheBot Sep 25, 2019
a91219b
updated login to login-page
SoosheBot Sep 25, 2019
1ae5c9f
Fixed errors, combined code
Sep 25, 2019
d708be4
merging code
SoosheBot Sep 25, 2019
14176d1
Pull code from forrest
amxra Sep 25, 2019
86e31fb
Update
amxra Sep 25, 2019
1284007
added search to main nav
SoosheBot Sep 25, 2019
c5151ce
Update code
amxra Sep 25, 2019
0cab289
fixed styling sign-up
SoosheBot Sep 25, 2019
f686933
removed email from signup
SoosheBot Sep 25, 2019
cff4887
styled navbar
SoosheBot Sep 25, 2019
7e38194
updated search
SoosheBot Sep 25, 2019
770d10a
Linked all pages together, fixed API data, registering and logging in…
Sep 25, 2019
ff1ed97
Fixed route for complete Howto and coded it out
Sep 25, 2019
398ebcc
Adjust styling for nav in articles.js
amxra Sep 26, 2019
e612408
Update
amxra Sep 26, 2019
0da2e42
Adjust style for article.js
amxra Sep 26, 2019
0415ab2
Adjust routing for new tutorial and style for log-in page
amxra Sep 26, 2019
7ab9a1d
Add styling accross app
amxra Sep 26, 2019
f878da0
Update
amxra Sep 26, 2019
6c8d0f1
complete styling for new-tutorial.js
amxra Sep 26, 2019
f467cee
Fixed a couple of endpoints, working on finished tutorial to render. …
Sep 26, 2019
98635d3
Got Forms to actually render, touched up code, now working on edit an…
Sep 26, 2019
cc1ac17
Merge branch 'amiradediran' of https://github.com/Lambda-How-To-Build…
Sep 26, 2019
8931df0
Fix search to work
amxra Sep 26, 2019
a877c8e
updated search, code still broken
SoosheBot Sep 26, 2019
4ae19ea
corrected search merged code with team
SoosheBot Sep 26, 2019
da4ac64
merging changes across branches
SoosheBot Sep 26, 2019
7377733
Fixed some errors, working on endpoints with backend still
Sep 26, 2019
1ed58dd
Update all changes
amxra Sep 26, 2019
7140e93
Merging
Sep 26, 2019
1d5f544
updating files with latest code from team
SoosheBot Sep 26, 2019
5e881bf
Fixed up some stuff in app.js
Sep 26, 2019
43d6fb3
update
amxra Sep 26, 2019
e92f5a9
Fix route for signUp
amxra Sep 26, 2019
f86602d
test
Sep 26, 2019
b186eda
Finalizing stuff
Sep 26, 2019
8d27d3d
completing merge
SoosheBot Sep 26, 2019
f3408c4
update styling for logIn
amxra Sep 26, 2019
ae4d6e9
Added CSS and routed some components
Sep 27, 2019
67ccb92
updated styling
SoosheBot Sep 27, 2019
a7430b2
styling tweaks
SoosheBot Sep 27, 2019
0700dfb
images not displaying error
SoosheBot Sep 27, 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
13,387 changes: 13,387 additions & 0 deletions how-to/package-lock.json

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion how-to/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"formik": "^1.5.8",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.2"
"react-redux": "^7.1.1",
"react-router-dom": "^5.1.0",
"react-scripts": "3.1.2",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"styled-components": "^4.4.0",
"yup": "^0.27.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 2 additions & 0 deletions how-to/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="logo192.png" />
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Righteous&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 Down
Binary file added how-to/public/signup-background.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 39 additions & 4 deletions how-to/src/App.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,57 @@
*{
font-family: 'Lato', sans-serif;

}

h1,h2,h3,h4,p {
font-family: 'Righteous', cursive;

}


.App {
text-align: center;
height: 80vh;
color: #E76E3C;
}

.App-logo {
height: 40vmin;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
flex-direction: row;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #09d3ac;

.nav{
font-family: 'Righteous', cursive;
}

.nav-links a {
text-decoration: none;
color: #e76e3c;
font-weight: bold;
}

a{
text-decoration:none;
}

a:hover{
color: lightgrey;
}








52 changes: 35 additions & 17 deletions how-to/src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import React, { useState } from "react";
import { Route, Link } from "react-router-dom";
import "./App.css";
import SignUp from "./components/sign-up";
import Articles from "./components/articles";
import LogIn from "./components/logIn-form";
import data from "./data";
import NewTutorialForm from "./components/new-tutorial";
import MyItems from "./components/finished-tutorial";
import EditItem from "./components/edit-tutorial";


function App() {
const [items, setItems] = useState(data);
const [filteredItems, setFiltered] = useState(data);
const search = query => {
console.log(query);
const found = items.filter(item =>
item.title.toLowerCase().includes(query)
);
setFiltered(found);
};

const [post] = useState(data);

return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<Route exact path="/" component={SignUp} />
<Route path="/login" component={LogIn} />
<Route exact path="/edit-tutorial" component={EditItem} />
<Route exact path="/finished-tutorial" component={MyItems} />
<Route
exact
path="/articles"
render={props => (
<Articles {...props} articles={filteredItems} search={search} />
)}
/>
<Route path="/new-tutorial" component={NewTutorialForm} />
</div>
);
}
Expand Down
Binary file added how-to/src/IMG_8737.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions how-to/src/components/articles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
import React from 'react';
import { Route, Link } from 'react-router-dom';
import '../App.css';
import NewTutorialForm from './new-tutorial';
import posts from '../data';
import styled from 'styled-components';
import SearchForm from "./searchForm";


const StyledArticle = styled.div`
margin: 0;
padding:0;
box-sizing: border-box;

h2{
color: white;
}

.nav{
box-sizing: border-box;
width: 100vw;
margin-top: 0;
padding: 1rem 5rem;
background-color:#e76e3c;
display: flex;
align-items: center;
justify-content: space-between;
}

.nav a{
padding: 25px;
color: white;
font-family: 'Righteous', cursive;
}

.articles-header{
margin: 3rem;
}

.articles-list-wrapper {
width: 80%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}

.article-card {
width: 250px;
height: 350px;
margin: 2rem;
padding: 1rem;

@media only screen and (max-width: 600px){
margin-bottom: 0;
}
}

.article-card p {
text-align: center;
color: #595959;
}

.article-list-image {
width: 100%;
border: 1px solid lightgray;
}

a{
& h3{
color: #e76e3c;
}
}


.articles-button {
padding: 1rem 2rem;
postion: relative;
display: flex;
justify-content:space-between;
align-items: center;

}

.articles-button .md-button {
color: #fff;
background-color: #e76e3c;
padding: 1rem 2rem;

&:hover{
border: 1px solid #e76e3c;
background-color: white;
color: #e76e3c;
}

}
`


function Articles(props) {
return (
<StyledArticle className="articles-wrapper">
<div className = "nav">
<h2> How-to</h2>
</div>
<div className="articles-header">
<h1>Suggested Articles</h1>
</div>
<div className="articles-button">
<SearchForm search = {props.search}/>
<Link to="/new-tutorial" >
<button className="md-button new-tutorial-button">
Make a New Tutorial
</button>
</Link>
</div>
<Route path="/new-tutorial" component={NewTutorialForm} />
<div className="articles-list-wrapper">
{props.articles.map(post => (
<div className="article-card" key={post.id}>
<Link to={`/articles/${post.id}`}>
<img
className="article-list-image"
src={post.imageUrl}
alt={post.alt}
/>
<h3>{post.title}</h3>
</Link>
<p>{post.summary}</p>
</div>
))}
</div>
</StyledArticle>
);
}

export default Articles;
66 changes: 66 additions & 0 deletions how-to/src/components/edit-tutorial.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React, { useEffect, useState } from "react";
import axiosWitAuth from "../utils/axiosWithAuth";
import { NavLink } from "react-router-dom";

export default function EditItem(props) {
const editingState = {
item: "",
description: "",
steps: "",
tags: ""
};

const [stuff, setStuff] = useState(editingState);

const handleChange = e => {
setStuff({ ...stuff, [e.target.name]: e.target.value });
};

const handleSubmit = e => {
e.preventDefault();
axiosWitAuth()
.put(`/api/auth/:user_id/posts/:post_id/${props.match.params.id}`, stuff)
.then(res => {
setStuff(editingState);
props.history.push(`/finished-tutorial`);
})
.catch(err => console.log(err));
};
console.log(stuff);
return (
<div className="updateContainer">
<h1>Update Item</h1>
<form className="update-form" onSubmit={handleSubmit}>
<input
type="text"
name="item"
value={stuff.item}
onChange={handleChange}
placeholder="Name"
></input>
<input
type="text"
name="description"
value={stuff.description}
onChange={handleChange}
placeholder="Description"
></input>
<input
type="text"
name="steps"
value={stuff.steps}
onChange={handleChange}
placeholder="Steps"
></input>
<input
type="text"
name="tags"
value={stuff.tags}
onChange={handleChange}
placeholder="Tags"
></input>
<button className="updateButton">Update</button>
</form>
</div>
);
}
Loading