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

Hamada Abdelaal #136

Open
wants to merge 16 commits into
base: empty
Choose a base branch
from
Open

Hamada Abdelaal #136

wants to merge 16 commits into from

Conversation

Hamada-AB
Copy link

No description provided.

import HomePage from "./components/HomePage";
import MainPage from "./components/MainPage";

const baseURL = "http://localhost:5000";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to env var

Comment on lines +20 to +36
{!token ? (
<HomePage
successfulMessage={successfulMessage}
setSuccessfulMessage={setSuccessfulMessage}
setToken={setToken}
setUserInfo={setUserInfo}
baseURL={baseURL}
/>
) : (
<MainPage
token={token}
setToken={setToken}
setSuccessfulMessage={setSuccessfulMessage}
userInfo={userInfo}
baseURL={baseURL}
/>
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{!token && <HomePage...}
{token && <MainPage...}

@@ -0,0 +1,19 @@
export default function DeleteModal({ show, setShow, handleConfirm, id }) {
const showHideClassName = show ? "modal display-block" : "modal display-none";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const showHideClassName = `modal display-${show ? 'block' : 'none'}`

Comment on lines +14 to +17
// To sign out
setToken("");
setSuccessfulMessage("");
localStorage.removeItem("jwt");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to a named function

if (data && !data.error) {
setMovies(movies.filter((movie) => movie.id !== id));
setShow(false);
console.log(data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boooooo

})
.then((res) => res.json())
.then((data) => {
console.log(data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boooooooooooooooooooooooooooooooooooooo

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.

2 participants