Skip to content
Open
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
25 changes: 25 additions & 0 deletions components/Clock/Clock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { useState, useEffect } from 'react';
import { DateTime } from 'luxon';

const Clock = () => {
const [time, SetTime] = useState();

useEffect(() => {
const intervalTime = setInterval(() => {
const currentTime = DateTime.local();
const stringTime = currentTime.toLocaleString(DateTime.TIME_WITH_SECONDS);
SetTime(stringTime);
}, 250);
return () => clearInterval(intervalTime);
}, [time]);

return (
<>
<div>
<span>{time}</span>
</div>
</>
);
};

export default Clock;
23 changes: 17 additions & 6 deletions components/NavBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Link from 'next/link';
import React, { useState, useRef } from 'react';
import styles from './navbar.module.css';
import Image from 'next/image';
import Clock from '../Clock/Clock';
import GenericClosePopUp from '../Close-popup/GenericClosePopUp';

const NavBar = ({ personData: { photo } }) => {
Expand Down Expand Up @@ -40,12 +41,22 @@ const NavBar = ({ personData: { photo } }) => {
</div>
</li>

<div
className={styles.profilePic}
ref={navbarRef}
onClick={() => setToggle(!toggle)}
>
<img src={photo} alt="Profile Image" height="70" width="70" />
{/* <li>
<Link href="#">
<a className={styles.loginBtn}>Log in</a>
</Link>
</li> */}
Comment on lines +44 to +48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we keeping commented code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I don't remember Commenting that code out. Probably not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get rid of commented code please

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still working on this one?

<li>
<Clock />
</li>
<div className={styles.profilePic} onClick={() => setToggle(!toggle)}>
<div
className={styles.profilePic}
ref={navbarRef}
onClick={() => setToggle(!toggle)}
>
<img src={photo} alt="Profile Image" height="70" width="70" />
</div>
<div
className={
toggle ? styles.dropdownContent : styles.dropdownContentHide
Expand Down
Loading