Skip to content

Commit

Permalink
Merge pull request #83 from itizaworld/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
itizawa authored Dec 17, 2023
2 parents be12996 + 6063153 commit 2f21354
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 116 deletions.
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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "6.13.1",
"@typescript-eslint/eslint-plugin": "6.13.2",
"autoprefixer": "^10",
"eslint": "8.55.0",
"eslint-config-next": "14.0.3",
"eslint-config-prettier": "9.0.0",
"eslint-config-next": "14.0.4",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-import": "2.29.0",
Expand All @@ -51,8 +51,8 @@
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"postcss": "^8.4.30",
"prettier": "3.1.0",
"prettier": "3.1.1",
"tailwindcss": "^3.3.3",
"typescript": "5.3.2"
"typescript": "5.3.3"
}
}
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} date={params.date} />
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/domains/Nippo/NippoEditor/NippoEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export const NippoEditor: FC<Props> = ({ objectiveId, nippo, date }) => {

const handleEditorChange = useCallback(
async (body: string) => {
await postNippo({ objectiveId, date: nippo?.date || date, body });
await postNippo({ objectiveId, date, body });
},
[date, nippo?.date, objectiveId],
[date, objectiveId],
);

useEffect(() => {
Expand Down
Loading

0 comments on commit 2f21354

Please sign in to comment.