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

Mythical-Mycology-Muse-Wilson-Dodson-Edwards-Joesph-c19 #24

Open
wants to merge 70 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
afddaf0
App created, axios added, .env made
WinsEdwards Jun 26, 2023
73d4773
Folder structure updated
WinsEdwards Jun 27, 2023
d27694d
Components initially outlined
WinsEdwards Jun 28, 2023
e01af40
added initial state definitions
WinsEdwards Jun 28, 2023
8ba6b65
removed logo
WinsEdwards Jun 28, 2023
83a8c3b
Component files set up
WinsEdwards Jun 28, 2023
cdc1183
Updating import statements
WinsEdwards Jun 28, 2023
2f88e77
Started board function
WinsEdwards Jun 28, 2023
952e4a4
incorporates dummy board data. updates to components
staceyjo Jun 28, 2023
e387eb1
commenting out code to remove error msg
staceyjo Jun 28, 2023
b4cc700
BoardList and Board updated
WinsEdwards Jun 28, 2023
a56a65e
adds new board form compoent
staceyjo Jun 30, 2023
ee85721
Updated App.js to invoice NewBoardForm and to include post functional…
WinsEdwards Jun 30, 2023
c4d6c47
added currentBoard function
staceyjo Jun 30, 2023
2b0ab8b
Added Initial boards call in useEffect and fixed minor bugs in NewBoa…
lindsaybolz Jul 17, 2023
0591ba4
Added cards call and cards list. Need to add the card component cont…
lindsaybolz Jul 17, 2023
6f25625
created axios call for addCard
WinsEdwards Jul 18, 2023
f2688fa
NewCardForm created and functioning
WinsEdwards Jul 18, 2023
fc0fe1b
Cards displaying and updating current board
WinsEdwards Jul 18, 2023
8b51ab0
Cards displaying for a given board
WinsEdwards Jul 18, 2023
1e91d87
addLike function created with axios call
WinsEdwards Jul 18, 2023
3d34e01
Change board bug fix
WinsEdwards Jul 18, 2023
f04f7af
Like button mushroom created and functional
WinsEdwards Jul 18, 2023
982bc85
Added remove card functionality and function
lindsaybolz Jul 18, 2023
c6096ff
Added required to form fields
lindsaybolz Jul 18, 2023
153e4c1
addded a required attribute to input
lindsaybolz Jul 18, 2023
efbe106
Addedd hiding functionality to newBoardForm
lindsaybolz Jul 18, 2023
d42a59d
added alphabetical sorting method and button
lindsaybolz Jul 18, 2023
9a1b113
Set up basic CSS grid format
WinsEdwards Jul 18, 2023
cb0e7ae
Added some formatting and background photo for main App styling
lindsaybolz Jul 18, 2023
0b6db53
Merge conflict
lindsaybolz Jul 18, 2023
377f667
FIXING MY MERGE CONFLICT!
lindsaybolz Jul 18, 2023
3f4a571
reverted/commented back to basic grid format
WinsEdwards Jul 18, 2023
e8e4a0e
Merge branch 'main' of https://github.com/lindsaybolz/front-end-inspi…
WinsEdwards Jul 18, 2023
39dc368
Cleaning up formatting
WinsEdwards Jul 18, 2023
9f1af4d
added background and adjusted styling header
staceyjo Jul 19, 2023
31d2485
Boards styled as post its
WinsEdwards Jul 19, 2023
722e2d1
added some styling for boards and cards
lindsaybolz Jul 19, 2023
90d48fb
styling for New Board Form
staceyjo Jul 19, 2023
8e43397
adds footer
staceyjo Jul 19, 2023
27420a7
Merge branch 'main' of https://github.com/lindsaybolz/front-end-inspi…
staceyjo Jul 19, 2023
01cd5a4
removed padding on lists
lindsaybolz Jul 19, 2023
96bc4a9
Adjusting location of boardlist and forms
WinsEdwards Jul 19, 2023
1481e36
Cardlist board title functioning
WinsEdwards Jul 19, 2023
5266c28
Cardlist hides when no board chosen
WinsEdwards Jul 19, 2023
da2c2d2
Sticky notes created for cards
WinsEdwards Jul 19, 2023
eb3aca8
styling for New Card Form
staceyjo Jul 19, 2023
0f8e99e
updates to hide form button
staceyjo Jul 19, 2023
ae2353d
background header color
staceyjo Jul 19, 2023
c06ae2f
Merge branch 'main' of https://github.com/lindsaybolz/front-end-inspi…
staceyjo Jul 19, 2023
5f20177
added a no-board-selected header
lindsaybolz Jul 19, 2023
0050665
Merge branch 'main' of https://github.com/lindsaybolz/front-end-inspi…
lindsaybolz Jul 19, 2023
e867579
Changed the grid and board formatting
lindsaybolz Jul 19, 2023
13dc5c9
Just a little cleanup
lindsaybolz Jul 19, 2023
1dacdda
adds background options
staceyjo Jul 19, 2023
0c1776f
removes extra ;
staceyjo Jul 19, 2023
0d97622
Merge branch 'main' of https://github.com/lindsaybolz/front-end-inspi…
staceyjo Jul 19, 2023
0a8bf39
adjusts font, color and styling
staceyjo Jul 20, 2023
69efd67
adds background image options for team to review
staceyjo Jul 20, 2023
ef1aa39
changes colors, fonts and styling
staceyjo Jul 20, 2023
5d562b8
adds more specific class name to manipulate styling
staceyjo Jul 20, 2023
5fd83e1
adjusts styling
staceyjo Jul 20, 2023
d8e63c3
adjusts font and colors
staceyjo Jul 20, 2023
0dcd15c
adjusts font and colors
staceyjo Jul 20, 2023
e55fcc5
adjusts font and color
staceyjo Jul 20, 2023
8227190
Updating board and card list to have same color scheme
lindsaybolz Jul 20, 2023
d719cd9
final updates and changes
staceyjo Jul 20, 2023
0593ee9
final updates before deployment
staceyjo Jul 20, 2023
2c8087b
package.json addition
WinsEdwards Jul 20, 2023
afd08a1
Changed the add like from the number to the mushroom
lindsaybolz Jul 21, 2023
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
Binary file added .DS_Store
Binary file not shown.
File renamed without changes.
70 changes: 70 additions & 0 deletions front-end-inspiration-board/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `yarn build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
File renamed without changes.
Binary file not shown.
Binary file not shown.
44 changes: 44 additions & 0 deletions front-end-inspiration-board/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "front-end-inspiration-board",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"axios": "^1.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"main": "index.js",
"license": "MIT",
"engines": {
"node": ">=16.0.0"
}
}
Binary file added front-end-inspiration-board/public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions front-end-inspiration-board/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
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/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
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>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added front-end-inspiration-board/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front-end-inspiration-board/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions front-end-inspiration-board/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions front-end-inspiration-board/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
45 changes: 45 additions & 0 deletions front-end-inspiration-board/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@import url('https://fonts.googleapis.com/css2?family=Macondo&display=swap');

.App {
height: 100vh;
width: 100vw;
margin: 0px;
padding: 0px;
/* background: url('https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1yZWxhdGVkfDN8fHxlbnwwfHx8fHw%3D&auto=format&fit=crop&w=800&q=60'); */
background: url('https://images.unsplash.com/photo-1651282462814-084f1039ea8d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1476&q=80');
/* background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80'); */
/* background: url('https://images.unsplash.com/photo-1523712999610-f77fbcfc3843?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80'); */
/* background: url('https://images.unsplash.com/photo-1473579935071-e01936af3039?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1469&q=80'); */
/* background: url('https://images.unsplash.com/photo-1448375240586-882707db888b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80'); */
/* background: url('https://images.unsplash.com/photo-1440847899694-90043f91c7f9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1563&q=80'); */
background-size: cover;
}

.Container {
text-align: center;
justify-content: center;
display: grid;
width: 90vw;
height: 98vh;
grid-template-columns: 33% 33% 33%;
grid-template-rows: 1/6 1/6 1/6 1/6 1/6 1/6;
row-gap: 5px;
column-gap:2px;
margin-left: 5%;
}

.Header{
text-align: center;
grid-column-start: 1;
grid-column-end: 4;
font-family: 'Macondo', cursive;
font-size: 70px;
color: #94cfd5;
text-shadow: 5px 5px 0px #3194cd, 4px 4px 8px #1946a1;
margin:5px;
padding:5px;
}

.Footer{
color: #fbaa22;
}
142 changes: 142 additions & 0 deletions front-end-inspiration-board/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import './App.css';
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import BoardList from './components/BoardList';
import NewBoardForm from './components/NewBoardForm';
import CardList from './components/CardList';
import NewCardForm from './components/NewCardForm'


const boardData = [
{
id: 1,
owner: "Winslow",
title: "My Favortie Mushrooms"
},
{
id: 2,
owner: "Stacey",
title: "Learning about local mushrooms"
},
{
id: 3,
owner: "Mikelle",
title: "Mushroom Manicures"
}
]

function App() {
const [boards, setBoards] = React.useState(boardData);
const [cards, setCards] = React.useState([])
const [currentBoardId, setCurrentBoardId] = React.useState(0)

useEffect(() => {
axios.get('https://m-cubed-api.onrender.com/boards')
.then(response => {
const newBoards = response.data
setBoards(newBoards)
})
}, []);

const sortCards = (cards) => {
const newCards = [...cards]
const sortedCards = newCards.sort(
(card1, card2) => (card1.message > card2.message) ? 1 : -1
);
setCards(sortedCards)
}

const addLike = (id) => {
axios.patch(`https://m-cubed-api.onrender.com/cards/${id}`)
.then(response => {
setCards(prevCards => {
const updatedCards = prevCards.map(card => {
return card.id===id ? {...card, likes: response.data.likes} : card
})
return updatedCards;
})
})
.catch((error) => {
console.log(error);
});
};

