-
Notifications
You must be signed in to change notification settings - Fork 134
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
base: empty
Are you sure you want to change the base?
Hamada Abdelaal #136
Conversation
import HomePage from "./components/HomePage"; | ||
import MainPage from "./components/MainPage"; | ||
|
||
const baseURL = "http://localhost:5000"; |
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.
Move this to env var
{!token ? ( | ||
<HomePage | ||
successfulMessage={successfulMessage} | ||
setSuccessfulMessage={setSuccessfulMessage} | ||
setToken={setToken} | ||
setUserInfo={setUserInfo} | ||
baseURL={baseURL} | ||
/> | ||
) : ( | ||
<MainPage | ||
token={token} | ||
setToken={setToken} | ||
setSuccessfulMessage={setSuccessfulMessage} | ||
userInfo={userInfo} | ||
baseURL={baseURL} | ||
/> | ||
)} |
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.
{!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"; |
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.
const showHideClassName = `modal display-${show ? 'block' : 'none'}`
// To sign out | ||
setToken(""); | ||
setSuccessfulMessage(""); | ||
localStorage.removeItem("jwt"); |
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.
Move to a named function
if (data && !data.error) { | ||
setMovies(movies.filter((movie) => movie.id !== id)); | ||
setShow(false); | ||
console.log(data); |
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.
boooooo
}) | ||
.then((res) => res.json()) | ||
.then((data) => { | ||
console.log(data); |
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.
boooooooooooooooooooooooooooooooooooooo
No description provided.