Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: backoffice team bug fix #2036

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions apps/back-office/components/footer-buttons/footer-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useState } from 'react';

export function FooterButtons(props) {
const [openModal, setOpenModal] = useState(false);
const teamRoute = router.pathname === "/team-view";
const saveButtonClassName = props.disableSave
? 'shadow-special-button-default inline-flex w-full justify-center rounded-full bg-slate-400 px-6 py-2 text-base font-semibold leading-6 text-white outline-none'
: 'on-focus leading-3.5 text-md mb-2 mr-2 flex items-center rounded-full border border-blue-600 bg-blue-600 px-4 py-3 text-left font-medium text-white last:mr-0 focus-within:rounded-full hover:border-slate-400 focus:rounded-full focus-visible:rounded-full';
Expand All @@ -38,7 +39,7 @@ export function FooterButtons(props) {
await api.patch(`${API_ROUTE.PARTICIPANTS_REQUEST}/${id}`, data, configuration)
message = status === "REJECTED"
? `Successfully ${APP_CONSTANTS.REJECTED_LABEL}`
: `Successfully ${isVerified ? APP_CONSTANTS.VERIFIED_FLAG : APP_CONSTANTS.UNVERIFIED_FLAG}`;
: `Successfully ${isVerified ? (teamRoute ? APP_CONSTANTS.APPROVED_LABEL : APP_CONSTANTS.VERIFIED_FLAG ): APP_CONSTANTS.UNVERIFIED_FLAG}`;
}
setOpenModal(false)
toast(message);
Expand Down Expand Up @@ -92,7 +93,7 @@ export function FooterButtons(props) {
Are you sure you want to reject?
</div>
<div className='text-sm font-normal leading-5 text-left'>
Clicking reject will remove the member from the list.
Clicking reject will remove the {teamRoute ? "team" : "member" } from the list.
</div>

<div className="flex gap-[8px] mt-[25px] justify-end">
Expand Down Expand Up @@ -135,7 +136,7 @@ export function FooterButtons(props) {
</div>
<div className="col-span-3 justify-self-end">
<div className="flex items-end space-x-3">
{props.from !== "approved" &&
{props.from !== "approved" && !teamRoute &&
<button
onClick={() => approvelClickHandler(props?.id, "APPROVED", false, props?.setLoader)}
disabled={props.isEditEnabled}
Expand All @@ -153,11 +154,22 @@ export function FooterButtons(props) {
disabled={props.isEditEnabled}
onClick={() => approvelClickHandler(props?.id, "APPROVED", true, props?.setLoader)}
>
{!props.isEditEnabled ?
<img height={20} width={20} src="assets/images/verified.svg" alt="verified" /> :
<img height={20} width={20} src="/assets/icons/upgrade-rounded.svg" alt="verified" />
{
teamRoute ? (
props.isEditEnabled ? (
<img height={16} width={16} src="assets/images/right_white.svg" alt="verified" />
) : (
<img height={20} width={20} src="assets/icons/tick_green.svg" alt="verified" />
)
) : (
props.isEditEnabled ? (
<img height={20} width={20} src="/assets/icons/upgrade-rounded.svg" alt="verified" />
) : (
<img height={20} width={20} src="assets/images/verified.svg" alt="verified" />
)
)
}
Verify
{teamRoute ? 'Approve' : 'Verify' }
</button>

{props.from !== "approved" &&
Expand Down
10 changes: 10 additions & 0 deletions apps/back-office/public/assets/icons/tick_green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading