Skip to content

Commit

Permalink
imports modification
Browse files Browse the repository at this point in the history
  • Loading branch information
clefayomide committed Feb 27, 2023
1 parent f2900fd commit 38ec949
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
42 changes: 21 additions & 21 deletions src/component/Converter/Converter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext, useState } from 'react';
import AppState from '../../context/AppState';
// import { AppState } from '../../context/AppState';
import { Currency } from '../Currency';
import Button from '../form/Button';
import AppContext from '../../context/app_context';
Expand Down Expand Up @@ -46,25 +46,25 @@ export const Converter = () => {
};

return (
<AppState>
<div className="w-fit">
<Currency
title={'You send'}
value={send}
on_change={set_send}
read_only={false}
type={'text'}
/>
<div className="h h-10 border-l-2 border-dotted ml-6 bg-slate-800 w-fit"></div>
<Currency
title={'You receive'}
read_only={true}
value={state.receiving_amount.toString()}
type={'text'}
on_change={set_receive}
/>
<Button title={'Convert'} on_click={handle_conversion} />
</div>
</AppState>
// <AppState>
<div className="w-fit">
<Currency
title={'You send'}
value={send}
on_change={set_send}
read_only={false}
type={'text'}
/>
<div className="h h-10 border-l-2 border-dotted ml-6 bg-slate-800 w-fit"></div>
<Currency
title={'You receive'}
read_only={true}
value={state.receiving_amount.toString()}
type={'text'}
on_change={set_receive}
/>
<Button title={'Convert'} on_click={handle_conversion} />
</div>
// </AppState>
);
};
4 changes: 1 addition & 3 deletions src/context/AppState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Type {
children: React.ReactNode;
}

const AppState = (props: Type) => {
export const AppState = (props: Type) => {
// const initial_state = {
// loading: false,
// sending_country: '',
Expand All @@ -28,5 +28,3 @@ const AppState = (props: Type) => {
</AppContext.Provider>
);
};

export default AppState;
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './component/Converter/Converter';
export * from './';
2 changes: 1 addition & 1 deletion stories/Converter.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Meta, Story } from '@storybook/react';
import { Converter } from '../src/component/Converter/Converter';
import AppState from '../src/context/AppState';
import { AppState } from '../src/context/AppState';

const meta: Meta = {
title: 'UI Currency Converter',
Expand Down

0 comments on commit 38ec949

Please sign in to comment.