Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

パンくずリストを表示した #82

Merged
merged 4 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"editor.formatOnSave": false
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.markdownlint": true
"source.fixAll.eslint": "explicit",
"source.fixAll.markdownlint": "explicit"
},
"cSpell.words": [
"automerge",
Expand Down
24 changes: 24 additions & 0 deletions src/app/[slug]/[date]/_components/NippoBreadcrumbs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client';

import { BreadcrumbItem, Breadcrumbs, Link } from '@nextui-org/react';
import { FC } from 'react';
import { URLS } from '~/app/_constants/urls';
import { Objective } from '~/domains/Objective';

type Props = {
objective: Objective;
date: string;
};

export const NippoBreadcrumbs: FC<Props> = ({ objective, date }) => {
return (
<Breadcrumbs size="sm">
<BreadcrumbItem>
<Link size="sm" href={URLS.SLUG(objective.slug)} className="text-black">
{objective.name}
</Link>
</BreadcrumbItem>
<BreadcrumbItem>{date}</BreadcrumbItem>
</Breadcrumbs>
);
};
6 changes: 3 additions & 3 deletions src/app/[slug]/[date]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Metadata } from 'next';
import { NippoBreadcrumbs } from './_components/NippoBreadcrumbs';
import { getNippoByDate } from '~/app/_actions/nippoActions';
import { getObjectiveBySlug } from '~/app/_actions/objectiveActions';
import { URLS } from '~/app/_constants/urls';
import { generateNippoMetadata } from '~/libs/generateNippoMetadata';
import { fetchMe } from '~/app/_actions/userActions';
import { NippoEditor } from '~/app/_components/domains/Nippo/NippoEditor';
import { getDateString } from '~/libs/getDateString';
import { ObjectiveStickyHeader } from '~/app/_components/domains/Objective/ObjectiveStickyHeader';
import { NippoPreview } from '~/app/_components/domains/Nippo/NippoPreview';

type Props = { params: { slug: string; date: string } };
Expand All @@ -29,8 +29,8 @@ export default async function Page({ params }: Props) {
return (
<div className="drop-shadow-sm">
<div className="min-h-[500px] max-w-[1024px] mx-auto flex gap-[16px] md:gap-[48px]">
<div className="px-[8px] pt-[16px] pb-[32px] w-[100%]">
<ObjectiveStickyHeader objective={objective} />
<div className="px-[8px] pt-[8px] pb-[32px] w-[100%]">
<NippoBreadcrumbs objective={objective} date={dateString} />
<p className="mt-[32px] text-xl font-bold mb-[8px] text-gray-700">{dateString}</p>
{currentUser?._id === objective.createdUserId ? (
<NippoEditor objectiveId={objective._id} nippo={nippo} />
Expand Down
Loading