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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from f-lab-edu/feat/3/start-activity
사용자가 시작 버튼으로 시작가능
- Loading branch information
Showing
8 changed files
with
156 additions
and
12 deletions.
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