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

Kunzite 2 - Angie, Danica, Alejandra #10

Open
wants to merge 86 commits into
base: main
Choose a base branch
from

Conversation

adom2128
Copy link

No description provided.

adom2128 and others added 30 commits June 23, 2023 13:48
angiekimtran and others added 29 commits July 18, 2023 11:46
…e of board delete button, adjusts font size of board title
Copy link

@anselrognlie anselrognlie left a 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) => {

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",

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(() => {

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.

Comment on lines +10 to +12
const [cards, setCards] = useState([]);
const [board, setBoard] = useState({});
const [showForm, setShowForm] = useState(false);

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.

Comment on lines +6 to +8
const [isEditing, setIsEditing] = useState(false);
const [editedMessage, setEditedMessage] = useState(message);
const [warning, setWarning] = useState("");

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants