-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equalizer and FavouriteAlbumview component to typescript #1105
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1105 +/- ##
==========================================
+ Coverage 61.38% 61.88% +0.49%
==========================================
Files 280 283 +3
Lines 5089 5187 +98
Branches 361 363 +2
==========================================
+ Hits 3124 3210 +86
- Misses 1660 1671 +11
- Partials 305 306 +1
Continue to review full report at Codecov.
|
import { List, Icon } from 'semantic-ui-react'; | ||
import classNames from 'classnames'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import styles from './styles.scss'; | ||
|
||
const EqualizerPresetList = ({ presets, onClickItem, selected }) => { | ||
type EqualizerPresetListProps ={ | ||
presets: Array<any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the use of Any from both of the components
type FavoriteAlbumsViewProps = { | ||
albums: Array<Album>; | ||
removeFavoriteAlbum: React.MouseEventHandler; | ||
albumInfoSearch: (albumId: any, releaseType: any, release: any) => Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
albumId and release should be strings instead of any, releaseType is a union of string literals ('master' | 'release'
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. In hindsight, I used this because of another component ArtistView/index.tsx
and I believe that must be fixed as well along with this. I will make the consequent changes in both.
type ArtistViewProps = {
artist: Artist & {
loading?: boolean;
};
isFavorite: boolean;
addTrackToQueue: (item: any) => Promise<void>;
artistInfoSearchByName: (artistName: any) => Promise<void>;
albumInfoSearch: (albumId: any, releaseType: any, release: any) => Promise<void>;
Converting Components to typescript