1
0
Fork 0

chore(shared): Show JSON/YAML buttons on public sets

This commit is contained in:
joostdecock 2024-03-17 17:16:08 +01:00
parent cfe633d438
commit 6bd3009e9f

View file

@ -353,7 +353,7 @@ export const Mset = ({ id, publicOnly = false }) => {
<MsetCard set={mset} control={control} /> <MsetCard set={mset} control={control} />
</div> </div>
<div className="flex flex-col justify-end gap-2 mb-2 grow"> <div className="flex flex-col justify-end gap-2 mb-2 grow">
{account.control > 3 && mset.public && mset.userId !== account.id ? ( {account.control > 2 && mset.public && mset.userId !== account.id ? (
<div className="flex flex-row gap-2 items-center"> <div className="flex flex-row gap-2 items-center">
<a <a
className="badge badge-secondary font-bold badge-lg" className="badge badge-secondary font-bold badge-lg"
@ -401,7 +401,7 @@ export const Mset = ({ id, publicOnly = false }) => {
) : ( ) : (
<span></span> <span></span>
)} )}
{account.control > 2 && mset.public && mset.userId !== account.id ? ( {account.id && account.control > 2 && mset.public && mset.userId !== account.id ? (
<button className="btn btn-primary" title={t('account:importSet')} onClick={importSet}> <button className="btn btn-primary" title={t('account:importSet')} onClick={importSet}>
<div className="flex flex-row gap-4 justify-between items-center w-full"> <div className="flex flex-row gap-4 justify-between items-center w-full">
<UploadIcon /> <UploadIcon />
@ -510,6 +510,7 @@ export const Mset = ({ id, publicOnly = false }) => {
)} )}
{control >= controlLevels.sets.public && ( {control >= controlLevels.sets.public && (
<> <>
{mset.userId === account.id && (
<DisplayRow title={t('public')}> <DisplayRow title={t('public')}>
<div className="flex flex-row gap-2 items-center justify-between"> <div className="flex flex-row gap-2 items-center justify-between">
{mset.public ? ( {mset.public ? (
@ -522,6 +523,7 @@ export const Mset = ({ id, publicOnly = false }) => {
</button> </button>
</div> </div>
</DisplayRow> </DisplayRow>
)}
{mset.public && ( {mset.public && (
<DisplayRow title={t('permalink')}> <DisplayRow title={t('permalink')}>
<PageLink href={`/set?id=${mset.id}`} txt={`/set?id=${mset.id}`} /> <PageLink href={`/set?id=${mset.id}`} txt={`/set?id=${mset.id}`} />