Skip to content

Commit

Permalink
fix: typing
Browse files Browse the repository at this point in the history
  • Loading branch information
wiktoriasalamon committed Jul 31, 2024
1 parent 7c3a49f commit 8dc0a5c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions frontend/src/app/(app)/(root)/my-space/soft-skills/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ const data: SoftSkillBucket = {
{
name: 'Fulfills undertaken obligations regarding tasks',
description: loremIpsum,
proofStatus: ProofStatus.APPROVED as unknown as typeof ProofStatus,
proofStatus: ProofStatus.approved,
},
{
name: 'He is responsive and communicates responsibly - without unnecessary delay.',
description: loremIpsum,
proofStatus: ProofStatus.APPROVED as unknown as typeof ProofStatus,
proofStatus: ProofStatus.approved,
},
],
Quality: [
{
name: 'Fulfills undertaken obligations regarding tasks',
description: loremIpsum,
proofStatus: ProofStatus.APPROVED as unknown as typeof ProofStatus,
proofStatus: ProofStatus.approved,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import { CrossIcon } from '@app/static/icons/CrossIcon';

export const SkillStatusIcon: FC<SkillStatusIconProps> = ({ status }) => {
switch (status) {
case ProofStatus.APPROVED:
case ProofStatus.approved:
return (
<div className="flex h-5 w-5 items-center justify-center rounded-full bg-green-600 text-white">
<CheckMarkIcon />
</div>
);
case ProofStatus.PENDING:
case ProofStatus.pending:
return (
<div className="flex h-5 w-5 items-center justify-center rounded-full bg-yellow-500 text-white">
<ArrowRight />
</div>
);
case ProofStatus.REJECTED:
case ProofStatus.rejected:
return (
<div className="flex h-5 w-5 items-center justify-center rounded-full bg-red-600 text-white">
<CrossIcon />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const LadderDetails = ({ ladder, ladderName, band }: LadderDetailsProps)
bucketSlug: 'soft-skills',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquet, felis et tincidunt tempor, justo orci cursus ipsum, nec efficitur neque felis sit amet orci. Vivamus tempus, ex et ultrices rutrum, libero mi molestie mi, non tempus ex metus sed augue. Morbi euismod, nulla nec tempus consequat, quam mi pellentesque elit, non sagittis est nisl sed arcu.',
bucketType: BucketType.SOFT as unknown as typeof BucketType,
bucketType: BucketType.soft,
status: 'Completed',
},
]; // TODO: remove when data are fetched from api
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/types/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface LadderBand {
export interface LadderBandBucket {
bucketName: string;
bucketSlug: string;
bucketType: typeof BucketType;
bucketType: keyof typeof BucketType;
description: string;
level?: number;
status?: string;
Expand All @@ -17,7 +17,7 @@ export interface LadderBandBucket {
export interface Bucket {
bucketName: string;
bucketSlug: string;
bucketType: typeof BucketType;
bucketType: keyof typeof BucketType;
description: string;
advancementLevels: AdvancementLevel[];
}
Expand All @@ -33,8 +33,8 @@ export interface SoftSkillBucket {
}

export const BucketType = {
HARD: 'hard',
SOFT: 'soft',
hard: 'hard',
soft: 'soft',
} as const;

export interface AdvancementLevel {
Expand All @@ -54,16 +54,16 @@ export interface ExampleProject {
export interface AtomicSkill {
name: string;
description?: string;
proofStatus?: typeof ProofStatus;
proofStatus?: keyof typeof ProofStatus;
}

export const ProofStatus = {
APPROVED: 'approved',
PENDING: 'pending',
REJECTED: 'rejected',
};
approved: 'approved',
pending: 'pending',
rejected: 'rejected',
} as const;

export const SoftSkillStatus = {
COMPLETED: 'completed',
PENDING: 'pending',
};
completed: 'completed',
pending: 'pending',
} as const;

0 comments on commit 8dc0a5c

Please sign in to comment.