Skip to content

Commit

Permalink
fix: Loading ui bug (#349)
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Groß <mail@gross-johannes.de>
  • Loading branch information
jo-gross authored Aug 6, 2024
1 parent 8c6e375 commit be6a9ab
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion pages/workspaces/[workspaceId]/manage/cards/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { withPagePermission } from '../../../../../middleware/ui/withPagePermiss
import { Role } from '@prisma/client';
import { DeleteConfirmationModal } from '../../../../../components/modals/DeleteConfirmationModal';
import _ from 'lodash';
import { PageCenter } from '../../../../../components/layout/PageCenter';

interface CocktailCardGroupError {
name?: string;
Expand Down Expand Up @@ -82,7 +83,9 @@ function EditCocktailCard() {
}, [id, workspaceId]);

return loadingCard ? (
<Loading />
<PageCenter>
<Loading />
</PageCenter>
) : (
<ManageEntityLayout
backLink={`/workspaces/${workspaceId}/manage/cards`}
Expand Down
5 changes: 4 additions & 1 deletion pages/workspaces/[workspaceId]/manage/cocktails/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { withPagePermission } from '../../../../../middleware/ui/withPagePermiss
import { Role } from '@prisma/client';
import { FormikProps } from 'formik';
import { CocktailRecipeFullWithImage } from '../../../../../models/CocktailRecipeFullWithImage';
import { PageCenter } from '../../../../../components/layout/PageCenter';

function EditCocktailRecipe() {
const router = useRouter();
Expand Down Expand Up @@ -43,7 +44,9 @@ function EditCocktailRecipe() {
}, [id, workspaceId]);

return loading ? (
<Loading />
<PageCenter>
<Loading />
</PageCenter>
) : (
<ManageEntityLayout backLink={`/workspaces/${workspaceId}/manage/cocktails`} title={'Cocktail'} unsavedChanges={unsavedChanges} formRef={formRef}>
<CocktailRecipeForm cocktailRecipe={cocktailRecipe} setUnsavedChanges={setUnsavedChanges} formRef={formRef} />
Expand Down
5 changes: 4 additions & 1 deletion pages/workspaces/[workspaceId]/manage/garnishes/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { withPagePermission } from '../../../../../middleware/ui/withPagePermiss
import { FormikProps } from 'formik';
import { SingleFormLayout } from '../../../../../components/layout/SingleFormLayout';
import { GarnishWithImage } from '../../../../../models/GarnishWithImage';
import { PageCenter } from '../../../../../components/layout/PageCenter';

function EditGarnishPage() {
const router = useRouter();
Expand Down Expand Up @@ -44,7 +45,9 @@ function EditGarnishPage() {
}, [id, workspaceId]);

return loading ? (
<Loading />
<PageCenter>
<Loading />
</PageCenter>
) : (
<ManageEntityLayout backLink={`/workspaces/${workspaceId}/manage/garnishes`} title={'Garnitur'} unsavedChanges={unsavedChanges} formRef={formRef}>
<SingleFormLayout title={'Garnitur erfassen'}>
Expand Down
5 changes: 4 additions & 1 deletion pages/workspaces/[workspaceId]/manage/glasses/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { withPagePermission } from '../../../../../middleware/ui/withPagePermiss
import { FormikProps } from 'formik';
import { SingleFormLayout } from '../../../../../components/layout/SingleFormLayout';
import { GlassWithImage } from '../../../../../models/GlassWithImage';
import { PageCenter } from '../../../../../components/layout/PageCenter';

function EditGlassPage() {
const router = useRouter();
Expand Down Expand Up @@ -44,7 +45,9 @@ function EditGlassPage() {
}, [id, workspaceId]);

return loading ? (
<Loading />
<PageCenter>
<Loading />
</PageCenter>
) : (
<ManageEntityLayout backLink={`/workspaces/${workspaceId}/manage/glasses`} title={'Gläser'} unsavedChanges={unsavedChanges} formRef={formRef}>
<SingleFormLayout title={'Glas erfassen'}>
Expand Down
5 changes: 4 additions & 1 deletion pages/workspaces/[workspaceId]/manage/ingredients/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { withPagePermission } from '../../../../../middleware/ui/withPagePermiss
import { FormikProps } from 'formik';
import { SingleFormLayout } from '../../../../../components/layout/SingleFormLayout';
import { IngredientWithImage } from '../../../../../models/IngredientWithImage';
import { PageCenter } from '../../../../../components/layout/PageCenter';

function EditCocktailRecipe() {
const router = useRouter();
Expand Down Expand Up @@ -44,7 +45,9 @@ function EditCocktailRecipe() {
}, [id, workspaceId]);

return loading ? (
<Loading />
<PageCenter>
<Loading />
</PageCenter>
) : (
<ManageEntityLayout backLink={`/workspaces/${workspaceId}/manage/ingredients`} title={'Zutaten'} unsavedChanges={unsavedChanges} formRef={formRef}>
<SingleFormLayout title={'Zutat erfassen'}>
Expand Down

0 comments on commit be6a9ab

Please sign in to comment.