Skip to content

Commit

Permalink
Merge pull request #1550 from Vizzuality/MRXN23-484-fe-consider-wheth…
Browse files Browse the repository at this point in the history
…er-to

[MRXN23-484]: notifies user about project creation ongoing
  • Loading branch information
agnlez authored Oct 17, 2023
2 parents a593a57 + ca92321 commit d3e6e3c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/modal/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const CONTENT_CLASSES = {
wide: `w-full sm:w-10/12 md:w-10/12 lg:w-10/12 xl:w-9/12 2xl:w-6/12 ${COMMON_CONTENT_CLASSES}`,
};

const OVERLAY_CLASSES = 'z-50 fixed inset-0 bg-black bg-blur';
const OVERLAY_CLASSES = 'z-40 fixed inset-0 bg-black bg-blur';

export const Modal: React.FC<ModalProps> = ({
id,
Expand Down
15 changes: 13 additions & 2 deletions app/layout/projects/new/form/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,26 @@ const ProjectForm = ({ onFormUpdate }: ProjectFormProps): JSX.Element => {
organizationId: organizationsData[0].id || '7f1fb7f8-1246-4509-89b9-f48b6f976e3f',
} satisfies NewProjectFields & { organizationId: string };

addToast(
'info-project-creation',
<>
<h2 className="font-medium">Your project is being created.</h2>
<p className="text-sm">This might take a few seconds.</p>
</>,
{
level: 'info',
}
);

saveProjectMutation.mutate(
{ data },
{
onSuccess: ({ data: { data: p } }) => {
addToast(
'success-project-creation',
<>
<h2 className="font-medium">Success!</h2>
<p className="text-sm">Project saved successfully</p>
<h2 className="font-medium">Your project has been created.</h2>
<p className="text-sm">You will be redirected to the dashboard.</p>
</>,
{
level: 'success',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export const PlanningAreaGridUploader: React.FC<PlanningAreaGridUploaderProps> =
size="xl"
type="submit"
onClick={() => setOpened(false)}
disabled={loading}
>
Save
</Button>
Expand Down

1 comment on commit d3e6e3c

@vercel
Copy link

@vercel vercel bot commented on d3e6e3c Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marxan – ./

marxan23.vercel.app
marxan-git-develop-vizzuality1.vercel.app
marxan-vizzuality1.vercel.app

Please sign in to comment.