-
Notifications
You must be signed in to change notification settings - Fork 39
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
Kunzite 2 - Angie, Danica, Alejandra #10
base: main
Are you sure you want to change the base?
Conversation
…e of board delete button, adjusts font size of board title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very light bit of feedback.
@@ -0,0 +1,49 @@ | |||
import axios from "axios"; | |||
|
|||
export const postBoard = async (newBoard) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Love seeing helper functions wrapping your various API calls!
export const postBoard = async (newBoard) => { | ||
try { | ||
const response = await axios.post( | ||
"https://cada-inspo-board.onrender.com/boards", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider placing the base url portion of the endpoints (https://cada-inspo-board.onrender.com
) in a variable, and using that to interpolate the endpoint path (using backtick strings).
}; | ||
|
||
const onDelete = () => { | ||
deleteOneBoard(boardID).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the other API functions here async
-style, but this one uses .then
? Try to keep a consistent style, only switching to a different style when there's a meaningful reason to do so. Otherwise, readers of the code will end up spending tie wondering about why there is a difference when none was required.
const [cards, setCards] = useState([]); | ||
const [board, setBoard] = useState({}); | ||
const [showForm, setShowForm] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider lifting the state related to the board and cards up to App and just passing in the data this component should display as props.
const [isEditing, setIsEditing] = useState(false); | ||
const [editedMessage, setEditedMessage] = useState(message); | ||
const [warning, setWarning] = useState(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ulinke the state in the Board
component, these pieces of state are related to UI concerns in the card component. As a result, this is an appropriate use of state that isn't lifted up, similar to the state in the NewCardForm and NewBoardForm.
No description provided.