From e374cbfdd30e88fd17a652820e749b06f3e4e2fe Mon Sep 17 00:00:00 2001 From: ilnaz <237x237@gmail.com> Date: Sat, 23 Nov 2024 15:56:40 +0300 Subject: [PATCH] feat: add stub success(#37) --- src/components/Masters/Masters.tsx | 4 ++-- src/components/Orders/Orders.tsx | 5 ++--- src/mocks/index.ts | 35 ----------------------------- stubs/json/arm-masters/success.json | 17 ++++++++++++++ stubs/json/arm-orders/success.json | 32 ++++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 40 deletions(-) delete mode 100644 src/mocks/index.ts create mode 100644 stubs/json/arm-masters/success.json create mode 100644 stubs/json/arm-orders/success.json diff --git a/src/components/Masters/Masters.tsx b/src/components/Masters/Masters.tsx index 149923a..ea07603 100644 --- a/src/components/Masters/Masters.tsx +++ b/src/components/Masters/Masters.tsx @@ -13,9 +13,9 @@ import { } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; -import { mastersData } from '../../mocks'; import MasterItem from '../MasterItem'; import MasterDrawer from '../MasterDrawer'; +import data from '../../../stubs/json/arm-masters/success.json'; const TABLE_HEADERS = [ 'name' as const, @@ -48,7 +48,7 @@ const Masters = () => { - {mastersData.map((master, index) => ( + {data.body.map((master, index) => ( ))} diff --git a/src/components/Orders/Orders.tsx b/src/components/Orders/Orders.tsx index fc95feb..5c55417 100644 --- a/src/components/Orders/Orders.tsx +++ b/src/components/Orders/Orders.tsx @@ -1,10 +1,9 @@ import React from 'react'; import { Box, Heading, Table, Thead, Tbody, Tr, Th } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; - -import { ordersData } from '../../mocks'; import OrderItem from '../OrderItem'; import { OrderProps } from '../OrderItem/OrderItem'; +import data from '../../../stubs/json/arm-orders/success.json'; const Orders = () => { const { t } = useTranslation('~', { @@ -34,7 +33,7 @@ const Orders = () => { - {ordersData.map((order, index) => ( + {data.body.map((order, index) => (