Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fcc309d
initial commit with axios, firebase and env set up
normanlikescats Mar 9, 2023
f793a95
setup firebase stuff and movie API
normanlikescats Mar 9, 2023
ef0ab71
set up router and basic components to build out
normanlikescats Mar 9, 2023
db4da73
built login/register page
normanlikescats Mar 10, 2023
3c0476b
set up create a review page, movie specific page and api calls
normanlikescats Mar 11, 2023
8e2cffe
created movies database for movies with reviews and home feed to show…
normanlikescats Mar 12, 2023
b88c371
add edit and delete buttons (v1, not final, not great)
normanlikescats Mar 13, 2023
3e15724
add context to signin and signup
normanlikescats Mar 14, 2023
e02fd7b
insert create a profile page and allow profile picture upload
normanlikescats Mar 14, 2023
f33b087
passed user display name and user pfp through to reviews, allowed edi…
normanlikescats Mar 15, 2023
8363c94
added functionality to view other profiles and to be able to click pr…
normanlikescats Mar 15, 2023
3643bed
fixed database issue
normanlikescats Mar 15, 2023
c113894
allow users to edit profile if its their own
normanlikescats Mar 15, 2023
c82382e
fixed issues with deleting reviews
normanlikescats Mar 16, 2023
0a3bb26
add watched function
normanlikescats Mar 17, 2023
f9c8932
added average rating feature
normanlikescats Mar 17, 2023
743841a
add styling for movie page
normanlikescats Mar 18, 2023
bc572cb
finished styling on movie page and create profile page
normanlikescats Mar 20, 2023
a2d2a42
add styling to user profile pages
normanlikescats Mar 20, 2023
51f3d1f
Merge pull request #2 from normanlikescats/main
normanlikescats Mar 21, 2023
8c1bc7a
Merge pull request #3 from normanlikescats/sidebar-code
normanlikescats Mar 21, 2023
e0c93ee
create a review css, and login css
normanlikescats Mar 21, 2023
483573a
Add-sidebar-data
Sandiprumba Mar 21, 2023
fcadee1
Merge pull request #4 from normanlikescats/sidebar-code
normanlikescats Mar 21, 2023
8aab0ba
Merge branch 'main' of github.com:normanlikescats/film-o-rama
normanlikescats Mar 21, 2023
b9a12de
edited sidebar
normanlikescats Mar 21, 2023
d091005
add horizontal navbar at top of screen on larger screens
normanlikescats Mar 21, 2023
fa67bea
changes
Sandiprumba Mar 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
.env
/node_modules
/.pnp
.pnp.js
Expand Down
1,516 changes: 1,510 additions & 6 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^1.3.4",
"firebase": "^9.17.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-icons": "^4.8.0",
"react-router-dom": "^6.8.2",
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
"start": "WATCHPACK_POLLING=true react-scripts start",
"build": "react-scripts build"
},
"eslintConfig": {
Expand Down
19 changes: 0 additions & 19 deletions src/App.css

This file was deleted.

20 changes: 0 additions & 20 deletions src/App.js

This file was deleted.

45 changes: 45 additions & 0 deletions src/Components/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
* {
margin: 0px;
padding: 0px;
}

.App {
text-align: center;
}

.App-header {
background-image: linear-gradient(to right, #243949 0%, #517fa4 100%);
background-blend-mode: multiply;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
padding: 70px 0 0 0;
cursor: pointer;
}

.display-name:hover {
text-decoration: underline;
}

@import url("https://fonts.googleapis.com/css2?family=Lato&display=swap");

* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: "Lato", sans-serif;
}
.Home,
.Add a Review,
.profile,
.Sign Out {
display: flex;
height: 90vh;
align-items: center;
justify-content: center;
font-size: 3rem;
}
40 changes: 40 additions & 0 deletions src/Components/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from "react";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import LandingPage from "./LandingPage";
import Login from "./Login";
import Feed from "./Feed";
import Error from "./Error";
import Movie from "./Movie";
import CreateProfile from "./CreateProfile";
import ReviewCreator from "./ReviewCreator";
import Profile from "./Profile";
import "./App.css";
import { AuthContextProvider } from "../Context/AuthContext";
import Navbar from "./NavBar";

function App() {
return (
<div className="App">
<header className="App-header">
<AuthContextProvider>
<BrowserRouter>
<Navbar />
<Routes>
<Route exact path="/" element={<LandingPage />} />
<Route path="/login" element={<Login />} />
<Route path="/feed" element={<Feed />} />
<Route path="*" element={<Error />} />
<Route path="/create-profile" element={<CreateProfile />} />
<Route path="/profile/:userId" element={<Profile />} />
<Route path="/movie/:movieId/:movietitle" element={<Movie />} />
<Route path="/create-review" element={<ReviewCreator />} />
<Route path="/" />
</Routes>
</BrowserRouter>
</AuthContextProvider>
</header>
</div>
);
}

export default App;
83 changes: 83 additions & 0 deletions src/Components/CreateProfile.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.profile-flex{
display: flex;
flex-direction: column;
justify-content: top;
margin-bottom: auto;
align-items:center;
}

.profile-pic {
height: 30vmin;
width: 30vmin;
object-fit: cover;
border-radius: 50%;
outline: 3px rgb(182, 216, 255) solid ;
margin: 10vmin 0 0 0;
}

.profile-buttons{
background-color: rgb(182, 216, 255);
outline: none;
color:rgb(20, 42, 82);
padding: 1vmin;
border-radius: 5px;
border-style: none;
transition: 0.3s;
align-self: center;
}

.profile-buttons:hover{
background-color: rgb(20, 42, 82);
color: rgb(255, 255, 255);
}

.profile-form{
display:flex;
flex-direction: column;
text-align: left;
font-size: large;
width:80vmin;
margin: 0 0 10vmin 0;
}

.form-fields{
border-radius: 5px;
padding: 0 0 0 1vmin;
margin: 1.5vmin 0 4vmin 0;
height: 2em;
border: none;
}

.form-fields:disabled{
background-color: rgba(214, 214, 214, 0.8);
color: rgb(57, 57, 57)
}

.file-upload::file-selector-button{
background-color: rgb(182, 216, 255);
outline: none;
color:rgb(20, 42, 82);
padding: 1vmin;
border-radius: 5px;
border-style: none;
transition: 0.3s;
}

.file-upload::file-selector-button:hover{
background-color: rgb(20, 42, 82);
color: rgb(255, 255, 255);
}

.profile-pic-div{
display: flex;
flex-direction: column;
justify-content:center;
align-items: center;
width: 80vw;
}

.file-upload-div{
display: flex;
flex-wrap: nowrap;
margin: 1vmin 0 5vmin 0;
}
83 changes: 83 additions & 0 deletions src/Components/CreateProfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import React from 'react';
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { UserAuth } from '../Context/AuthContext'
import { upload, setUserName,setDefaultPFP, database } from '../firebase';
import "./CreateProfile.css"
import { ref, push, set } from 'firebase/database';

const DB_USERS_KEY = "users";

export default function Profile (){
const navigate = useNavigate();
const { user , logout } = UserAuth();
const [ displayName, setDisplayName ] = useState('');
const [ profilePic, setProfilePic] = useState(null);
const [ loading, setLoading ] = useState(false);
const [ photoURL, setPhotoURL] = useState('https://i.pinimg.com/564x/9b/47/a0/9b47a023caf29f113237d61170f34ad9.jpg')

useEffect(()=>{
if(user ?.photoURL){
setPhotoURL(user.photoURL)
}
}, [user.photoURL])

useEffect(()=>{
setDisplayName(user.displayName)
},[])

function handleDisplayNameEdit(e){
setDisplayName(()=> e.target.value)
}

function handleSubmit(e){
e.preventDefault();
if(profilePic === null){
setDefaultPFP(photoURL, user, setLoading)
}
setUserName(displayName, user, setLoading).then(()=>{
addNewUserDB();
navigate("/feed")
})
}

function addNewUserDB (){
console.log('run')
set(ref(database, `${DB_USERS_KEY}/${user.uid}` ) , {
displayName: user.displayName,
photoURL: user.photoURL,
})
}

function handleFile(e){
if(e.target.files[0]){
setProfilePic(e.target.files[0])
}
}

function uploadProfilePic (){
upload(profilePic, user, setLoading);
}

return(
<div className="profile-flex">
<div className="profile-pic-div">
<img className ="profile-pic" src={photoURL} alt=''/><br/>
Profile Picture
<div className='file-upload-div'>
<input
className="file-upload"
type="file"
accept="image/*"
onChange = {handleFile}/>
<button className='profile-buttons' onClick = {uploadProfilePic} disabled={!profilePic || loading}>Upload</button>
</div>
</div>
<form id="profile-create" className="profile-form" onSubmit={handleSubmit}>
Email<input type="text" className="form-fields" disabled value = {user.email}/>
Display Name<input type='text' className="form-fields" value = {displayName} placeholder ={'Enter a Display Name'} onChange = {handleDisplayNameEdit}/>
<input className='profile-buttons' type="submit" value="Submit"/>
</form>
</div>
)
}
9 changes: 9 additions & 0 deletions src/Components/Error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export default function Error (){
return(
<div>
error
</div>
)
}
26 changes: 26 additions & 0 deletions src/Components/Feed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.feed-poster {
width: 30vmin;
height: 45vmin;
margin: 1.5vmin;
object-fit: cover;
border-radius: 5px;
box-sizing: border-box;
transition: 0.5s;
cursor: pointer;
}

.feed-poster:hover {
border: solid rgb(255, 255, 255) 2.5px;
}

.poster-button {
display: none;
}

.text-div {
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 5vmin 0 5vmin;
margin: 5vmin 0 5vmin 0;
}
Loading