-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: posts can be hidden. closes #10
- Loading branch information
Si
committed
Apr 20, 2023
1 parent
97ce65f
commit c587de1
Showing
21 changed files
with
266 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
import { useLocation, useParams } from "react-router-dom"; | ||
|
||
const TrackGroupWidget = () => { | ||
const params = useParams(); | ||
const loc = useLocation(); | ||
console.log("loc", loc, params); | ||
return <>Track Group</>; | ||
}; | ||
|
||
export default TrackGroupWidget; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { css } from "@emotion/css"; | ||
import { AudioWrapper } from "components/AudioWrapper"; | ||
import ClickToPlay from "components/common/ClickToPlay"; | ||
import SmallTileDetails from "components/common/SmallTileDetails"; | ||
import React from "react"; | ||
import { useParams } from "react-router-dom"; | ||
import api from "services/api"; | ||
|
||
const TrackWidget = () => { | ||
const params = useParams(); | ||
const [track, setTrack] = React.useState<Track>(); | ||
|
||
React.useEffect(() => { | ||
const callback = async () => { | ||
try { | ||
const results = await api.get<Track>(`tracks/${params.id}`); | ||
setTrack(results.result); | ||
} catch (e) { | ||
console.error("e", e); | ||
} | ||
}; | ||
|
||
callback(); | ||
}, [params.id]); | ||
return ( | ||
<> | ||
{track && ( | ||
<div | ||
className={css` | ||
display: flex; | ||
padding: 1rem; | ||
background: white; | ||
border-radius: 1rem; | ||
`} | ||
> | ||
{track.isPreview && ( | ||
<ClickToPlay | ||
trackId={track.id} | ||
title={track.title} | ||
image={{ | ||
width: 120, | ||
height: 120, | ||
url: track.trackGroup.cover?.sizes?.[120] ?? "", | ||
}} | ||
/> | ||
)} | ||
|
||
<SmallTileDetails | ||
title={track.title} | ||
subtitle={track.trackGroup.title} | ||
footer={track.trackGroup.artist.name} | ||
/> | ||
<div | ||
className={css` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
flex-grow: 1; | ||
`} | ||
> | ||
<AudioWrapper currentTrack={track} /> | ||
</div> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default TrackWidget; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.