Skip to content

Commit 246b0f2

Browse files
committed
Rename type
1 parent 3ec1473 commit 246b0f2

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

views/interactivity/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useState } from 'react';
22
import './App.css';
33
import SearchBox from './components/SearchBox/SearchBox';
4-
import { DictionaryAPIResponse } from './types';
4+
import { DictionaryEntry } from './types';
55

66
function App() {
77
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8-
const [response, setResponse] = useState<DictionaryAPIResponse | null>(null);
8+
const [response, setResponse] = useState<DictionaryEntry | null>(null);
99
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1010
const [errorMessage, setErrorMessage] = useState<string | null>(null);
1111

views/interactivity/src/components/SearchBox/SearchBox.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React, { useState, useEffect } from 'react';
2-
import { DictionaryAPIResponse } from '../../types';
2+
import { DictionaryEntry } from '../../types';
33
import './SearchBox.css';
44

55
type Props = {
6-
onResponse: (response: DictionaryAPIResponse) => void;
6+
onResponse: (response: DictionaryEntry) => void;
77
onError: (errorMessage: string) => void;
88
};
99

@@ -36,7 +36,7 @@ export default function SearchBox({ onResponse, onError }: Props) {
3636
return onError('Something went wrong. Please try again.');
3737
}
3838
}
39-
onResponse((await response.json()) as unknown as DictionaryAPIResponse);
39+
onResponse((await response.json()) as unknown as DictionaryEntry);
4040
})
4141
.catch(() => {
4242
onError('Something went wrong. Please try again.');

views/interactivity/src/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ export type AccessSummary = {
3131
lastAccessAt: string;
3232
};
3333

34-
export type DictionaryAPIResponse = {
34+
export type DictionaryEntry = {
3535
dictionaryWord: DictionaryWord;
3636
accessSummary: AccessSummary | null;
3737
};
38-

0 commit comments

Comments
 (0)