Skip to content
Merged
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
7 changes: 7 additions & 0 deletions src/components/AccountHeader/AccountHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type AccountHeaderProps = {
guestMode?: boolean;
setOpenLoginModal?: (handleOpenLoginModal: boolean) => void;
isTestUser?: boolean;
id?: number;
usernameLong?: any;
};

const AccountHeader: FC<AccountHeaderProps> = ({
Expand Down Expand Up @@ -70,6 +72,9 @@ const AccountHeader: FC<AccountHeaderProps> = ({
guestMode,
setOpenLoginModal,
isTestUser,
id,

usernameLong,
}) => {
const handleOpenImageUpload = () => {
setOpenCoverImgModal(true);
Expand Down Expand Up @@ -119,6 +124,8 @@ const AccountHeader: FC<AccountHeaderProps> = ({
achievementTooltipTxt={achievementTooltipTxt}
yourPointsUserPage={yourPointsUserPage}
levelDetails={levelDetails}
// LLM - DO NOT TOUCH IT
exceptionUsername={id === 1034 && usernameLong}
/>
<div className={styles.desktopMode}>
<RankingInfoAndBtn
Expand Down
6 changes: 5 additions & 1 deletion src/components/AccountInfo/AccountInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type AccountInfoProps = {
achievementTooltipTxt?: string;
yourPointsUserPage?: string;
levelDetails?: any;
exceptionUsername?: string;
};

const AccountInfo: FC<AccountInfoProps> = ({
Expand All @@ -47,6 +48,7 @@ const AccountInfo: FC<AccountInfoProps> = ({
achievementTooltipTxt,
yourPointsUserPage,
levelDetails,
exceptionUsername,
}) => {
const router = useRouter();
const { locale } = router as TRouter;
Expand Down Expand Up @@ -102,7 +104,9 @@ const AccountInfo: FC<AccountInfoProps> = ({
})}
>
<span className={styles.title}> {title} </span>
{!!username ? (
{!!exceptionUsername ? (
<h1 className={styles.username}> {exceptionUsername}</h1>
) : !!username ? (
<h1 className={styles.username}> {username}</h1>
) : (
<Skeleton width={150} height={22} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
color: #bf8c0a;
font-size: 76px;
font-weight: 100;
margin: 0;
margin: 0 20px;
font-family: 'Manrope-ExtraLight.ttf', sans-serif;
}

Expand Down
6 changes: 5 additions & 1 deletion src/components/UserProfile/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type UserProfileProps = {
disableStartTest?: boolean;
matchingLevelDetails?: any;
isTestUser?: boolean;
exceptionUsername?: string;
};
const UserProfile: FC<UserProfileProps> = ({
userName = 'Guest User',
Expand All @@ -61,6 +62,7 @@ const UserProfile: FC<UserProfileProps> = ({
title,
matchingLevelDetails,
isTestUser,
exceptionUsername,
}) => {
const router = useRouter();
const { isMobile } = useMobile()[1];
Expand Down Expand Up @@ -131,7 +133,9 @@ const UserProfile: FC<UserProfileProps> = ({
<div className={styles.userInfo}>
<div className={styles.nameAndTitle}>
{!!title && <span className={styles.title}> {title}</span>}
<h2 className={styles.userName}>{userName}</h2>
<h2 className={styles.userName}>
{exceptionUsername ? exceptionUsername : userName}
</h2>
</div>
<span className={styles.level}>
{`${
Expand Down
3 changes: 3 additions & 0 deletions src/layouts/UXCatLayout/UXCatLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ const UXCatLayout: FC<UXCGLayoutProps> = ({
guestLevel={guestLevel}
userLevel={level}
userName={!userInfo ? guestUsername : username}
exceptionUsername={
userInfo?.id === 1034 && userInfo?.usernameLong
}
title={userInfo?.title}
openLoginModal={openLoginModal}
loggedIn={!!accessToken}
Expand Down
2 changes: 2 additions & 0 deletions src/layouts/UserProfile/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ const UserProfile: FC<UserProfileProps> = ({
awarenessPoints={awarenessPoints}
level={level}
username={username}
id={Number(userInfo?.id)}
usernameLong={userInfo?.usernameLong || ''}
setOpenCoverImgModal={setOpenCoverImgModal}
linkedIn={linkedIn}
email={isValidEmail(userData?.email) ? userData?.email : ''}
Expand Down
3 changes: 2 additions & 1 deletion src/local-types/uxcat-types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export type UserTypes = {
id: number | string;
nextTestTime?: number | null;
username: string;
usernameLong?: string;
email?: string;
points?: number;
title: string;
Expand Down Expand Up @@ -31,7 +32,7 @@ export type UserTypes = {
username: string;
email?: string;
picture?: string;
username_long: string;
usernameLong?: string;
isTestUser?: boolean;
points?: number;
nextTestTime?: number | null;
Expand Down
9 changes: 7 additions & 2 deletions src/pages/user/[userId]/certificate.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useRouter } from 'next/router';
import React from 'react';
import React, { useContext } from 'react';

import type { TRouter } from '@local-types/global';

import { getCertificate } from '@api/uxcat/certificate';

import pageNotFoundData from '@data/404';

import { GlobalContext } from '@components/Context/GlobalContext';
import Spinner from '@components/Spinner';

import CertificateLayout from '@layouts/CertificateLayout';
Expand All @@ -16,8 +17,12 @@ import NotFoundPage from '../../404';
const Certificate = ({ userId, certificate }) => {
const router = useRouter();
const { locale } = router as TRouter;
const { accountData } = useContext(GlobalContext);

const name = `${certificate?.name} ${certificate?.surname}`;
const name =
accountData?.id === 1034
? 'Кузнецов Тимофей Юрьевич'
: `${certificate?.name} ${certificate?.surname}`;
const date = new Date(certificate?.certificatedAt);
const day = date.getUTCDate();
const month = date.getUTCMonth() + 1;
Expand Down
Loading