-
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.
* feat: add skeleton UI components for chatting, question, and reply lists * feat: add skeleton UI components for QuestionReplyPage, SessionPage, and route
- Loading branch information
Showing
9 changed files
with
150 additions
and
8 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
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
43 changes: 43 additions & 0 deletions
43
apps/client/src/widgets/chatting-list/ChattingListSkeletonUI.tsx
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,43 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
function ChattingListSkeletonUI() { | ||
const [shouldRender, setShouldRender] = useState(false); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setShouldRender(true); | ||
}, 500); | ||
|
||
return () => clearTimeout(timer); | ||
}, []); | ||
|
||
return ( | ||
<div className='inline-flex h-full w-1/5 min-w-[240px] flex-col items-center justify-start rounded-lg bg-slate-50 shadow'> | ||
{shouldRender && ( | ||
<> | ||
<div className='inline-flex h-[54px] w-full items-center justify-between border-b border-gray-200 px-4 py-3'> | ||
<div className='h-7 w-24 animate-pulse rounded bg-indigo-100'></div> | ||
<div className='h-6 w-20 animate-pulse rounded bg-green-100'></div> | ||
</div> | ||
|
||
<div className='inline-flex h-full w-full flex-col items-start justify-start gap-3 overflow-y-auto p-2.5'> | ||
<div className='flex w-full flex-col gap-3'> | ||
{[...Array(6)].map((_, i) => ( | ||
<div key={i} className='flex w-3/4 flex-col gap-1'> | ||
<div className='h-4 w-16 animate-pulse rounded bg-indigo-100'></div> | ||
<div className='h-12 animate-pulse rounded-lg bg-indigo-50 p-2'></div> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
|
||
<div className='inline-flex h-[75px] w-full items-center justify-center gap-2.5 border-t border-gray-200 bg-gray-50 p-4'> | ||
<div className='h-12 w-full animate-pulse rounded-md bg-white'></div> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default ChattingListSkeletonUI; |
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 +1,2 @@ | ||
export { default as ChattingList } from './ChattingList'; | ||
export { default as ChattingListSkeletonUI } from './ChattingListSkeletonUI'; |
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 +1,2 @@ | ||
export { default as QuestionList } from './ui/QuestionList'; | ||
export { default as QuestionListSkeletonUI } from './ui/QuestionListSkeletonUI'; |
44 changes: 44 additions & 0 deletions
44
apps/client/src/widgets/question-list/ui/QuestionListSkeletonUI.tsx
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,44 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
function QuestionListSkeletonUI() { | ||
const [shouldRender, setShouldRender] = useState(false); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setShouldRender(true); | ||
}, 500); | ||
|
||
return () => clearTimeout(timer); | ||
}, []); | ||
|
||
return ( | ||
<div className='inline-flex h-full w-4/5 flex-grow animate-pulse flex-col items-center justify-start rounded-lg bg-slate-50 shadow'> | ||
{shouldRender && ( | ||
<> | ||
<div className='inline-flex h-[54px] w-full items-center justify-between border-b border-gray-200 px-8 py-2'> | ||
<div className='h-6 w-32 animate-pulse rounded bg-indigo-100'></div> | ||
<div className='flex gap-2'> | ||
<div className='h-8 w-16 animate-pulse rounded bg-indigo-100'></div> | ||
<div className='h-8 w-20 animate-pulse rounded bg-indigo-100'></div> | ||
</div> | ||
</div> | ||
<div className='flex w-full flex-col gap-4 p-8'> | ||
<div className='space-y-4'> | ||
<hr className='h-1 w-full animate-pulse rounded bg-indigo-100' /> | ||
<div className='h-20 w-full animate-pulse rounded bg-indigo-50'></div> | ||
<div className='h-20 w-full animate-pulse rounded bg-indigo-50'></div> | ||
</div> | ||
<div className='space-y-4'> | ||
<hr className='h-1 w-full animate-pulse rounded bg-indigo-100' /> | ||
<div className='h-20 w-full animate-pulse rounded bg-indigo-50'></div> | ||
<div className='h-20 w-full animate-pulse rounded bg-indigo-50'></div> | ||
<div className='h-20 w-full animate-pulse rounded bg-indigo-50'></div> | ||
</div> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default QuestionListSkeletonUI; |
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 +1,2 @@ | ||
export { default as ReplyList } from './ui/ReplyList'; | ||
export { default as ReplyListSkeletonUI } from './ui/ReplyListSkeletonUI'; |
41 changes: 41 additions & 0 deletions
41
apps/client/src/widgets/reply-list/ui/ReplyListSkeletonUI.tsx
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,41 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
function ReplyListSkeletonUI() { | ||
const [shouldRender, setShouldRender] = useState(false); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setShouldRender(true); | ||
}, 500); | ||
|
||
return () => clearTimeout(timer); | ||
}, []); | ||
|
||
return ( | ||
<div className='inline-flex h-full w-4/5 flex-grow animate-pulse flex-col items-center justify-start rounded-lg bg-slate-50 shadow'> | ||
{shouldRender && ( | ||
<> | ||
<div className='inline-flex h-[54px] w-full items-center justify-between border-b border-gray-200 px-8 py-2'> | ||
<div className='flex flex-row items-center gap-2'> | ||
<div className='h-6 w-6 animate-pulse rounded bg-indigo-100'></div> | ||
<div className='h-6 w-24 animate-pulse rounded bg-indigo-100'></div> | ||
</div> | ||
<div className='h-8 w-20 animate-pulse rounded bg-indigo-100'></div> | ||
</div> | ||
<div className='inline-flex h-full w-full flex-col items-start justify-start gap-4 overflow-y-auto pb-4'> | ||
<div className='flex h-fit flex-col items-start justify-center gap-2.5 self-stretch border-b border-gray-200/50 px-12 py-4'> | ||
<div className='h-24 w-full animate-pulse rounded bg-indigo-50'></div> | ||
</div> | ||
<div className='flex w-full flex-col gap-4 px-12'> | ||
<div className='h-32 w-full animate-pulse rounded-lg bg-indigo-50 p-4'></div> | ||
<div className='h-32 w-full animate-pulse rounded-lg bg-indigo-50 p-4'></div> | ||
<div className='h-32 w-full animate-pulse rounded-lg bg-indigo-50 p-4'></div> | ||
</div> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default ReplyListSkeletonUI; |