Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b7b3a69
First frank commit
Frank-cntrl Jul 11, 2025
1e01aab
Franks first commit
Frank-cntrl Jul 11, 2025
499c5ab
Initial commit
AlexNurci Jul 11, 2025
3094294
Made profile/me view
Frank-cntrl Jul 14, 2025
a56cbc4
Added friends page with placeholder photos and css
AlexNurci Jul 14, 2025
d0f19b3
Merge pull request #3 from TabulaRasae/frank
AlexNurci Jul 14, 2025
1ff1273
Merge branch 'main' into alex
AlexNurci Jul 14, 2025
fd94651
Merge pull request #4 from TabulaRasae/alex
Frank-cntrl Jul 14, 2025
2431ada
Solved URL error
AlexNurci Jul 14, 2025
715f518
Merge pull request #5 from TabulaRasae/alex2
Frank-cntrl Jul 14, 2025
f27d16d
Added Poll list and New Poll components, waiting for backend to test …
AlexNurci Jul 14, 2025
df664a4
Merge pull request #6 from TabulaRasae/alex
Frank-cntrl Jul 14, 2025
2124f83
profile/me page calls for data from back end
Frank-cntrl Jul 15, 2025
a021ea5
Made frontend work with backend
AlexNurci Jul 15, 2025
1e4c696
Merge pull request #9 from TabulaRasae/alex
Frank-cntrl Jul 15, 2025
f94d3fd
Merge branch 'main' into frank
Frank-cntrl Jul 15, 2025
190f0ce
Merge pull request #10 from TabulaRasae/frank
AlexNurci Jul 15, 2025
07948ae
All polls and poll card
Frank-cntrl Jul 15, 2025
5f439f4
Franks work 07/15
Frank-cntrl Jul 15, 2025
debe439
Connected Poll Creation with Poll List, not fully connected with back…
AlexNurci Jul 15, 2025
ec57723
Added Dropdown Menu to the Navbar and added CSS to it
AlexNurci Jul 15, 2025
d5d49bd
test
baryaakov555 Jul 15, 2025
d159812
added a way to go to a specific user's page when clicking the user ca…
baryaakov555 Jul 15, 2025
5c52043
added the user card component
baryaakov555 Jul 15, 2025
8169ab8
New poll form, and poll list, and poll cards
Frank-cntrl Jul 15, 2025
5fd1b8a
Added space
Frank-cntrl Jul 15, 2025
38cfefd
.
Frank-cntrl Jul 15, 2025
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 33 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,34 @@ import axios from "axios";
import "./AppStyles.css";
import NavBar from "./components/NavBar";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import { API_URL } from "./shared";

import Login from "./components/Login";
import Signup from "./components/Signup";
import Home from "./components/Home";
import NotFound from "./components/NotFound";
import { API_URL } from "./shared";
import FriendsPage from "./components/FriendsPage";
import Friends from "./components/Friends";
import Profile from "./components/Profile";
import NewPoll from "./components/NewPoll";
import PollList from "./components/PollList";
import UsersPage from "./components/UsersPage";
import UserCard from "./components/UserCard";

