hngprojects / hng_boilerplate_nextjs

https://deployment.nextjs.boilerplate.hng.tech
206 stars 264 forks source link

[Feature]:Implement Invite Link Retrieval and Display when toggle is active #1060

Open Zaraorji opened 2 months ago

Zaraorji commented 2 months ago

Description

When the toggle is active the frontend should request the invite link from the backend and display it in the UI. This invite link allows anyone to join the workspace. Admins should be able to copy this link easily using the provided "Copy link" button.

User Story:

As an admin, I want to toggle the invite link option to be active and have the invite link automatically retrieved from the backend and displayed, so I can easily share the link to invite others to join my workspace.

Requirements:

  1. When the toggle switch is enabled, the frontend should make an API call to the backend to retrieve the invite link. The invite link should be displayed in the invite link field. The "Copy link" button should be enabled and allow the admin to copy the invite link to the clipboard.
  2. When the toggle switch is disabled, The invite link field and "Copy link" button should not be displayed.
  3. If there is an error retrieving the invite link from the backend, display an appropriate error message and keep the invite link field hidden.

Acceptance Criteria

Expected Outcome:

The invite link is retrieved from the backend and displayed only when the toggle switch is enabled, Admins can copy the link, and any errors in fetching the link are appropriately handled and communicated.

Links

https://github.com/hngprojects/hng_boilerplate_nestjs/issues/808 (backend) | [FIGMA LINK] (https://www.figma.com/design/VEItfX6St5NSAqqNHImcxD/HNG-Boilerplate-Designs?node-id=10-16358&m=dev)

Images

image

Robinson-Taiwo commented 2 months ago

i'd like to work on this