Skip to content

Commit

Permalink
added auth component to layout component (accidently removed before)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alucard2169 committed Jul 12, 2023
1 parent e3cfdcc commit e03a167
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ next-env.d.ts


# root env
.env
.env
# Local Netlify folder
.netlify
1 change: 1 addition & 0 deletions components/Auth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { userContext } from "@/context/userContext";
const Auth = () => {
const { setUser } = useContext(userContext);
const { formState, setFormState } = useContext(AuthFormContext);
console.log(formState)
const [state, setState] = useState("login");
const [focus, setFocus] = useState({
username: false,
Expand Down
2 changes: 2 additions & 0 deletions components/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Auth from "./Auth";
import Navbar from "./Navbar";

const Layout = ({ children }) => {
return (
<div>
<Navbar />
<Auth/>
{children}
</div>
);
Expand Down
1 change: 1 addition & 0 deletions context/authFormContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const AuthFormContext = createContext(null);

export const AuthFormContextProvider = ({ children }) => {
const [formState, setFormState] = useState(false);

return (
<AuthFormContext.Provider value={{ formState, setFormState }}>
{children}
Expand Down
2 changes: 1 addition & 1 deletion pages/movie/theme/[theme].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const MovieByName = ({ images, initialResult, error, theme }) => {
return () => {
window.removeEventListener("scroll", handleScroll);
};
}, [loading]);
}, [fetchMovies]); // Include fetchMovies in the dependency array

if (error) {
return (
Expand Down
2 changes: 1 addition & 1 deletion styles/Auth.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
}

.display {
display: flex;
display: flex;
}

@media only screen and (max-width: 800px) {
Expand Down

0 comments on commit e03a167

Please sign in to comment.