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

Sharks inspir-adies Kassidy B., Gricelda M., Lauren K., Camilla #34

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
64d3a0f
install done
buslakj Jun 27, 2022
64d7569
Added Components and began CSS
buslakj Jun 28, 2022
db94e90
Building out Board and New Board Form
GitHub4Gigi Jun 29, 2022
f77bd57
changes to card and card list component
buslakj Jun 29, 2022
595b402
Trying to create a button that we can click on for show/hide board
GitHub4Gigi Jun 29, 2022
eb95ee5
cards,cardlist, and forms done
buslakj Jun 29, 2022
1559c08
form updates
buslakj Jun 29, 2022
6512e8f
Fixed board_Id
GitHub4Gigi Jun 29, 2022
e2ab98a
Fixed BoardId
GitHub4Gigi Jun 29, 2022
5a74ada
routes added, changes to components
buslakj Jun 30, 2022
9d31fc4
Merge branch 'kb_branch' into main
buslakj Jun 30, 2022
6789b02
changed jsx to js, small adjustments to component files
buslakj Jun 30, 2022
33e3d72
updated code in NewCardForm, NewBoardForm, added file BoardList, modi…
lkleinert Jun 30, 2022
c3346cc
merge
GitHub4Gigi Jun 30, 2022
b7df030
Resolved merge conflict with board.js
lkleinert Jul 1, 2022
ab7ce4f
accepted merge
GitHub4Gigi Jul 1, 2022
b8710b3
Added dummy data to App.js, passed props into nested components
lkleinert Jul 1, 2022
485c386
Resolved merge conflict with App.js
lkleinert Jul 1, 2022
29f6e59
updated .css files, app.js, and routes
buslakj Jul 1, 2022
9add698
fixed merge conflict and changed .css
buslakj Jul 1, 2022
98998a5
similar changes
buslakj Jul 1, 2022
cb96e26
merge
GitHub4Gigi Jul 1, 2022
85df8b4
fixed merge
GitHub4Gigi Jul 1, 2022
ab0c89f
Created new branch; made ultimate source of truth App.js, created eve…
lkleinert Jul 2, 2022
756f027
changes
lkleinert Jul 18, 2022
bcd253c
merge sendingstate branch into main
lkleinert Jul 18, 2022
80bda20
changed routes/board.js to routes/chosenboard.js
buslakj Jul 19, 2022
fc472d1
merge
GitHub4Gigi Jul 19, 2022
8172c29
merge
GitHub4Gigi Jul 19, 2022
b098d64
merge conflicts resolved
buslakj Jul 19, 2022
71c2d91
props being passed successfully
buslakj Jul 19, 2022
3a0570e
removed card code will be putting in cardlist
GitHub4Gigi Jul 20, 2022
d24df38
squashed the bugs
buslakj Jul 20, 2022
725a9b9
resolved conflicts
buslakj Jul 20, 2022
610f2f7
First axios call made
buslakj Jul 20, 2022
4ea008d
pushing code
GitHub4Gigi Jul 20, 2022
d93a92b
commented out card axios call
buslakj Jul 20, 2022
fdaecf7
axios call for retrieving cards is done
buslakj Jul 20, 2022
5a49fb4
More axios calls
buslakj Jul 21, 2022
484eafc
the last axios call is done
buslakj Jul 21, 2022
ba3f715
Removed console.log
GitHub4Gigi Jul 21, 2022
abf8524
deleted unnecessary console.logs
buslakj Jul 21, 2022
679bf66
Merge branch 'main' of https://github.com/camilla122333/front-end-ins…
buslakj Jul 21, 2022
5eb16a2
Adds correct PropTypes, removes comments
camilla122333 Jul 21, 2022
a4b28b0
newboard.js changes
buslakj Jul 21, 2022
2308500
Renames board.css to ChosenBoard.css
camilla122333 Jul 21, 2022
5c380fa
Pushing css
GitHub4Gigi Jul 21, 2022
65d98b1
completed error handling for empty or too long messages
lkleinert Jul 22, 2022
ef025a6
Updated CSS
GitHub4Gigi Jul 22, 2022
bfae01d
Spacing fixed
GitHub4Gigi Jul 22, 2022
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
71 changes: 68 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
# Inspiration Board: Front-end Layer
# Getting Started with Create React App

This scaffold only includes a `.gitignore` file.
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

To get started, follow the setup directions described in the project.
## 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)
5 changes: 5 additions & 0 deletions README.old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Inspiration Board: Front-end Layer

