1
0
Fork 0

Revert "feat(shared): Add name to curated sets"

This reverts commit 5dc84c0eb8.

Need to keep this out of the PR
This commit is contained in:
joostdecock 2024-02-17 16:50:47 +01:00
parent 147433e168
commit 43c069719c

View file

@ -50,14 +50,7 @@ import {
export const ns = ['account', 'patterns', 'status', 'measurements', 'sets', inputNs]
const SetNameWrapper = ({ name, children }) => (
<div className="flex flex-col items-center">
{children}
<b>{name}</b>
</div>
)
const SetLineup = ({ sets = [], lang, href = false, onClick = false }) => (
const SetLineup = ({ sets = [], href = false, onClick = false }) => (
<div
className={`w-full flex flex-row ${
sets.length > 1 ? 'justify-start px-8' : 'justify-center'
@ -83,10 +76,9 @@ const SetLineup = ({ sets = [], lang, href = false, onClick = false }) => (
if (onClick) props.onClick = () => onClick(set)
else if (typeof href === 'function') props.href = href(set.id)
let img = <div {...props} key={set.id}></div>
if (onClick) img = <button {...props} key={set.id}></button>
else if (href) img = <Link {...props} key={set.id}></Link>
return <SetNameWrapper name={set[`name${capitalize(lang)}`]}>{img}</SetNameWrapper>
if (onClick) return <button {...props} key={set.id}></button>
else if (href) return <Link {...props} key={set.id}></Link>
else return <div {...props} key={set.id}></div>
})}
</div>
)
@ -103,7 +95,7 @@ const ShowCuratedSet = ({ cset }) => {
<>
<h2>{cset[`name${capitalize(lang)}`]}</h2>
<div className="w-full">
<SetLineup sets={[cset]} lang={lang} />
<SetLineup sets={[cset]} />
</div>
<div className="flex flex-wrap flex-row gap-2 w-full mt-4 items-center justify-end">
@ -214,8 +206,6 @@ export const CuratedSets = ({ href = false, clickHandler = false, published = tr
// Hooks
const backend = useBackend()
const { setLoadingStatus } = useContext(LoadingStatusContext)
const { i18n } = useTranslation(ns)
const lang = i18n.language
// State
const [sets, setSets] = useState([])
@ -246,7 +236,7 @@ export const CuratedSets = ({ href = false, clickHandler = false, published = tr
return (
<div className="max-w-7xl xl:pl-4">
<SetLineup {...lineupProps} lang={lang} />
<SetLineup {...lineupProps} />
{selected && <ShowCuratedSet cset={sets[selected]} />}
</div>
)
@ -255,8 +245,7 @@ export const CuratedSets = ({ href = false, clickHandler = false, published = tr
// Component for the maintaining the list of curated-sets
export const CuratedSetsList = ({ href = false }) => {
// Hooks
const { t, i18n } = useTranslation(ns)
const lang = i18n.language
const { t } = useTranslation(ns)
const backend = useBackend()
const { setLoadingStatus, LoadingProgress } = useContext(LoadingStatusContext)
const [refresh, setRefresh] = useState(0)
@ -382,7 +371,7 @@ export const CuratedSetsList = ({ href = false }) => {
))}
</tbody>
</table>
<SetLineup {...lineupProps} lang={lang} />
<SetLineup {...lineupProps} />
</div>
)
}