Skip to content

Commit

Permalink
trackDetailContainer route updated
Browse files Browse the repository at this point in the history
  • Loading branch information
anasnadeemws committed Mar 5, 2024
1 parent e992d43 commit 7f0047b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
18 changes: 9 additions & 9 deletions app/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { AppBar } from '@mui/material';
import styled from '@emotion/styled';
import { fonts, colors } from '@themes';
import T from '@components/T';
import logo from '@images/icon-512x512.png';
import logoWebp from '@images/icon-512x512.webp';
// import logo from '@images/icon-512x512.png';
// import logoWebp from '@images/icon-512x512.webp';

const StyledHeader = styled(AppBar)`
&& {
Expand All @@ -22,11 +22,11 @@ const StyledHeader = styled(AppBar)`
flex-direction: row;
}
`;
const Logo = styled.img`
height: ${(props) => props.height};
width: ${(props) => props.height};
margin-top: 1rem;
`;
// const Logo = styled.img`
// height: ${(props) => props.height};
// width: ${(props) => props.height};
// margin-top: 1rem;
// `;
const Title = styled(T)`
&& {
color: ${colors.text};
Expand All @@ -40,11 +40,11 @@ const Title = styled(T)`
function Header(props) {
return (
<StyledHeader position="relative" {...props} data-testid="header">
<picture>
{/* <picture>
<source type="image/webp" srcSet={logoWebp} />
<source type="image/jpeg" srcSet={logo} />
<Logo alt="logo" src={logo} width="auto" height="5rem" />
</picture>
</picture> */}
<Title type="heading" id="wednesday_solutions" />
</StyledHeader>
);
Expand Down
5 changes: 5 additions & 0 deletions app/components/TrackCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import IconButton from '@mui/material/IconButton';
import Typography from '@mui/material/Typography';
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
import PauseIcon from '@mui/icons-material/Pause';
import { Link } from 'react-router-dom';

const TrackCustomCard = styled(Card)`
&& {
Expand Down Expand Up @@ -70,6 +71,7 @@ const TrackPlayIcon = styled(PlayArrowIcon)`
export function TrackCard({
trackPlaying,
setTrackPlaying,
collectionId,
collectionName,
artistName,
shortDescription,
Expand Down Expand Up @@ -108,6 +110,7 @@ export function TrackCard({
};

return (
<Link to={`/tracks/${collectionId}`}>
<TrackCustomCard data-testid="track-card">

Check failure on line 114 in app/components/TrackCard/index.js

View workflow job for this annotation

GitHub Actions / Build & Test (16.14.x)

Insert `··`
<TrackContentBox>

Check failure on line 115 in app/components/TrackCard/index.js

View workflow job for this annotation

GitHub Actions / Build & Test (16.14.x)

Insert `··`
<TrackContentHeaderBox>

Check failure on line 116 in app/components/TrackCard/index.js

View workflow job for this annotation

GitHub Actions / Build & Test (16.14.x)

Replace `········` with `··········`
Expand Down Expand Up @@ -146,12 +149,14 @@ export function TrackCard({
<TrackMedia component="img" image={artworkUrl100} alt="Poster unavailable" />
</If>
</TrackCustomCard>
</Link>
);
}

TrackCard.propTypes = {
trackPlaying: PropTypes.string,
setTrackPlaying: PropTypes.func,
collectionId: PropTypes.number,
artistName: PropTypes.string,
artworkUrl100: PropTypes.string,
collectionName: PropTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions app/containers/TrackDetailContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';
import { useParams } from 'react-router-dom';
import trackDetailContainerSaga from './saga';
import { selectTrackDetailData, selectTrackId, selectTrackError, selectTrackDetailLoading } from './selectors';
import { selectTrackDetailData, selectTrackError, selectTrackDetailLoading } from './selectors';
import { trackDetailContainerCreators } from './reducer';
import { injectSaga } from 'redux-injectors';
import { Card, IconButton, Skeleton, InputAdornment, OutlinedInput, CardHeader, Divider } from '@mui/material';

export const TrackDetailContainer = ({ trackDetailData, trackError, trackDetailLoading, dispatchTrackDetail }) => {
const { trackId } = useParams();

console.log('trackId', trackId);
return <div>TrackDetailContainer {trackId} </div>;
};

Expand Down
5 changes: 5 additions & 0 deletions app/routeConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import NotFound from '@containers/NotFoundPage/Loadable';
import HomeContainer from '@containers/HomeContainer/Loadable';
import TrackContainer from '@containers/TrackContainer/Loadable';
import TrackDetailContainer from '@containers/TrackDetailContainer/Loadable';
import routeConstants from '@utils/routeConstants';

export const routeConfig = {
Expand All @@ -12,6 +13,10 @@ export const routeConfig = {
component: TrackContainer,
...routeConstants.tracks
},
track: {
component: TrackDetailContainer,
...routeConstants.track
},
notFoundPage: {
component: NotFound,
route: '/'
Expand Down
2 changes: 1 addition & 1 deletion app/utils/routeConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
exact: true
},
track: {
route: '/track:trackid',
route: '/tracks/:trackId',
props: {
maxwidth: 500,
padding: 20
Expand Down

0 comments on commit 7f0047b

Please sign in to comment.