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
17 changes: 15 additions & 2 deletions src/api/playerHome.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { request } from "./http";
import type { AuthScheme } from "./http";
import type { PaginatedResponse } from "./player";

export interface CoachSummary {
Expand Down Expand Up @@ -328,16 +329,28 @@ export const getCheckLocation = async ({

export interface FetchPlayerDetailsParams extends PlayerTokenOnlyParams {
userId: number | string;
position?: PositionPayload | null;
authScheme?: AuthScheme;
}

export const fetchPlayerDetails = async ({ token, userId }: FetchPlayerDetailsParams) =>
export const fetchPlayerDetails = async ({ token, userId, position, authScheme }: FetchPlayerDetailsParams) =>
request<Record<string, unknown>>(
"/player/surveys/getchecklocation/specific_user",
{
method: position ? "POST" : "GET",
token,
authScheme,
query: {
userId,
user_id: userId,
},
body: position
? buildBody({
position,
userId,
user_id: userId,
})
: undefined,
},
);

Expand Down Expand Up @@ -417,7 +430,7 @@ export const getUserVerificationLevel = async ({ token }: PlayerTokenOnlyParams)

export interface VerifyUserLevelParams extends PlayerTokenOnlyParams {
userId: number | string;
level: string;
level: string | boolean;
}

export const verifyUserLevel = async ({ token, userId, level }: VerifyUserLevelParams) =>
Expand Down
271 changes: 271 additions & 0 deletions src/pages/PlayerMatchProfilePage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
.match-profile-page {
padding: 32px;
background: #f5f5f7;
min-height: calc(100vh - 80px);
color: #111;
}

.match-profile-card {
max-width: 960px;
margin: 0 auto;
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 16px;
padding: 24px;
box-shadow: 0 10px 35px rgba(17, 24, 39, 0.05);
display: flex;
flex-direction: column;
gap: 24px;
}

.match-profile-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 16px;
}

.match-profile-person {
display: flex;
align-items: center;
gap: 16px;
}

.match-profile-avatar {
width: 72px;
height: 72px;
border-radius: 50%;
background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
border: 1px solid #e5e7eb;
display: grid;
place-items: center;
color: #4b5563;
font-weight: 700;
font-size: 18px;
overflow: hidden;
}

.match-profile-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}

.match-profile-header h1 {
margin: 0 0 4px;
font-size: 24px;
font-weight: 700;
color: #0f172a;
}

.match-profile-meta {
display: inline-flex;
align-items: center;
gap: 8px;
margin: 0;
color: #475467;
font-size: 14px;
}

.match-profile-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
}

.match-profile-button {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
border-radius: 10px;
border: 1px solid #e5e7eb;
background: #fff;
color: #111827;
font-weight: 600;
font-size: 14px;
cursor: pointer;
text-decoration: none;
transition: all 0.2s ease;
}

.match-profile-button svg.spin {
animation: spin 1s linear infinite;
}

.match-profile-button--secondary {
background: #f9fafb;
}

.match-profile-button--primary {
background: #4f46e5;
color: #fff;
border-color: #4338ca;
}

.match-profile-button--active {
background: #fef2f2;
color: #b91c1c;
border-color: #fecdd3;
}

.match-profile-button--danger {
background: #fef2f2;
color: #991b1b;
border-color: #fecaca;
}

.match-profile-button:disabled,
.match-profile-button[aria-disabled="true"] {
opacity: 0.6;
cursor: not-allowed;
}

.match-profile-banner {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 12px;
border-radius: 12px;
background: #fef3c7;
color: #854d0e;
border: 1px solid #fcd34d;
}

.match-profile-section {
border-top: 1px solid #f1f5f9;
padding-top: 16px;
}

.match-profile-section h2 {
margin: 0 0 8px;
font-size: 18px;
color: #0f172a;
}

.match-profile-section__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}

.match-profile-level-pill {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
background: #eef2ff;
color: #3730a3;
border-radius: 999px;
font-weight: 600;
font-size: 14px;
}

.match-profile-body {
margin: 0 0 10px;
color: #475467;
line-height: 1.6;
}

.match-profile-list {
list-style: none;
padding: 0;
margin: 0;
display: grid;
gap: 8px;
}

.match-profile-list li {
padding: 10px 12px;
border-radius: 10px;
background: #f8fafc;
border: 1px solid #e2e8f0;
color: #0f172a;
}

.match-profile-chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
}

.match-profile-chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
border-radius: 999px;
background: #f1f5f9;
color: #0f172a;
font-weight: 600;
border: 1px solid #e2e8f0;
}

.match-profile-section--cta {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
background: #f8fafc;
border: 1px solid #e5e7eb;
border-radius: 12px;
padding: 16px;
}

.match-profile-state {
max-width: 600px;
margin: 80px auto 0;
padding: 16px 18px;
border-radius: 12px;
background: #f1f5f9;
color: #0f172a;
border: 1px solid #e2e8f0;
display: inline-flex;
align-items: center;
gap: 12px;
}

.match-profile-state__title {
margin: 0;
font-weight: 700;
color: #111827;
}

.match-profile-state__message {
margin: 4px 0 0;
color: #475467;
}

@keyframes spin {
to {
transform: rotate(360deg);
}
}

@media (max-width: 640px) {
.match-profile-card {
padding: 18px;
}

.match-profile-header {
align-items: flex-start;
}

.match-profile-person {
width: 100%;
}

.match-profile-actions {
width: 100%;
}

.match-profile-button,
.match-profile-button--primary,
.match-profile-button--secondary {
justify-content: center;
flex: 1;
}
}
Loading