From 2c106d1d3f6d59b10ad946e01e8bb3d0df587e40 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 14 Mar 2021 10:10:16 +0300 Subject: refactor: create Service abstraction --- src/index.tsx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 4ec1db0..932fbf3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -8,16 +8,13 @@ import { } from 'react-router-dom'; import Header from './components/Header'; import Home from './containers/Home'; -import Products from './containers/Products'; -import ProductForm from './containers/ProductForm'; -import Contractors from './containers/Contractors'; -import ContractorForm from './containers/ContractorForm'; +import Service from './containers/Service/Service'; +import { ServiceProvider } from './containers/Service/ServiceContext'; +import services from './services'; const navigation = [ { name: 'Главная', route: '/' }, - { name: 'Товары', route: '/products' }, - { name: 'Контрагенты', route: '/contractors' }, - { name: 'Накладные', route: '/waybills' }, + ...services.map(({ name, route }) => ({ name, route: `/${route}` })), ]; const App: React.FC = () => ( @@ -25,12 +22,13 @@ const App: React.FC = () => (
- - - - - - + {services.map(service => ( + + + + + + ))} ); -- cgit v1.2.3