Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { InterviewQuizResultPageSkeleton } from '@/pages/interview/interviewQuiz
import { InterviewStatisticsPageSkeleton } from '@/pages/interview/interviewStatistics';
import { MainPageSkeleton } from '@/pages/interview/main';
import { ProfilePageSkeleton } from '@/pages/profile/profileInfo';
import { UserProfilePageSkeleton } from '@/pages/profile/userProfile';
import { QuestionsPageSkeleton } from '@/pages/wiki/question/questions';

const SkeletonGenerator = () => {
Expand All @@ -31,6 +32,7 @@ const SkeletonGenerator = () => {
ROUTES.admin.questions.details.page,
location.pathname,
);
const isUserProfilePage = matchPath(ROUTES.users.page, location.pathname);

if (isInterviewResultPage) {
return <InterviewQuizResultPageSkeleton />;
Expand All @@ -40,6 +42,10 @@ const SkeletonGenerator = () => {
return <QuestionPageContentSkeleton />;
}

if (isUserProfilePage) {
return <UserProfilePageSkeleton />;
}

switch (location.pathname) {
case ROUTES.appRoute:
return <MainPageSkeleton />;
Expand Down
1 change: 1 addition & 0 deletions src/entities/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export {
export { UserCard } from './ui/UserCard/UserCard';
export { RoleSelect } from './ui/RoleSelect/RoleSelect';
export { UserEditButton } from './ui/UserEditButton/UserEditButton';
export { UserEditButtonSkeleton } from './ui/UserEditButton/UserEditButton.skeleton';
export { UserRolesList } from './ui/UserRolesList/UserRolesList';
export { UserSelect } from './ui/UserSelect/UserSelect';
export { UserSelectSkeleton } from './ui/UserSelect/UserSelect.skeleton';
Expand Down
18 changes: 18 additions & 0 deletions src/entities/user/ui/UserEditButton/UserEditButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,21 @@
margin-left: auto;
font-size: var(--font-size-p-s);
}

.skeleton-link {
margin-left: auto;
width: 100px;
height: 20px;
}

@media (width <=1280px) {
.skeleton-link {
width: 20px;
}
}

@media (width <=720px) {
.skeleton-link-profile {
order: 1;
}
}
13 changes: 13 additions & 0 deletions src/entities/user/ui/UserEditButton/UserEditButton.skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Skeleton } from '@/shared/ui/Skeleton';

import styles from './UserEditButton.module.css';

export const UserEditButtonSkeleton = () => {
return (
<div style={{ flex: '1 0' }} className={styles['skeleton-link-profile']}>
<div className={styles['skeleton-link']}>
<Skeleton width="100%" height="100%" />
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.title {
margin: 0;
}

.content {
display: flex;
flex-direction: row;
Expand All @@ -26,53 +22,6 @@
width: 360px;
}

.separator {
margin: 16px 0;
width: 100%;
height: 1px;
background-color: var(--color-black-50);
}

.profile-card-skeleton,
.card-skeleton {
gap: 0;
height: auto;
}

.profile-card-skeleton {
padding: 16px;
}

.flex-profile-skeleton {
display: flex;
gap: 16px;
}

.card-skeleton {
padding: 24px;
}

.profile-card-skeleton,
.card-skeleton:not(:last-child) {
margin-bottom: 24px;
}

.header-card-skeleton {
margin-bottom: 20px;
}

.sleleton-link {
margin-left: auto;
width: 100px;
height: 20px;
}

@media (width <= 1280px) {
.sleleton-link {
width: 20px;
}
}

@media (width <= 1440px) {
.content {
flex-direction: column-reverse;
Expand All @@ -87,17 +36,3 @@
width: 100%;
}
}

@media (width <= 720px) {
.flex-profile-skeleton {
flex-direction: column;
}

.sleleton-link-profile {
order: -1;
}

.card {
min-height: 100%;
}
}
Original file line number Diff line number Diff line change
@@ -1,97 +1,16 @@
import { Card } from '@/shared/ui/Card';
import { Flex } from '@/shared/ui/Flex';
import { Skeleton } from '@/shared/ui/Skeleton';
import { InfoBlockSkeleton } from '@/widgets/Profile/InfoBlock';
import { SkillsBlockSkeleton } from '@/widgets/Profile/SkillsBlock';
import { UserBlockSkeleton } from '@/widgets/Profile/UserBlock';

import styles from './ProfilePage.module.css';

export const ProfilePageSkeleton = () => {
return (
<div className={styles.content}>
<div className={styles.container}>
<Card className={styles['profile-card-skeleton']}>
<div className={styles['flex-profile-skeleton']}>
<Flex gap="8" direction="column">
<Skeleton width={170} height={188} borderRadius={20} />
<Flex direction="column" gap="4">
<Skeleton width={170} height={18} />
<Skeleton width={170} height={18} />
</Flex>
</Flex>
<Flex direction="column" gap="12">
<Flex align="center" gap="8">
<Skeleton width={271} height={27} />
<Skeleton
width={73}
height={20}
borderRadius={20}
style={{ alignSelf: 'self-start' }}
/>
</Flex>
<Flex direction="column" gap="8" style={{ marginBottom: '30px' }}>
{[...Array(4)].map((_, index) => (
<span key={index}>
<Skeleton width={190} height={14} />
</span>
))}
</Flex>
<Flex direction="column" gap="8">
{[...Array(2)].map((_, index) => (
<span key={index}>
<Skeleton width={190} height={14} />
</span>
))}
</Flex>
<Flex gap="4">
{[...Array(6)].map((_, index) => (
<span key={index}>
<Skeleton height={24} width={24} borderRadius={50} />
</span>
))}
</Flex>
</Flex>
<div style={{ flex: '1 0' }} className={styles['sleleton-link-profile']}>
<div className={styles['sleleton-link']}>
<Skeleton width="100%" height="100%" />
</div>
</div>
</div>
</Card>
<Card className={styles['card-skeleton']}>
<div className={styles['header-card-skeleton']}>
<Flex gap="16" justify="between">
<Skeleton width={81} height={27} />
<div style={{ flex: '1 0' }}>
<div className={styles['sleleton-link']}>
<Skeleton width="100%" height="100%" />
</div>
</div>
</Flex>
</div>
<Flex direction="column" gap="8" style={{ width: '100%' }}>
{[...Array(6)].map((_, index) => (
<Skeleton width="100%" height={14} key={index} />
))}
</Flex>
</Card>
<Card className={styles['card-skeleton']}>
<div className={styles['header-card-skeleton']}>
<Flex gap="16" justify="between">
<Skeleton width={81} height={27} />
<div style={{ flex: '1 0' }}>
<div className={styles['sleleton-link']}>
<Skeleton width="100%" height="100%" />
</div>
</div>
</Flex>
</div>
<Flex gap="8" style={{ flexWrap: 'wrap' }}>
{[...Array(8)].map((_, index) => (
<span key={index}>
<Skeleton width={index % 2 === 0 ? 110 : 140} height={42} />
</span>
))}
</Flex>
</Card>
<UserBlockSkeleton />
<InfoBlockSkeleton />
<SkillsBlockSkeleton />
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.title {
margin: 0;
}

.content {
display: flex;
flex-direction: row;
Expand All @@ -26,52 +22,6 @@
width: 360px;
}

.separator {
margin: 16px 0;
width: 100%;
height: 1px;
background-color: var(--color-black-50);
}

.profile-card-skeleton,
.card-skeleton {
gap: 0;
height: auto;
}

.profile-card-skeleton {
padding: 16px;
}

.flex-profile-skeleton {
display: flex;
gap: 16px;
}

.card-skeleton {
padding: 24px;
}

.profile-card-skeleton,
.card-skeleton:not(:last-child) {
margin-bottom: 24px;
}

.header-card-skeleton {
margin-bottom: 20px;
}

.sleleton-link {
margin-left: auto;
width: 100px;
height: 20px;
}

@media (width <= 1280px) {
.sleleton-link {
width: 20px;
}
}

@media (width <= 1440px) {
.content {
Expand All @@ -89,18 +39,6 @@
}

@media (width <= 720px) {
.flex-profile-skeleton {
flex-direction: column;
}

.sleleton-link-profile {
order: -1;
}

.card {
min-height: 100%;
}

.content {
gap: 0
}
Expand Down
Loading