Skip to content

Commit

Permalink
命名を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
eatski committed Aug 11, 2024
1 parent 3cf8d1e commit 4218f4a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { useSearchParams } from "next/navigation";
export const EditStorySwitchMode = ({
story,
device,
onSubmit,
saveStory,
}: {
story: Story;
device: Device;
onSubmit: (data: StoryInit) => Promise<void>;
saveStory: (data: StoryInit) => Promise<void>;
}) => {
const searchParams = useSearchParams();
const mode = searchParams?.get("mode");
Expand All @@ -23,7 +23,7 @@ export const EditStorySwitchMode = ({
title: story.title,
id: story.id,
}}
onSubmit={onSubmit}
saveStory={saveStory}
/>
);
} else {
Expand All @@ -32,7 +32,7 @@ export const EditStorySwitchMode = ({
storyId={story.id}
story={story}
device={device}
onSubmit={onSubmit}
saveStory={saveStory}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/stories/[storyId]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default async function StoryEditPage({ params }: { params: unknown }) {
<EditStorySwitchMode
story={story}
device={device}
onSubmit={async (input) => {
saveStory={async (input) => {
"use server";
const ok = await updateStory({
storyId,
Expand Down
6 changes: 3 additions & 3 deletions src/components/editStory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ export type Props = {
storyId: string;
story: StoryInit;
device: Device;
onSubmit: (data: StoryInit) => Promise<void>;
saveStory: (data: StoryInit) => Promise<void>;
};

export const EditStory: React.FC<Props> = ({
storyId,
story,
device,
onSubmit,
saveStory,
}) => {
const { isLoading, mutate, isError } = useMutation(onSubmit);
const { isLoading, mutate, isError } = useMutation(saveStory);
const router = useRouter();
return (
<div className={styles.container}>
Expand Down
6 changes: 3 additions & 3 deletions src/components/editStoryYaml/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export const EditStoryYaml: React.FC<{
title: string;
id: string;
};
onSubmit: (data: StoryInit) => Promise<void>;
}> = ({ story, onSubmit }) => {
saveStory: (data: StoryInit) => Promise<void>;
}> = ({ story, saveStory }) => {
const router = useRouter();
const { mutate, isIdle } = useMutation(onSubmit);
const { mutate, isIdle } = useMutation(saveStory);
const storyId = story.id;

const handleFileRead = useCallback(
Expand Down

0 comments on commit 4218f4a

Please sign in to comment.