This scaffold only includes a `.gitignore` file.

To get started, follow the setup directions described in the project.
40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"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": "^0.27.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "6",
"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"
]
}
}
Binary file added public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions 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 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 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 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 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:
64 changes: 64 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
html{
background-color: #CBB6FF;
background-image: linear-gradient( #FFD6FF,#C8B6FF);
background-size: cover;
background-repeat: no-repeat;
background-attachment: scroll;
margin: 0 auto;
}
.app{
font-family: 'Courier New';
}
.App-title {
display: flex;
justify-content: center;
font-size: calc(10px + 2vmin);
font-family: 'Courier New';
color: black;
padding-top: 50px;
}

.routes{
display:flex;
justify-content: space-evenly;
font-family: 'Courier New', Courier, monospace;
font-size: 20px;
}

.create-board{
background-color: #f3f3f3;
padding: .9em;
border-radius: 15px;
font-family: 'Courier New';
}

.choose-board{
background-color: #f3f3f3;
padding: .9em;
border-radius: 15px;
font-family: 'Courier New';
width: 25%

}

.InspoContainers{
display: flex;
justify-content: space-evenly;
}


.newBoardForm{
background-color: #f3f3f3;
padding: .75em;
border-radius: 10px;
width: 300px;
height: 450px;

}
.inspoList{
background-color: #f3f3f3;
padding: .75em;
border-radius: 10px;
width: 300px;
height: 450px;
}
96 changes: 96 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import "./App.css";
import { React, useState, useEffect } from "react";
import { Routes, Route, Link, BrowserRouter as Router } from "react-router-dom";
import NewBoard from "./routes/newBoard";
import BoardDisplay from "./routes/ChosenBoard";
import axios from "axios";

function App() {
const [boardData, setBoardData] = useState([]);
const [selectedBoard, setSelectedBoard] = useState([]);

const getBoards = () => {
axios
.get(`${process.env.REACT_APP_BACKEND_URL}/boards`)
.then((response) => {
console.log(response.data);
const dbBoards = response.data.map((board) => {
const { boardId, title, owner } = board;
return { boardId, title, owner };
});
setBoardData(dbBoards);
})
.catch((err) => {
console.log(err);
});
};

useEffect(() => {
getBoards();
}, []);

// POST request
const onAddBoard = ({ owner, title }) => {
axios
.post(`${process.env.REACT_APP_BACKEND_URL}/boards`, { owner, title })
.then(() => {
getBoards();
})
.catch((error) => {
console.log(error);
});
};

//updates state for newly selected board from drop-down menu.
const selectNewBoard = (e) => {
const boardId = e.target.value;
const newSelectedBoard = boardData.filter(
(board) => board.boardId == boardId
);
console.log(newSelectedBoard);
setSelectedBoard(newSelectedBoard[0]);
};

//displays board choices on drop down
const boardOptions = boardData.map((board) => {
return (
<option key={board.boardId} value={board.boardId}>
{board.title}
</option>
);
});

return (
<Router>
<header>
<h1 className="App-title">Inspiration Board</h1>
<nav className="routes">
<Link to="/create" className="choose-board">
{" "}
Create an Inspiration Board
</Link>
<Link to="/">Home</Link>
<Link to="/allboards" className="choose-board">
<section>Inspiration board</section>
<select onChange={selectNewBoard}>
<option>Choose an inspiration board</option>
{boardOptions}
</select>
</Link>
</nav>
</header>
<Routes>
<Route
path="/create"
element={<NewBoard addBoardCallback={onAddBoard} />}
/>
<Route
path="/allboards"
element={<BoardDisplay selectedBoard={selectedBoard} />}
/>
</Routes>
</Router>
);
}

export default App;
8 changes: 8 additions & 0 deletions 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();
// });
31 changes: 31 additions & 0 deletions src/components/Card.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.card-interior {
box-shadow: -10px 0px 10px 1px #aaaaaa;
color: #000;
background: #f4eca4;
display: inline-flex;
flex-direction: column;
height: 12em;
width: 12em;
margin: 1em;
/* padding: 1em; */
text-decoration: none;
text-align: center;
}

.message {
font-family: 'Courier New';
font-weight: bolder;
padding: 10px;
}

.buttons-box {
align-self: stretch;
display: flex;
flex-direction: row;
justify-content: space-evenly;
margin-top: auto;
}

.item-in-box {
margin: 5px;
}
Loading