Skip to content

Commit

Permalink
fix(*): add Footer and UserMenu to git's index
Browse files Browse the repository at this point in the history
  • Loading branch information
aneurysmjs committed Feb 10, 2020
1 parent 7241b63 commit 1d5cc64
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 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">
Expand Down
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);

Expand Down

0 comments on commit 1d5cc64

Please sign in to comment.