Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 14fe7b0

Browse files
committed
refactor(types): use API types generated from spec
1 parent 1c808a3 commit 14fe7b0

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

src/Detail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FormattedDate, FormattedMessage, FormattedTime } from 'react-intl';
33
import { Item, Loader, Button } from 'semantic-ui-react';
44
import { Link, useParams, useHistory } from 'react-router-dom';
55

6-
import ActivitiesContext, { Activity, State } from './context/index';
6+
import ActivitiesContext, { Activity } from './context/index';
77
import {
88
FULL_DATE_FORMAT,
99
CallImage,

src/context/index.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ export interface State {
1616
archiveActivity: (id: number) => void;
1717
}
1818

19-
export interface Activity {
20-
id: number;
21-
created_at: string;
22-
direction: 'inbound' | 'outbound';
23-
from: string;
24-
to: string;
25-
via: string;
26-
duration: string;
27-
is_archived: boolean;
28-
call_type: 'answered' | 'missed' | 'voicemail';
29-
}
19+
import { Schemas } from './api';
20+
import Activity = Schemas.Activity;
21+
export { Activity };

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343
},
4444
entry: './src/index.tsx',
4545
resolve: {
46-
extensions: ['.ts', '.tsx', '.js', '.jsx']
46+
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx']
4747
},
4848
plugins: [
4949
new HtmlWebPackPlugin({

0 commit comments

Comments
 (0)