Skip to content

Commit fbe610a

Browse files
committed
Have set the logout button to side bar
1 parent c43c775 commit fbe610a

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

frontend/src/components/landing/LandingPage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import React, { useState } from 'react';
22
import { motion } from 'framer-motion';
33
import axios from 'axios';
44
import { toast } from 'react-hot-toast';
5+
import { useNavigate } from 'react-router-dom';
56

67
interface Props {
78
setRepoData: (data: any) => void; // Function to pass data to parent
8-
setActivePage: (page: string) => void; // Function to navigate to other pages
99
}
1010

11-
const LandingPage: React.FC<Props> = ({ setRepoData, setActivePage }) => {
11+
const LandingPage: React.FC<Props> = ({ setRepoData }) => {
1212
const [repoUrl, setRepoUrl] = useState('');
1313
const [loading, setLoading] = useState(false);
14-
14+
const navigate = useNavigate();
1515
const fetchRepoStats = async () => {
1616
if (!repoUrl) {
1717
toast.error('Please enter a valid GitHub repository URL.');
@@ -23,7 +23,7 @@ const LandingPage: React.FC<Props> = ({ setRepoData, setActivePage }) => {
2323
const response = await axios.post('http://localhost:8000/api/repo-stats', { repo_url: repoUrl });
2424
setRepoData(response.data); // Pass fetched data to parent
2525
toast.success('Repository stats fetched successfully!');
26-
setActivePage('dashboard'); // Navigate to dashboard
26+
navigate('/dashboard'); // Navigate to dashboard
2727
} catch (error) {
2828
toast.error('Failed to fetch repository stats. Please check the URL or backend server.');
2929
} finally {

frontend/src/components/pages/ProfilePage.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { motion } from 'framer-motion';
33
import { toast } from 'react-hot-toast';
44
import { User, Mail, Building, Globe, Github, Twitter, Edit, Camera, Save, DoorClosed } from 'lucide-react';
55

6-
const ProfilePage = ({onSignOut}:{onSignOut:()=>void}) => {
6+
const ProfilePage = () => {
77
const [isEditing, setIsEditing] = useState(false);
88
const [profile, setProfile] = useState({
99
name: 'Sarah Chen',
@@ -179,19 +179,6 @@ const ProfilePage = ({onSignOut}:{onSignOut:()=>void}) => {
179179
className="w-full bg-gray-800 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-green-500 disabled:opacity-50"
180180
/>
181181
</div>
182-
<div className="mt-8 flex justify-end">
183-
<motion.button
184-
whileHover={{ scale: 1.05 }}
185-
whileTap={{ scale: 0.95 }}
186-
onClick={() => {
187-
onSignOut();
188-
}}
189-
className="px-4 py-2 bg-red-500 hover:bg-red-600 rounded-lg transition-colors flex items-center"
190-
>
191-
<DoorClosed size={18} className="mr-2" />
192-
Sign Out
193-
</motion.button>
194-
</div>
195182
{isEditing && (
196183
<div className="mt-8 flex justify-end space-x-4">
197184
<motion.button

0 commit comments

Comments
 (0)