diff --git a/src/common/playlists/PlayHeader.jsx b/src/common/playlists/PlayHeader.jsx index 3285cc64c6..242baeca81 100644 --- a/src/common/playlists/PlayHeader.jsx +++ b/src/common/playlists/PlayHeader.jsx @@ -1,17 +1,34 @@ -import React from 'react'; +import React, { useState } from 'react'; import PlayHeaderInfo from './PlayHeaderInfo'; import PlayHeaderActions from './PlayHeaderActions'; +import { FaAngleUp } from 'react-icons/fa6'; +import { FaAngleDown } from 'react-icons/fa6'; + +export const CollapseContext = React.createContext(); const PlayHeader = ({ play }) => { + const [collapse, setCollapse] = useState(false); + return ( <>
- + + +
+
- {play.description} + {collapse && {play.description}}
diff --git a/src/common/playlists/PlayHeaderInfo.jsx b/src/common/playlists/PlayHeaderInfo.jsx index 869c6dc24f..b48dc6e34f 100644 --- a/src/common/playlists/PlayHeaderInfo.jsx +++ b/src/common/playlists/PlayHeaderInfo.jsx @@ -3,8 +3,9 @@ import { Link } from 'react-router-dom'; import LevelBadge from 'common/components/LevelBadge'; import { format } from 'date-fns'; import * as allLocales from 'date-fns/locale'; -import { useState } from 'react'; +import { useContext, useState } from 'react'; import { email2Slug } from 'common/services/string'; +import { CollapseContext } from './PlayHeader'; const Author = ({ playCreatedAt, user }) => { const [formattedPlayDate] = useState(() => { @@ -61,6 +62,8 @@ const Tags = ({ tags }) => { }; const PlayHeaderInfo = ({ play }) => { + const collapse = useContext(CollapseContext); + return (
@@ -72,16 +75,24 @@ const PlayHeaderInfo = ({ play }) => {

{play.name}

-
- {' '} - {!!play.play_tags.length && } -
-
-
- {play.user && ( - + {collapse && ( +
+ {' '} + {!!play.play_tags.length && } +
)}
+ {collapse && ( +
+ {play.user && ( + + )} +
+ )}
); diff --git a/src/common/playlists/playlist.css b/src/common/playlists/playlist.css index 4c0f8e1e48..28dc9fc45d 100644 --- a/src/common/playlists/playlist.css +++ b/src/common/playlists/playlist.css @@ -326,6 +326,15 @@ padding-top: 0.4rem; } +.header-rightcol { + max-width: 70%; +} + +.collapse-btn { + border: 1px solid #010326; + color: #010326; +} + .play-details .play-details-header .header-primary { display: flex; flex-direction: row; @@ -336,12 +345,15 @@ @media screen and (max-width: 480px) { .play-details .play-details-header .header-rightcol { - flex-direction: row-reverse; + flex-direction: column-reverse; align-items: flex-start; border-top: solid 1px var(--color-neutral-30); margin-top: 0.4rem; padding-top: 0.4rem; } + .header-rightcol{ + max-width: 95%; + } .play-details .play-details-header .header-rightcol .header-desc { text-align: left;