Show featured to all users
This commit is contained in:
parent
12ed569ff6
commit
b49264ddfa
|
@ -230,7 +230,7 @@ export function PinnedItems(props: {
|
|||
|
||||
return pinned.length > 0 || isEditable ? (
|
||||
<div>
|
||||
<Row className="mb-3 items-center justify-between">
|
||||
<Row className=" items-center justify-between">
|
||||
<SectionHeader label={'Featured'} href={`#`} />
|
||||
{isEditable && (
|
||||
<Button
|
||||
|
@ -265,7 +265,7 @@ export function PinnedItems(props: {
|
|||
</div>
|
||||
)}
|
||||
{pinned.map((element, index) => (
|
||||
<div className="relative my-2">
|
||||
<div className="relative mb-4">
|
||||
{element}
|
||||
|
||||
{editMode && <CrossIcon onClick={() => onDeleteClicked(index)} />}
|
||||
|
|
|
@ -275,9 +275,13 @@ function renderSections(
|
|||
}
|
||||
|
||||
if (id === 'featured') {
|
||||
// For now, only admins can see the featured section, until we all agree its ship-ready
|
||||
if (!isAdmin) return <></>
|
||||
return <FeaturedSection globalConfig={globalConfig} pinned={pinned} />
|
||||
return (
|
||||
<FeaturedSection
|
||||
globalConfig={globalConfig}
|
||||
pinned={pinned}
|
||||
isAdmin={isAdmin}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const contracts = sectionContracts[id]
|
||||
|
@ -396,8 +400,9 @@ function SearchSection(props: {
|
|||
function FeaturedSection(props: {
|
||||
globalConfig: GlobalConfig
|
||||
pinned: JSX.Element[]
|
||||
isAdmin: boolean
|
||||
}) {
|
||||
const { globalConfig, pinned } = props
|
||||
const { globalConfig, pinned, isAdmin } = props
|
||||
const posts = useAllPosts()
|
||||
|
||||
async function onSubmit(selectedItems: { itemId: string; type: string }[]) {
|
||||
|
@ -422,7 +427,7 @@ function FeaturedSection(props: {
|
|||
<Col>
|
||||
<PinnedItems
|
||||
posts={posts}
|
||||
isEditable={true}
|
||||
isEditable={isAdmin}
|
||||
pinned={pinned}
|
||||
onDeleteClicked={onDeleteClicked}
|
||||
onSubmit={onSubmit}
|
||||
|
|
Loading…
Reference in New Issue
Block a user