Skip to content

Commit

Permalink
Merge pull request #68 from leo-paz/CreatingSetting
Browse files Browse the repository at this point in the history
Creating Home Page
  • Loading branch information
leo-paz authored Apr 9, 2021
2 parents cb208f3 + e24465e commit b44a8aa
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions frontend/grad-admissions-hub-app/src/Components/Clock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { useEffect, useRef, useState } from 'react';
import lottie from 'lottie-web';

function Clock(props) {
const [date, setDate] = useState(new Date());

useEffect(() => {
var timerID = setInterval( () => tick(), 1000 );

return function cleanup() {
clearInterval(timerID);
};
});

function tick() {
setDate(new Date());
}

return (
<div>
<h4>The local time is {date.toLocaleTimeString()}.</h4>
</div>
);
}
export default Clock;
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const Navbar = () => {
onMouseEnter={() => lottie.play('settings')}
onMouseLeave={() => lottie.stop('settings')}
>
<Link className="nav-link">
<Link className="nav-link" to="/settings">
<div className="standard-nav-animation" ref={settingsContainer}/>
{/* <CogIcon /> */}
<span className="link-text">Settings</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React, { useEffect, useRef, useState } from 'react';
import lottie from 'lottie-web';

import { Link } from "react-router-dom";
import { Auth } from 'aws-amplify';

function HomeSetUp() {
const goHomeContainer = useRef(null);

useEffect(() => {
lottie.loadAnimation({
container: goHomeContainer.current,
renderer: 'svg',
loop: false,
autoplay: false,
animationData: require('../../animations/go-arrow.json'),
name: 'Home'
})})

return (
<div className="Homesetup-card">
<div className="goHomeContainer"
onMouseEnter={() => lottie.play('Home')}
onMouseLeave={() => lottie.stop('Home')}
>

<img className="GradPhoto" src="GradHomePhoto.jpg" height={350} width ={585} />

</div>
<div className="center-card">

</div>
</div>

)}
export default HomeSetUp;
13 changes: 10 additions & 3 deletions frontend/grad-admissions-hub-app/src/Pages/Home.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import React, { useState, useEffect, useRef } from "react";
import GetApplicant1 from "./../Components/GetApplicant1";
import HomeSetUp from '../Components/SignUpLogIn/HomeSetUp'
import Clock from '../Components/Clock'
import { Link } from "react-router-dom";

const Home = () => {
return (
<div className="page">
<h1>Home</h1>
<GetApplicant1></GetApplicant1>
<h1>Welcome to the Graduate Admission Program</h1>
<div className="login-container">
<HomeSetUp></HomeSetUp>
<h2>A portal for students applying to a graduate program</h2>
<h2>Go to "Profile" to login to get started!</h2>
<Clock></Clock>
</div>
</div>
);
};
Expand Down
11 changes: 11 additions & 0 deletions frontend/grad-admissions-hub-app/src/Pages/Settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React, { useState, useEffect, useRef } from 'react';

const Settings = () => {
return (
<div className="page">
<h1>Settings</h1>
</div>
);
};

export default Settings;

0 comments on commit b44a8aa

Please sign in to comment.