Skip to content

Commit 4a11cbe

Browse files
feat: type errors fixed
1 parent d029e12 commit 4a11cbe

File tree

6 files changed

+39
-14
lines changed

6 files changed

+39
-14
lines changed

src/components/uncommon/sdg-page-cards/trackCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const TrackCard = ({
3434
}}
3535
className={`cursor-pointer relative ${
3636
hover ? 'content3 bg-[#252525] bg-opacity-40' : ''
37-
} max-sm:py-5 py-3 font-spaceGrotesk bg-[#252525] bg-opacity-40 text-white lg:w-[20vw] max-sm:h-[32.5vh] sm:h-[50vh] w-[70%] rounded-xl`}
37+
} transition-all duration-300 ease-in-out max-sm:py-5 py-3 font-spaceGrotesk bg-[#252525] bg-opacity-40 text-white lg:w-[20vw] max-sm:h-[32.5vh] sm:h-[50vh] w-[70%] rounded-xl`}
3838
>
3939
<div className="flex h-full w-full flex-col gap-1 sm:gap-3 px-4">
4040
<Image

src/models/submissionModel.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export interface SubmissionType extends SubmissionInput {
2222
submittedAt: Date;
2323
}
2424

25+
export interface SubmissionExportType extends SubmissionType {
26+
_id: string;
27+
id: mongoose.Schema.Types.ObjectId;
28+
}
29+
2530
export interface SubmissionDocument extends SubmissionType, mongoose.Document {
2631
_id: string;
2732
id: mongoose.Schema.Types.ObjectId;

src/models/teamModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mongoose from 'mongoose';
2-
import { SubmissionDocument } from './submissionModel';
2+
import { SubmissionDocument, SubmissionExportType } from './submissionModel';
33
import { UserDocument } from './userModel';
44

55
export interface TeamType {
@@ -19,7 +19,7 @@ export interface SubmissionPopulatedTeam {
1919
id: mongoose.Schema.Types.ObjectId;
2020
title: string;
2121
members: UserDocument[];
22-
submission: SubmissionDocument;
22+
submission: SubmissionExportType;
2323
}
2424

2525
const teamSchema = new mongoose.Schema({

src/pages/hack/admin/team/[id].tsx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Image from 'next/image';
33
import Loader from '@/components/common/loader';
44
import { getSession, useSession } from 'next-auth/react';
55
import mongoose from 'mongoose';
6-
import { TeamType } from '@/models/teamModel';
6+
import { SubmissionPopulatedTeam, TeamType } from '@/models/teamModel';
77
import Toaster from '@/utils/toaster';
88
import ViewSubmission from '@/sections/admin-page-sections/admin-view-submission';
99
import Header from '@/components/common/header';
@@ -20,11 +20,31 @@ interface Props {
2020
}
2121

2222
const ProjectReviewPage = ({ id }: Props) => {
23-
const [teamDetails, setTeamDetails] = useState<TeamType>({
23+
const [teamDetails, setTeamDetails] = useState<SubmissionPopulatedTeam>({
2424
id: new mongoose.Schema.Types.ObjectId(''),
2525
title: '',
2626
members: [],
27-
submission: new mongoose.Schema.Types.ObjectId(''),
27+
submission: {
28+
_id: '',
29+
id: new mongoose.Schema.Types.ObjectId(''),
30+
status: 0,
31+
submittedAt: new Date(),
32+
title: '',
33+
description: '',
34+
track: 0,
35+
links: [],
36+
files: [],
37+
round1Score: 0,
38+
round1Judge: '',
39+
round1Comment: '',
40+
round2Score: 0,
41+
round2Judge: '',
42+
round2Comment: '',
43+
round3Score: 0,
44+
round3Judge: '',
45+
round3Comment: '',
46+
},
47+
_id: '',
2848
});
2949
const [loading, setLoading] = useState(true);
3050

@@ -299,7 +319,7 @@ const ProjectReviewPage = ({ id }: Props) => {
299319
<div className="w-full lg:w-[50%] h-full">
300320
{teamDetails.submission ? (
301321
<ViewSubmission
302-
id={teamDetails.submission._id}
322+
id={String(teamDetails.submission._id)}
303323
/>
304324
) : (
305325
<></>

src/pages/hack/tracks/[id].tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const TrackPage = ({ id }: Props) => {
116116
'/hack/tracks/1'
117117
);
118118
}}
119-
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60`}
119+
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60 transition-all duration-200 ease-in-out hover:scale-125`}
120120
style={{
121121
backgroundColor:
122122
'#279B48',
@@ -128,7 +128,7 @@ const TrackPage = ({ id }: Props) => {
128128
'/hack/tracks/2'
129129
);
130130
}}
131-
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60`}
131+
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60 transition-all duration-200 ease-in-out hover:scale-125`}
132132
style={{
133133
backgroundColor:
134134
'#C92639',
@@ -140,7 +140,7 @@ const TrackPage = ({ id }: Props) => {
140140
'/hack/tracks/3'
141141
);
142142
}}
143-
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60`}
143+
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60 transition-all duration-200 ease-in-out hover:scale-125`}
144144
style={{
145145
backgroundColor:
146146
'#FF8945',
@@ -152,7 +152,7 @@ const TrackPage = ({ id }: Props) => {
152152
'/hack/tracks/4'
153153
);
154154
}}
155-
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60`}
155+
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60 transition-all duration-200 ease-in-out hover:scale-125`}
156156
style={{
157157
backgroundColor:
158158
'#FF4FA9',
@@ -164,7 +164,7 @@ const TrackPage = ({ id }: Props) => {
164164
'/hack/tracks/5'
165165
);
166166
}}
167-
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60`}
167+
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60 transition-all duration-200 ease-in-out hover:scale-125`}
168168
style={{
169169
backgroundColor:
170170
'#FF9F03',
@@ -176,7 +176,7 @@ const TrackPage = ({ id }: Props) => {
176176
'/hack/tracks/6'
177177
);
178178
}}
179-
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60`}
179+
className={`rounded-full h-6 w-6 cursor-pointer content3 opacity-60 transition-all duration-200 ease-in-out hover:scale-125`}
180180
style={{
181181
backgroundColor:
182182
'#E48E16',

src/sections/admin-page-sections/admin-view-submission.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import getHandler from '@/handlers/getHandler';
1111
import { TeamType } from '@/models/teamModel';
1212
import Link from 'next/link';
1313
type ViewSubmissionProps = {
14-
id: mongoose.Schema.Types.ObjectId;
14+
id: string;
1515
};
1616
const ViewSubmission = ({ id }: ViewSubmissionProps) => {
1717
const [submission, setSubmission] = useState<SubmissionType>();

0 commit comments

Comments
 (0)