Skip to content

Commit

Permalink
Merge pull request #48 from aneurysmjs/issue/47/add-footer-and-userme…
Browse files Browse the repository at this point in the history
…nu-to-index

fix(*): add Footer and UserMenu to git's index
aneurysmjs authored Feb 10, 2020
2 parents 7241b63 + 4a7f9f4 commit 05293f7
Showing 3 changed files with 37 additions and 19 deletions.
23 changes: 16 additions & 7 deletions src/app/components/core/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import React, { ReactElement } from 'react';

import React, { FunctionComponent } from 'react';
import { useSelector } from 'react-redux';

import { getFooter } from '~/store/modules/footer/selectors';
import { FooterType } from '~/shared/types/FooterType';

import Icon from '~/components/base/Icon';

import { State } from '~/store/State';
import { AlienResult } from '~/store/config/alienStore/useAlien';
import { FooterState } from '~/store/modules/footer/types';

import './Footer.scss';

const Footer = (): ReactElement => {
const { social }: FooterType = useSelector(getFooter);
type PropsType = {
modules: Array<AlienResult<State>>;
};

const Footer: FunctionComponent<PropsType> = ({ modules }: PropsType) => {
const [footerModule] = modules;

const { selectors } = footerModule;

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { social } = useSelector<State, FooterState>(selectors!.getFooter);

return (
<footer className="footer">
13 changes: 6 additions & 7 deletions src/app/components/core/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable prettier/prettier */
import React, { ReactElement } from 'react';
import { NavLink } from 'react-router-dom';

@@ -23,12 +22,12 @@ function Navigation(): ReactElement {
<ul className="navbar-nav mr-auto">
{links.length
? links.map(({ path, name, id }) => (
<li key={id} className="nav-item">
<NavLink to={`/${path}`} key={id} activeClassName="active" className="nav-link">
{name}
</NavLink>
</li>
))
<li key={id} className="nav-item">
<NavLink to={`/${path}`} key={id} activeClassName="active" className="nav-link">
{name}
</NavLink>
</li>
))
: null}
</ul>
</div>
20 changes: 15 additions & 5 deletions src/app/components/core/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import React, { useState, ReactElement } from 'react';
import React, { useState, FunctionComponent } from 'react';
import { useSelector } from 'react-redux';
import Icon from '~/components/base/Icon';
import useLazy from '~/hooks/useLazy';

import { CartType } from '~/shared/types/CartType';
import { getCart } from '~/store/modules/cart/selectors';
import { State } from '~/store/State';
import { AlienResult } from '~/store/config/alienStore/useAlien';
import { Cart } from '~/store/modules/cart/types';

import './UserMenu.scss';

const UserMenu = (): ReactElement => {
type PropsType = {
modules: Array<AlienResult<State>>;
};

const UserMenu: FunctionComponent<PropsType> = ({ modules }: PropsType) => {
const [open, setOpen] = useState(false);
const cart: CartType = useSelector(getCart);
const [cartModule] = modules;

const { selectors } = cartModule;

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const cart = useSelector<State, Cart>(selectors!.getCart);

const handleOpen = (): void => setOpen(!open);

0 comments on commit 05293f7

Please sign in to comment.