const App = () => {
const [user, setUser] = useState(null);
const [polls, setPolls] = useState(null);

const fetchPolls = async () => {
try{
const response = await axios.get(`${API_URL}/api/polls`);
setPolls(response.data);
}catch{
console.log("failed to get polls");
setPolls([]);
}
};


const checkAuth = async () => {
try {
Expand All @@ -25,14 +45,14 @@ const App = () => {
}
};

// Check authentication status on app load
// Check authentication status and fetch polls on app load
useEffect(() => {
checkAuth();
fetchPolls(); // Add this line to actually fetch polls
}, []);

const handleLogout = async () => {
try {
// Logout from our backend
await axios.post(
`${API_URL}/auth/logout`,
{},
Expand All @@ -53,14 +73,22 @@ const App = () => {
<Routes>
<Route path="/login" element={<Login setUser={setUser} />} />
<Route path="/signup" element={<Signup setUser={setUser} />} />
<Route path="/friends-page" element={<FriendsPage />} />
<Route exact path="/" element={<Home />} />
<Route exact path="/friends" element={<Friends />} />
<Route exact path ="new-poll" element={<NewPoll user={user}/>} />
<Route exact path="/users" element={<UsersPage />} />
<Route path="/users/:id" element={<UserCard />} />
<Route exact path="/me" element={<Profile user={user} />} />
<Route exact path="poll-list" element={<PollList polls={polls}/>} />
<Route path="*" element={<NotFound />} />
</Routes>
</div>
</div>
);
};


const Root = () => {
return (
<Router>
Expand All @@ -71,3 +99,5 @@ const Root = () => {

const root = createRoot(document.getElementById("root"));
root.render(<Root />);

//
File renamed without changes.
37 changes: 37 additions & 0 deletions src/components/CSS/Dropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.dropdown {
position: relative;
display: inline-block;
}

.dropdown-toggle {
padding: 8px 14px;
font-size: 12px;
cursor: pointer;
border: 1px solid #cccccc;
border-radius: 4px;
width: 100%;
white-space: nowrap;
}

.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
border: 1px solid #cccccc;
border-radius: 4px;
list-style: none;
padding: 0;
margin: 4px 0 0 0;
min-width: 100%;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
background-color: #ffffff;
}

.dropdown:hover .dropdown-menu {
display: block;
}

.dropdown-item {
white-space: nowrap;
}
File renamed without changes.
96 changes: 96 additions & 0 deletions src/components/CSS/PollCardStyles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.poll-card {
background: white;
border: 1px solid #e1e8ed;
border-radius: 12px;
padding: 16px;
margin-bottom: 12px;
transition: all 0.2s ease;
cursor: pointer;
}

.poll-card:hover {
border-color: #1da1f2;
box-shadow: 0 2px 8px rgba(29, 161, 242, 0.1);
}

.poll-card.poll-ended {
opacity: 0.7;
background: #f7f9fa;
}

.poll-header {
margin-bottom: 12px;
}

.poll-title {
font-size: 18px;
font-weight: 600;
color: #14171a;
margin: 0 0 8px 0;
line-height: 1.3;
}

.poll-meta {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}

.poll-creator {
color: #657786;
font-size: 14px;
font-weight: 500;
}

.poll-time {
background: #1da1f2;
color: white;
padding: 4px 8px;
border-radius: 12px;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.poll-time.ended {
background: #657786;
}

.poll-status {
margin-top: 8px;
display: flex;
justify-content: flex-end;
}

.status-badge {
background: #f45d22;
color: white;
padding: 4px 12px;
border-radius: 16px;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
}

/* Responsive design */
@media (max-width: 768px) {
.poll-card {
padding: 12px;
}

.poll-title {
font-size: 16px;
}

.poll-meta {
flex-direction: column;
align-items: flex-start;
}

.poll-time {
align-self: flex-end;
}
}
133 changes: 133 additions & 0 deletions src/components/CSS/ProfileStyles.CSS
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
.profile-page {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}

.profile-header {
display: flex;
gap: 30px;
align-items: flex-start;
background: white;
border-radius: 12px;
padding: 30px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}

.profile-picture {
flex-shrink: 0;
}

.profile-img {
width: 150px;
height: 150px;
border-radius: 50%;
object-fit: cover;
border: 4px solid #f0f0f0;
}

.profile-info {
flex: 1;
}

.display-name {
font-size: 2rem;
font-weight: bold;
margin: 0 0 5px 0;
color: #333;
}

.username {
font-size: 1.1rem;
color: #666;
margin: 0 0 20px 0;
}

.stats {
display: flex;
gap: 30px;
margin-bottom: 20px;
}

.stat-item {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}

.stat-count {
font-size: 1.5rem;
font-weight: bold;
color: #333;
}

.stat-label {
font-size: 0.9rem;
color: #666;
margin-top: 2px;
}

.bio {
font-size: 1rem;
color: #333;
line-height: 1.5;
margin-bottom: 20px;
}

.profile-actions {
display: flex;
gap: 10px;
}

.follow-btn, .message-btn {
padding: 10px 20px;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s;
}

.follow-btn {
background-color: #f0f0f0;
color: #333;
border: 1px solid #ddd;
}

.follow-btn:hover {
background-color: #e0e0e0;
}

.message-btn {
background-color: #f0f0f0;
color: #333;
border: 1px solid #ddd;
}

.message-btn:hover {
background-color: #e0e0e0;
}

/* Responsive design */
@media (max-width: 768px) {
.profile-header {
flex-direction: column;
text-align: center;
padding: 20px;
}

.profile-img {
width: 120px;
height: 120px;
}

.display-name {
font-size: 1.8rem;
}

.stats {
justify-content: center;
}
}
Loading