Skip to content

Commit

Permalink
fix(pages): change EditView component to EditEditor, EditableView to …
Browse files Browse the repository at this point in the history
…EditableEditor, ContentView to ContentEditor

These components have been swapped to versions without any layout stylings. The previously used components were wrapped in Containers that had stylings for margins. In the context of DSC landing page, these margins are not necessary and detracted from the appearance of the editable content.
  • Loading branch information
ktun95 committed Feb 29, 2024
1 parent 07780a9 commit 415545e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/stock-center/src/pages/index/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CatalogLinks,
FileLinks,
} from "@dictybase/ui-dsc"
import { EditView, LoadingDisplay, OtherError } from "@dictybase/ui-common"
import { EditEditor, LoadingDisplay, OtherError } from "@dictybase/ui-common"
import { useContentBySlugQuery } from "dicty-graphql-schema"
import { match, P } from "ts-pattern"
import { ACCESS, useTokenAndUser } from "auth"
Expand All @@ -33,7 +33,7 @@ const EditHomepage = () => {
.with(
{ data: { contentBySlug: P.select({ content: P.string }) } },
(content) => (
<EditView
<EditEditor
data={content}
userId={user?.email as string}
token={token as string}
Expand Down
8 changes: 6 additions & 2 deletions apps/stock-center/src/pages/index/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
CatalogLinks,
FileLinks,
} from "@dictybase/ui-dsc"
import { EditableView, LoadingDisplay, OtherError } from "@dictybase/ui-common"
import {
EditableEditor,
LoadingDisplay,
OtherError,
} from "@dictybase/ui-common"
import { useContentBySlugQuery } from "dicty-graphql-schema"
import { match, P } from "ts-pattern"
import { ACCESS } from "auth"
Expand All @@ -30,7 +34,7 @@ const EditableHomepage = () => {
{match(result)
.with(
{ data: { contentBySlug: P.select({ content: P.string }) } },
(content) => <EditableView data={content} />,
(content) => <EditableEditor data={content} />,
)
.with({ loading: true }, () => <LoadingDisplay rows={4} />)
.with({ error: P.not(undefined) }, () => <OtherError />)
Expand Down
4 changes: 2 additions & 2 deletions apps/stock-center/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CatalogLinks,
FileLinks,
} from "@dictybase/ui-dsc"
import { ContentView, LoadingDisplay, OtherError } from "@dictybase/ui-common"
import { LoadingDisplay, OtherError, ContentEditor } from "@dictybase/ui-common"
import { useContentBySlugQuery } from "dicty-graphql-schema"
import { match, P } from "ts-pattern"
import { ACCESS } from "auth"
Expand All @@ -31,7 +31,7 @@ const ShowHomepage = () => {
{match(result)
.with(
{ data: { contentBySlug: P.select({ content: P.string }) } },
(content) => <ContentView data={content} />,
(content) => <ContentEditor data={content} />,
)
.with({ loading: true }, () => <LoadingDisplay rows={4} />)
.with({ error: P.not(undefined) }, () => <OtherError />)
Expand Down
4 changes: 2 additions & 2 deletions apps/stock-center/src/pages/index/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CatalogLinks,
FileLinks,
} from "@dictybase/ui-dsc"
import { ContentView, LoadingDisplay, OtherError } from "@dictybase/ui-common"
import { LoadingDisplay, OtherError, ContentEditor } from "@dictybase/ui-common"
import { useContentBySlugQuery } from "dicty-graphql-schema"
import { match, P } from "ts-pattern"
import { ACCESS } from "auth"
Expand All @@ -31,7 +31,7 @@ const ShowHomepage = () => {
{match(result)
.with(
{ data: { contentBySlug: P.select({ content: P.string }) } },
(content) => <ContentView data={content} />,
(content) => <ContentEditor data={content} />,
)
.with({ loading: true }, () => <LoadingDisplay rows={4} />)
.with({ error: P.not(undefined) }, () => <OtherError />)
Expand Down

0 comments on commit 415545e

Please sign in to comment.