Skip to content

Commit

Permalink
Merge pull request #43 from ReoHakase/42/replace-opengraph-image
Browse files Browse the repository at this point in the history
Opengraphの画像を差し替えた他、スタイル修正
  • Loading branch information
ReoHakase authored May 27, 2024
2 parents b000ed7 + bd399a6 commit 3359a27
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 25 deletions.
Binary file added apps/web/src/app/[statLabel]/opengraph-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions apps/web/src/app/[statLabel]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import type { ReactElement } from 'react';
import { Suspense } from 'react';
import { metadata as layoutMetadata, defaultTitle } from '../layout';
import { PopulationChart } from '@/features/population/components/PopulationChart/PopulationChart';
import { PopulationChartSkeleton } from '@/features/population/components/PopulationChart/PopulationChart.skeleton';
import { fetchPrefectures } from '@/infra/resas/fetchPrefectures';
Expand Down Expand Up @@ -55,8 +56,8 @@ const GraphPage = async ({ params, searchParams }: GraphPageProps): Promise<Reac
>
{title}
</h1>
<Suspense key={title} fallback={<PopulationChartSkeleton />}>
<PopulationChart statLabel={statLabel} prefCodes={prefCodes} />
<Suspense key={title} fallback={<PopulationChartSkeleton className={css({ flexGrow: '1' })} />}>
<PopulationChart className={css({ flexGrow: '1' })} statLabel={statLabel} prefCodes={prefCodes} />
</Suspense>
</main>
);
Expand All @@ -79,8 +80,10 @@ export const generateMetadata = async ({ params, searchParams }: GraphPageProps)
return {
title,
openGraph: {
title,
...layoutMetadata.openGraph,
title: `${title} | ${defaultTitle}`,
},
twitter: layoutMetadata.twitter,
};
};

Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const RootLayout: FC<RootLayoutProps> = ({ children }) => (
flexDir: 'column',
p: '6',
flexGrow: '3',
h: 'calc(100svh - token(sizes.20))',
lgDown: {
h: '550px', // CLS対策
},
Expand Down Expand Up @@ -82,8 +83,8 @@ const RootLayout: FC<RootLayoutProps> = ({ children }) => (

export default RootLayout;

const defaultTitle = 'RESAS 都道府県別 人口比較アプリケーション' as const;
const defaultDescription =
export const defaultTitle = 'RESAS 都道府県別 人口比較アプリケーション' as const;
export const defaultDescription =
'RESAS(地域経済分析システム)に掲載されている各種人口データを、都道府県別にグラフで比較できます。' as const;

export const metadata: Metadata = {
Expand Down
Binary file modified apps/web/src/app/opengraph-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/web/src/components/Select/Select.recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const selectSlotRecipe = sva({
},
content: {
pos: 'relative',
zIndex: 50,
zIndex: '100',
minW: 'var(--radix-select-trigger-width)',
overflow: 'hidden',
rounded: 'md',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const Header = ({ ...props }: HeaderProps): ReactNode => {
>
<ThemeSelect />
<Link
href="https://github.com/ReoHakase"
href="https://github.com/ReoHakase/simple-resas-app"
external
referrerPolicy="no-referrer"
className={flex({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ export type PopulationChartSkeletonProps = Omit<ComponentPropsWithoutRef<'div'>,
export const PopulationChartSkeleton = ({ className, ...props }: PopulationChartSkeletonProps): ReactElement => {
return (
<div
className={css({
w: 'full',
h: '600px',
mdDown: {
className={cx(
css({
w: 'full',
h: '400px',
},
animation: 'pulse',
bg: 'keyplate.a.2',
rounded: '2xl',
ring: 'none',
userSelect: 'none',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
})}
animation: 'pulse',
bg: 'keyplate.a.2',
rounded: '2xl',
ring: 'none',
userSelect: 'none',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}),
className,
)}
{...props}
>
<Loader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ export const PopulationChart = async ({
className={cx(
css({
w: 'full',
h: '600px',
mdDown: {
h: '400px',
},
h: '400px',
}),
className,
)}
Expand Down

0 comments on commit 3359a27

Please sign in to comment.