This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
사용자가 시작 버튼으로 시작가능 #5
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import BasicLayout from "~/components/ui/BasicLayout"; | ||
import { Textarea } from "~/components/ui/textarea"; | ||
import { getActivity } from "~/models/activity"; | ||
|
||
export default function ActivitiesStartPage({ | ||
params, | ||
}: { | ||
params: { "activity-id": string }; | ||
}) { | ||
return ( | ||
<BasicLayout> | ||
<div className="flex flex-col items-center w-full gap-y-4"> | ||
<Timer /> | ||
<Editor activityId={params["activity-id"]} /> | ||
</div> | ||
</BasicLayout> | ||
); | ||
} | ||
|
||
function Timer() { | ||
return ( | ||
<> | ||
00:00:00 | ||
<hr className="text-gray-500 w-full" /> | ||
</> | ||
); | ||
} | ||
|
||
async function Editor({ activityId }: { activityId: string }) { | ||
if (!activityId) { | ||
return "존재하지 않는 활동이에요!"; | ||
} | ||
|
||
const activity = await getActivity({ activityId }); | ||
|
||
return ( | ||
<section className="w-full"> | ||
<div className="pb-4"> | ||
<h1 className="font-bold">{activity.name}</h1> | ||
<p className="text-sm text-gray-500">{activity.description}</p> | ||
</div> | ||
<Textarea autoFocus className="h-[80vh]" /> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import AddButton from "~/app/activities/features/AddButton"; | ||
import AcgivityList from "./activities/widgets/ActivityList"; | ||
import BasicLayout from "~/components/ui/BasicLayout"; | ||
|
||
export default async function HomePage() { | ||
return ( | ||
<main className="flex max-w-96 m-auto min-h-screen flex-col items-center justify-between p-8"> | ||
<BasicLayout> | ||
<div className="flex flex-col items-center w-full gap-y-4"> | ||
00:00:00 | ||
<hr className="text-gray-500 w-full" /> | ||
<AddButton /> | ||
<AcgivityList /> | ||
</div> | ||
</main> | ||
</BasicLayout> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
|
||
export default function BasicLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<main className="flex max-w-96 m-auto min-h-screen flex-col items-center justify-between p-8"> | ||
{children} | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from "react" | ||
|
||
import { cn } from "~/lib/utils" | ||
|
||
export interface TextareaProps | ||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {} | ||
|
||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<textarea | ||
className={cn( | ||
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", | ||
className | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
) | ||
} | ||
) | ||
Textarea.displayName = "Textarea" | ||
|
||
export { Textarea } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Editor
function component is defined asasync
, which is not typical for React components and can lead to unintended behavior. React components should not be asynchronous. Consider fetching data outside of the component or using effects/hooks for asynchronous operations.Committable suggestion