const addBoard = (newBoardData) => {
axios
.post(`https://m-cubed-api.onrender.com/boards`, newBoardData)
.then((response) => {
const newBoards = [...boards];

newBoards.push({
id: response.data.id,
owner: response.data.owner,
title: response.data.title,
});

setBoards(newBoards);
})
.catch((error) => {
console.log(error);
});
};

const addCard = (newCardData) => {
axios
.post(`https://m-cubed-api.onrender.com/boards/${currentBoardId}/cards`, newCardData)
.then((response) => {
const newCards = [...cards];

newCards.push({
id: response.data.id,
message: response.data.message,
likes: response.data.likes,
board: response.data.board
});
setCards(newCards);
})
.catch((error) => {
console.log(error);
});
};

const changeBoard = (id) => {
setCurrentBoardId(id);
axios.get(`https://m-cubed-api.onrender.com/boards/${id}/cards`)
.then(response => {
setCards(response.data);
});
};

const removeCard = (id) => {
axios.delete(`https://m-cubed-api.onrender.com/cards/${id}`)
.then(response => {
setCards(prevCards => {
const updatedCards = prevCards.filter(card => card.id !== id);

return updatedCards
})
});
}

return (
<main className='App'>
<div className='Container'>
<h1 className='Header'>Mythical Mycology Muse</h1>
<BoardList
boards={boards} changeBoardCallback={changeBoard}
/>
<NewBoardForm addNewBoardCallback={addBoard} />
<NewCardForm addNewCardCallback={addCard} />
<CardList
cards={cards}
addLikeCallback={addLike}
removeCardCallback={removeCard}
sortCardsCallback={sortCards}
/>
</div>
{/* <footer className='Footer'>2023 ADA Develeopers Academy. Group 5. Lindsay, Stacey, Stacy, Winslow. </footer> */}
</main>
);
}

export default App;
8 changes: 8 additions & 0 deletions front-end-inspiration-board/src/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { render, screen } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
Loading