diff --git a/app/[frontend]/(pages)/collections/[slug]/layout.tsx b/app/[frontend]/(pages)/collections/[slug]/layout.tsx index 4bba3f41d..f840f055c 100644 --- a/app/[frontend]/(pages)/collections/[slug]/layout.tsx +++ b/app/[frontend]/(pages)/collections/[slug]/layout.tsx @@ -39,9 +39,9 @@ export default async function CollectionTemplateLayout({ return ( + {layouts.hero && } {slug && } - {layouts.hero && } {children} diff --git a/app/[frontend]/(pages)/communities/[slug]/layout.tsx b/app/[frontend]/(pages)/communities/[slug]/layout.tsx index d6eda7365..a688c1fa7 100644 --- a/app/[frontend]/(pages)/communities/[slug]/layout.tsx +++ b/app/[frontend]/(pages)/communities/[slug]/layout.tsx @@ -41,10 +41,10 @@ export default async function CommunityLayout({ return ( + {showNavBar && ( + + )} - {showNavBar && ( - - )} {layouts.hero && } {children} diff --git a/app/[frontend]/(pages)/items/[slug]/layout.tsx b/app/[frontend]/(pages)/items/[slug]/layout.tsx index 97262f61b..297eea2a7 100644 --- a/app/[frontend]/(pages)/items/[slug]/layout.tsx +++ b/app/[frontend]/(pages)/items/[slug]/layout.tsx @@ -46,12 +46,12 @@ export default async function ItemLayout({ return ( + {hero && } {googleScholarData && ( )} {slug && } - {hero && } diff --git a/components/templates/Detail/Full/Full.tsx b/components/templates/Detail/Full/Full.tsx index a9132c76d..6677afeb3 100644 --- a/components/templates/Detail/Full/Full.tsx +++ b/components/templates/Detail/Full/Full.tsx @@ -6,7 +6,7 @@ import Container from "@/components/layout/Container"; import { FullDetailFragment$key } from "@/relay/FullDetailFragment.graphql"; import { useSharedBlockFragment } from "@/components/templates/shared/shared.slots.graphql"; import BlockSlotWrapper from "@/components/templates/mdx/BlockSlotWrapper"; -import { ProcessingMessage } from "@/components/templates/ProcessingCheck"; +import EmptyMessage from "@/components/templates/ProcessingCheck/EmptyMessage"; import type { HeroBackground } from "@/types/graphql-schema"; import TOC from "./TOC"; import styles from "./Full.module.css"; @@ -41,7 +41,7 @@ export default function FullVariant({ {body?.valid && !!body.content ? ( ) : ( - + )} ) : ( @@ -61,9 +61,7 @@ export default function FullVariant({ ) : (
- +
)} diff --git a/components/templates/Detail/Summary/Summary.tsx b/components/templates/Detail/Summary/Summary.tsx index acacece57..8476fa037 100644 --- a/components/templates/Detail/Summary/Summary.tsx +++ b/components/templates/Detail/Summary/Summary.tsx @@ -8,7 +8,6 @@ import Container from "@/components/layout/Container"; import BlockSlotWrapper from "@/components/templates/mdx/BlockSlotWrapper"; import InlineSlotWrapper from "@/components/templates/mdx/InlineSlotWrapper"; import { SummaryDetailFragment$key } from "@/relay/SummaryDetailFragment.graphql"; -import { ProcessingMessage } from "@/components/templates/ProcessingCheck"; import type { HeroBackground } from "@/types/graphql-schema"; import Announcements from "./Announcements"; import styles from "./Summary.module.css"; @@ -28,7 +27,7 @@ export default function Summary({ const subheader = useSharedInlineFragment(slots?.subheader); const summary = useSharedBlockFragment(slots?.summary); - const showNoContent = + const hideTemplate = !detailDefinition?.showAnnouncements && (!header || header?.empty) && (!subheader || subheader?.empty) && @@ -36,40 +35,32 @@ export default function Summary({ if (entity?.__typename === "%other") return null; - return ( + return !hideTemplate ? ( - {showNoContent ? ( -
- +
+
+ {header?.valid && !!header.content && ( +

+ +

+ )} + {subheader?.valid && !!subheader.content && ( +

+ +

+ )} + {summary?.valid && !!summary.content && ( + + )}
- ) : ( - <> -
-
- {header?.valid && !!header.content && ( -

- -

- )} - {subheader?.valid && !!subheader.content && ( -

- -

- )} - {summary?.valid && !!summary.content && ( - - )} -
- {detailDefinition?.showAnnouncements && !!entity?.announcements && ( -
- -
- )} + {detailDefinition?.showAnnouncements && !!entity?.announcements && ( +
+
- - )} + )} +
- ); + ) : null; } const fragment = graphql` diff --git a/components/templates/MainLayout/MainLayout.tsx b/components/templates/MainLayout/MainLayout.tsx index 56bf45420..28c93bd07 100644 --- a/components/templates/MainLayout/MainLayout.tsx +++ b/components/templates/MainLayout/MainLayout.tsx @@ -1,7 +1,7 @@ "use client"; import { graphql, useFragment } from "react-relay"; -import { ProcessingMessage } from "@/components/templates/ProcessingCheck"; +import EmptyMessage from "@/components/templates/ProcessingCheck/EmptyMessage"; import Container from "@/components/layout/Container"; import TemplateFactory from "@/components/templates/Factory"; import { @@ -33,7 +33,7 @@ export default function MainLayout({ return allHidden || !renderedTemplates ? ( - + ) : (
diff --git a/components/templates/Metadata/Metadata.tsx b/components/templates/Metadata/Metadata.tsx index 93ca74bef..1bb64a60b 100644 --- a/components/templates/Metadata/Metadata.tsx +++ b/components/templates/Metadata/Metadata.tsx @@ -11,7 +11,7 @@ import { import InlineSlotWrapper from "@/components/templates/mdx/InlineSlotWrapper"; import BlockSlotWrapper from "@/components/templates/mdx/BlockSlotWrapper"; import Container from "@/components/layout/Container"; -import { ProcessingMessage } from "@/components/templates/ProcessingCheck"; +import EmptyMessage from "@/components/templates/ProcessingCheck/EmptyMessage"; import styles from "./Metadata.module.css"; export default function MetadataTemplate({ @@ -57,7 +57,7 @@ export default function MetadataTemplate({ ) : ( - + ); } diff --git a/components/templates/ProcessingCheck/EmptyMessage.tsx b/components/templates/ProcessingCheck/EmptyMessage.tsx new file mode 100644 index 000000000..f43287000 --- /dev/null +++ b/components/templates/ProcessingCheck/EmptyMessage.tsx @@ -0,0 +1,25 @@ +"use client"; + +import { Trans } from "react-i18next"; +import NoContent from "@/components/layout/messages/NoContent"; + +export default function EmptyMessage({ entityType }: { entityType?: string }) { + const i18nKey = + entityType === "item" ? "messages.empty_item" : "messages.empty"; + const noContentMessage = ( +
+ , +

, +

, + ]} + /> +
+ ); + + return ; +} diff --git a/components/templates/ProcessingCheck/ProcessingCheck.tsx b/components/templates/ProcessingCheck/ProcessingCheck.tsx index dd6e3c142..02ba14049 100644 --- a/components/templates/ProcessingCheck/ProcessingCheck.tsx +++ b/components/templates/ProcessingCheck/ProcessingCheck.tsx @@ -4,7 +4,7 @@ import { PropsWithChildren } from "react"; import { graphql, useFragment } from "react-relay"; import { ProcessingCheckFragment$key } from "@/relay/ProcessingCheckFragment.graphql"; import Container from "@/components/layout/Container"; -import ProcessingMessage from "./ProcessingMessage"; +import EmptyMessage from "./EmptyMessage"; import styles from "./ProcessingCheck.module.css"; type Props = PropsWithChildren & { @@ -19,7 +19,7 @@ export default function ProcessingCheck({ data, children, entityType }: Props) { return allHidden || !templates?.length ? ( - + ) : ( children diff --git a/components/templates/ProcessingCheck/index.ts b/components/templates/ProcessingCheck/index.ts index 244e646c6..359bd7700 100644 --- a/components/templates/ProcessingCheck/index.ts +++ b/components/templates/ProcessingCheck/index.ts @@ -1,3 +1,4 @@ export { default } from "./ProcessingCheck"; export { default as ProcessingMessage } from "./ProcessingMessage"; +export { default as EmptyMessage } from "./EmptyMessage"; diff --git a/components/templates/lists/items/Card/Card.module.css b/components/templates/lists/items/Card/Card.module.css index c1ce79ca9..25e04befa 100644 --- a/components/templates/lists/items/Card/Card.module.css +++ b/components/templates/lists/items/Card/Card.module.css @@ -159,7 +159,7 @@ a:hover &, a:focus-visible & { transform: scale(101%); - transition: scale 170ms ease-in filter 170ms ease-in; + transition: transform 170ms ease-in, filter 170ms ease-in; filter: drop-shadow(1px 0px var(--border-color)) drop-shadow(0px 1px var(--border-color)) drop-shadow(0px -1px var(--border-color)) diff --git a/lib/locales/en.json b/lib/locales/en.json index f704684c2..c73de651a 100644 --- a/lib/locales/en.json +++ b/lib/locales/en.json @@ -270,7 +270,9 @@ "error": "An error occured.", "content": "There was an error rendering this content.", "admin_content": "There was an error rendering this content: {{error}}", - "processing": "<0>Content Currently Being Processed<1>This {{entity}} was recently updated and is being processed before it can be displayed. Please check back in a few minutes.<2>If this message persists, please contact support for assistance." + "processing": "<0>Content Currently Being Processed<1>This {{entity}} was recently updated and is being processed before it can be displayed. Please check back in a few minutes.<2>If this message persists, please contact support for assistance.", + "empty": "<0>This {{entity}} is empty.<1>Please check back soon for updates.<2>If this message persists, please contact support for assistance.", + "empty_item": "<0>This {{entity}} has no content.<1>Please check back soon for updates.<2>If this message persists, please contact support for assistance." }, "analytics": { "regions": {