Skip to content
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

Merged
merged 7 commits into from
Dec 1, 2021

Conversation

Yahyakiani
Copy link
Contributor

Converting Components to typescript

@codecov
Copy link

codecov bot commented Nov 20, 2021

Codecov Report

Merging #1105 (5ca6870) into master (86a66ab) will increase coverage by 0.49%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
packages/app/app/components/ArtistView/index.tsx 91.66% <ø> (ø)
...s/app/app/components/EqualizerPresetList/index.tsx 63.63% <50.00%> (ø)
...es/app/app/components/FavoriteAlbumsView/index.tsx 100.00% <100.00%> (ø)
packages/app/app/selectors/favorites.js 83.33% <0.00%> (ø)
packages/app/app/components/InputDialog/index.js
packages/app/app/components/Header/index.js
...ges/app/app/containers/PlayerBarContainer/hooks.ts 85.55% <0.00%> (ø)
packages/app/app/components/InputDialog/index.tsx 94.73% <0.00%> (ø)
packages/app/app/selectors/player.js 100.00% <0.00%> (ø)
packages/app/app/components/Header/index.tsx 100.00% <0.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86a66ab...5ca6870. Read the comment docs.

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>;
Copy link
Owner

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

Copy link
Contributor Author

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>;
Copy link
Owner

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')

Copy link
Contributor Author

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>;

@nukeop nukeop merged commit 73ed587 into nukeop:master Dec 1, 2021
@Yahyakiani Yahyakiani deleted the components_to_typescript branch December 18, 2021 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants