Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix #50

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 1 addition & 20 deletions src/app/ui/pages/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,7 @@ import { InfoOutlined} from "@material-ui/icons";
import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
import Image from "next/image";
import { useRouter } from "next/navigation";

const dummyData = [
{
"prompt": "Hii Anudesh",
"output": "Hello! How can I assist you today?"
},
{
"prompt": "What is a computer?",
"output": "Computer is an electronic device"
},
{
"prompt": "What is it used for?",
"output": "It is used for computation"
},
{
"prompt": "Thanks, any additional points?",
"output": "No"
}
];

import dummyData from './dummyData.json';

const Chat = () =>{

Expand Down
18 changes: 18 additions & 0 deletions src/app/ui/pages/chat/dummyData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"prompt": "Hii Anudesh",
"output": "Hello! How can I assist you today?"
},
{
"prompt": "What is a computer?",
"output": "Computer is an electronic device"
},
{
"prompt": "What is it used for?",
"output": "It is used for computation"
},
{
"prompt": "Thanks, any additional points?",
"output": "No"
}
]
10 changes: 7 additions & 3 deletions src/app/ui/pages/home/home.js

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

12 changes: 7 additions & 5 deletions src/app/ui/pages/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import LoginAPI from "../../../actions/api/user/Login";
import { auth, googleAuthProvider } from "@/firebase";
import { signInWithPopup } from "firebase/auth";
import GoogleLoginAPI from "../../../actions/api/user/GoogleLogin";
import { authenticateUser } from "@/utils/utils";
import { authenticateUser,getLoggedInUserData } from "@/utils/utils";
import { FetchLoggedInUserData } from "@/Lib/Features/getLoggedInData";

export default function Login() {
Expand All @@ -31,10 +31,11 @@ export default function Login() {
const dispatch=useDispatch()

useEffect(() => {
if (authenticateUser()) {
navigate('/projects');
const isLoggedIn = localStorage.getItem("isLoggedIn");
if (isLoggedIn === "true") {
navigate('/projects');
}
}, [navigate]);
}, []);

const classes = LoginStyle();
const [snackbar, setSnackbarInfo] = useState({
Expand All @@ -61,6 +62,7 @@ export default function Login() {
const getLoggedInUserData = () => {
dispatch(FetchLoggedInUserData("me"));
};



const handleSubmit = async () => {
Expand All @@ -77,7 +79,7 @@ export default function Login() {
localStorage.setItem("anudesh_access_token", rsp_data.access);
localStorage.setItem("anudesh_refresh_token", rsp_data.refresh);
localStorage.setItem("email_id", credentials.email.toLowerCase());
getLoggedInUserData();
localStorage.setItem("isLoggedIn", "true");
navigate("/projects");
} else{
setSnackbarInfo({
Expand Down
46 changes: 25 additions & 21 deletions src/components/common/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const Header = () => {
const handleChange = (event, newValue) => {
setValue(newValue);
};


const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
Expand Down Expand Up @@ -733,32 +733,36 @@ const handleopenproject=(id,type)=>{
) : (
<AppBar>
<Toolbar className={classes.toolbar}>
<Grid
sx={{ display: "flex", alignItems: "center" }}
xs={12}
sm={12}
md={3}
>
<Link href="/projects">
<Grid
sx={{ display: "flex", alignItems: "center" }}
xs={12}
sm={12}
md={3}
>
<a style={{ display: "flex", alignItems: "center" }}>
<img

onClick={() => navigate("/")}
src="https://i.imgur.com/56Ut9oz.png"
alt="anudesh"
className={classes.headerLogo}
sx={{ marginTop: "5%" }}
/>
</Link>
<Typography
variant="h4"
className={classes.headerTitle}
sx={{
fontSize: "28px",
fontWeight: "lighter",
}}
>
Anudesh
</Typography>
</Grid>
<Typography

onClick={() => navigate("/")}
variant="h4"
className={classes.headerTitle}
sx={{
fontSize: "28px",
fontWeight: "lighter",
}}
>
Anudesh
</Typography>
</a>


</Grid>

{/* <Grid
container
Expand Down
Loading