{props.title}
- -
-
{props.description}
- {/*{props.linkTitle}
*/} - - ); -}; - -export default Card; diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx new file mode 100644 index 0000000..a035977 --- /dev/null +++ b/src/components/CourseCard.tsx @@ -0,0 +1,39 @@ +import { Icon } from './Util/Icon'; + +type CardProps = { + image: string; + title: string; + description: string; + linkUrl: string; + linkTitle: string; + duration: string; + external?: boolean; +} + +const CourseCard = (props: CardProps) => { + const duration = Math.floor(parseInt(props.duration) / 60); + + return ( + + +{props.description}
+ + ); +}; + +export default CourseCard; diff --git a/src/components/Layout/MainNav/MainNav.tsx b/src/components/Layout/MainNav/MainNav.tsx index 0fb24bd..a93ebca 100644 --- a/src/components/Layout/MainNav/MainNav.tsx +++ b/src/components/Layout/MainNav/MainNav.tsx @@ -1,51 +1,43 @@ -import { useContext, useEffect, useState } from "react"; -import { Link, NavLink } from "react-router-dom"; -import { Icon } from "../../Util/Icon"; -import { useSizes } from "../../Util/useSizes"; -import koiosLogo from "../../../assets/images/logos/koios-logo.svg"; -import { selectedAccount, profilePicture, profileName } from "../../Web3/Web3"; -import MainNavData from "./static/MainNavData.json"; -import { SvgSprite } from "../../Util/SvgSprite"; -import { Connect, Disconnect } from "../../Web3/ConnectionCheck"; -import { web3Modal } from "../../Web3/WalletProvider"; -import { UserContext } from "../../../Context/UserContext"; -import { FormatPublicKey } from "../../Util/FormatPublicKey"; +import { useContext, useEffect, useState } from 'react'; +import { Link, NavLink } from 'react-router-dom'; +import { Icon } from '../../Util/Icon'; +import { useSizes } from '../../Util/useSizes'; +import koiosLogo from '../../../assets/images/logos/koios-logo.svg'; +import MainNavData from './static/MainNavData.json'; +import { SvgSprite } from '../../Util/SvgSprite'; +import { web3Modal } from '../../Web3/WalletProvider'; +import { UserContext } from '../../../Context/UserContext'; +import { useWeb3 } from '../../../components/Web3/useWeb3'; +import avatarPlaceholder from '../../../assets/images/placeholders/avatar-placeholder.png'; +import { AuthContext } from '../../../Context/AuthContext'; +import { noop } from '../../Util/noop'; export const MainNav = () => { - const { user, setUser } = useContext(UserContext); - + const { userAccount } = useContext(UserContext); + const { connectWallet, disconnectWallet } = useWeb3(); const { width } = useSizes(); - const isMobile = width < 769; + const [isMenuOpen, setIsMenuOpen] = useState