-
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 #44 from YAPP-Github/feature/workbook-41
[ Feature/workbook 41 ] Skeleton 화면 구현
- Loading branch information
Showing
17 changed files
with
127 additions
and
28 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
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
# dependencies | ||
.env | ||
.env.production | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
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,22 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
// 환경 변수를 읽어들임 | ||
const runtime = process.env.NODE_ENV === 'production' ? 'edge' : 'nodejs'; | ||
|
||
const configContent = `export const runtime = '${runtime}';\n`; | ||
|
||
const configDir = path.join(process.cwd(), 'src/config'); | ||
const configPath = path.join(configDir, 'runtime.js'); | ||
|
||
// 디렉토리가 존재하지 않으면 생성 | ||
if (!fs.existsSync(configDir)) { | ||
fs.mkdirSync(configDir, { recursive: true }); | ||
} | ||
|
||
// runtime.js 파일 생성 | ||
fs.writeFileSync(configPath, configContent, 'utf8'); | ||
|
||
console.log(`Runtime configuration written to ${configPath}`); | ||
|
||
|
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Skeleton } from "@shared/components/ui/skeleton"; | ||
|
||
export default function ContentSkeleton ({ | ||
className, | ||
...props | ||
}: React.HTMLAttributes<HTMLDivElement>) { | ||
return ( | ||
<Skeleton className={className} {...props} /> | ||
) | ||
} |
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 @@ | ||
export const runtime = 'nodejs'; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { cn } from "@shared/utils/cn" | ||
|
||
function Skeleton({ | ||
className, | ||
...props | ||
}: React.HTMLAttributes<HTMLDivElement>) { | ||
return ( | ||
<div | ||
className={cn("animate-pulse rounded-md bg-muted", className)} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
export { Skeleton } |
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,5 @@ | ||
export const _1_SECOND = 1_000; | ||
export const _3_SECOND = 3_000; | ||
|
||
|
||
export const delay = (second = _3_SECOND) => new Promise((resolve) => setTimeout(resolve, second)); |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Skeleton } from "@shared/components/ui/skeleton"; | ||
|
||
import ContentSkeleton from "@common/components/ContentSkeleton"; | ||
|
||
export default function WorkbookSkeleton() { | ||
const skeletonItems = new Array(6).fill(null); | ||
|
||
return ( | ||
<div className="flex h-[100vh] w-full flex-col items-center overflow-x-hidden"> | ||
<Skeleton className="h-[338px] w-full" /> | ||
|
||
{/* Content Skeleton */} | ||
<div className="mt-[70px] w-full"> | ||
<ContentSkeleton className="h-[30px]" style={{ width: "60%" }} /> | ||
<ContentSkeleton | ||
className="h-[30px]" | ||
style={{ width: "80%", marginTop: "9px" }} | ||
/> | ||
{skeletonItems.map((_, index) => ( | ||
<ContentSkeleton | ||
key={index} | ||
className="h-[30px] w-full" | ||
style={{ marginTop: "9px" }} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} |
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