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

Commit

Permalink
refactor(types): use API types generated from spec
Browse files Browse the repository at this point in the history
  • Loading branch information
adriengibrat committed Jan 13, 2020
1 parent 1c808a3 commit 3adaab8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FormattedDate, FormattedMessage, FormattedTime } from 'react-intl';
import { Item, Loader, Button } from 'semantic-ui-react';
import { Link, useParams, useHistory } from 'react-router-dom';

import ActivitiesContext, { Activity, State } from './context/index';
import ActivitiesContext, { Activity } from './context/index';
import {
FULL_DATE_FORMAT,
CallImage,
Expand Down
13 changes: 2 additions & 11 deletions src/context/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,5 @@ export interface State {
archiveActivity: (id: number) => void;
}

export interface Activity {
id: number;
created_at: string;
direction: 'inbound' | 'outbound';
from: string;
to: string;
via: string;
duration: string;
is_archived: boolean;
call_type: 'answered' | 'missed' | 'voicemail';
}
import { Schemas } from './api.d';
export type Activity = Schemas.Activity;
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
},
entry: './src/index.tsx',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
extensions: ['.ts', '.tsx', '.ts', '.js', '.jsx']
},
plugins: [
new HtmlWebPackPlugin({
Expand Down

0 comments on commit 3adaab8

Please sign in to comment.