-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Manage Visibility of Collections UI (#140)
* chore: added basic * chore: populate user on creator application * chore: added status buttons * chore: make buttons available to only collection owners
- Loading branch information
Showing
9 changed files
with
209 additions
and
26 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
apps/client/app/modules/collections/single/components/status-button.tsx
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,99 @@ | ||
import { Button } from '@/components/button/index.tsx' | ||
import { Modal } from '@/components/modal/index.tsx' | ||
import { useDisclosure } from '@/hooks/use-disclosure.tsx' | ||
|
||
interface Props { | ||
collection: Collection | ||
} | ||
export function StatusButton({ collection }: Props) { | ||
if (collection.visibility === 'PRIVATE') { | ||
return <PublishButton /> | ||
} | ||
|
||
return <HideButton /> | ||
} | ||
|
||
function PublishButton() { | ||
const publishModalState = useDisclosure() | ||
|
||
const isSubmitting = false | ||
|
||
const handleSubmit = () => {} | ||
|
||
return ( | ||
<> | ||
<Button onClick={publishModalState.onToggle}>Publish</Button> | ||
<Modal | ||
className="w-full md:w-4/6 lg:w-2/6" | ||
isOpened={publishModalState.isOpened} | ||
onClose={publishModalState.onClose} | ||
> | ||
<div> | ||
<div className="mt-2 grid grid-cols-1"> | ||
<h1 className="text-2xl font-bold">Publish "Name of Content"?</h1> | ||
<p className="mt-2 text-sm"> | ||
This will make the collection public. You can always hide it. | ||
</p> | ||
</div> | ||
<div className="mt-4 flex justify-end gap-2"> | ||
<Button | ||
variant="solid" | ||
color="secondaryGhost" | ||
onClick={publishModalState.onClose} | ||
> | ||
Cancel | ||
</Button> | ||
|
||
<Button variant="solid" onClick={handleSubmit}> | ||
{isSubmitting ? 'Publishing...' : 'Publish'} | ||
</Button> | ||
</div> | ||
</div> | ||
</Modal> | ||
</> | ||
) | ||
} | ||
|
||
function HideButton() { | ||
const hideModalState = useDisclosure() | ||
|
||
const isSubmitting = false | ||
|
||
const handleSubmit = () => {} | ||
|
||
return ( | ||
<> | ||
<Button color="secondaryGhost" onClick={hideModalState.onToggle}> | ||
Hide | ||
</Button> | ||
<Modal | ||
className="w-full md:w-4/6 lg:w-2/6" | ||
isOpened={hideModalState.isOpened} | ||
onClose={hideModalState.onClose} | ||
> | ||
<div> | ||
<div className="mt-2 grid grid-cols-1"> | ||
<h1 className="text-2xl font-bold">Hide "Name of Content"?</h1> | ||
<p className="mt-2 text-sm"> | ||
This will hide the collection from users. You can always publish | ||
it. | ||
</p> | ||
</div> | ||
<div className="mt-4 flex justify-end gap-2"> | ||
<Button | ||
variant="solid" | ||
color="secondaryGhost" | ||
onClick={hideModalState.onClose} | ||
> | ||
Cancel | ||
</Button> | ||
|
||
<Button variant="solid" onClick={handleSubmit}> | ||
{isSubmitting ? 'Hiding...' : 'Hide'} | ||
</Button> | ||
</div> | ||
</div> | ||
</Modal> | ||
</> | ||
) | ||
} |
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
27 changes: 21 additions & 6 deletions
27
services/main/Transformations/CreatorApplicationTransformer.cs
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