diff --git a/src/ApplicationViews.js b/src/ApplicationViews.js index e69de29..be5aef0 100644 --- a/src/ApplicationViews.js +++ b/src/ApplicationViews.js @@ -0,0 +1,16 @@ +import React from "react"; +import { Route } from "react-router-dom"; + + +export const ApplicationViews = () => { + + return ( + + <> + + + + + > + ) +} \ No newline at end of file diff --git a/src/auth/Login.js b/src/auth/Login.js new file mode 100644 index 0000000..962ffc0 --- /dev/null +++ b/src/auth/Login.js @@ -0,0 +1,68 @@ +import React, { useRef } from "react" +import { Link, useHistory } from "react-router-dom" +import "./Auth.css" + + +export const Login = () => { + const username = useRef() + const password = useRef() + const invalidDialog = useRef() + const history = useHistory() + + const handleLogin = (e) => { + e.preventDefault() + + return fetch("http://127.0.0.1:8000/login", { + method: "POST", + headers: { + "Content-Type": "application/json", + "Accept": "application/json" + }, + body: JSON.stringify({ + username: username.current.value, + password: password.current.value + }) + }) + .then(res => res.json()) + .then(res => { + if ("valid" in res && res.valid && "token" in res) { + localStorage.setItem("sf_token", res.token) + history.push("/") + } + else { + invalidDialog.current.showModal() + } + }) + } + + return ( + + + Username or password was not valid. + invalidDialog.current.close()}>Close + + + + SmugFolio + Please sign in + + Username address + + + + Password + + + + Sign In + + + + + Register + + + ) +} diff --git a/src/auth/Register.js b/src/auth/Register.js new file mode 100644 index 0000000..e69de29 diff --git a/src/home/Home.js b/src/home/Home.js new file mode 100644 index 0000000..e69de29 diff --git a/src/home/HomeManager.js b/src/home/HomeManager.js new file mode 100644 index 0000000..e69de29 diff --git a/src/images/MyImageManager.js b/src/images/MyImageManager.js new file mode 100644 index 0000000..e69de29 diff --git a/src/images/MyImages.js b/src/images/MyImages.js new file mode 100644 index 0000000..e69de29 diff --git a/src/nav/NavBar.js b/src/nav/NavBar.js new file mode 100644 index 0000000..e69de29 diff --git a/src/profile/EditProfile.js b/src/profile/EditProfile.js new file mode 100644 index 0000000..e69de29 diff --git a/src/profile/Profile.js b/src/profile/Profile.js new file mode 100644 index 0000000..e69de29 diff --git a/src/profile/ProfileManager.js b/src/profile/ProfileManager.js new file mode 100644 index 0000000..e69de29 diff --git a/src/tags/PhotosByTag.js b/src/tags/PhotosByTag.js new file mode 100644 index 0000000..e69de29 diff --git a/src/tags/SelectTags.js b/src/tags/SelectTags.js new file mode 100644 index 0000000..e69de29 diff --git a/src/tags/TagManager.js b/src/tags/TagManager.js new file mode 100644 index 0000000..e69de29