diff --git a/.graphqlrc.yml b/.graphqlrc.yml
index 438e87b..09c907b 100644
--- a/.graphqlrc.yml
+++ b/.graphqlrc.yml
@@ -1,2 +1,2 @@
-schema: './apps/api/schema.gql'
-documents: './apps/web/**/*.gql'
+schema: './apps/api/schema.graphql'
+documents: './apps/web/**/*.graphql'
diff --git a/apps/api/index.ts b/apps/api/index.ts
index 1f72b45..257f27d 100644
--- a/apps/api/index.ts
+++ b/apps/api/index.ts
@@ -7,7 +7,7 @@ import { schemaAsString } from './src/graphql';
const main = async () => {
try {
- await writeFile('./schema.gql', schemaAsString);
+ await writeFile('./schema.graphql', schemaAsString);
server.listen({ port: env.PORT });
logger.success(`🚀 Server ready at http://localhost:${env.PORT}`);
diff --git a/apps/api/schema.gql b/apps/api/schema.graphql
similarity index 53%
rename from apps/api/schema.gql
rename to apps/api/schema.graphql
index 07fc514..6b79335 100644
--- a/apps/api/schema.gql
+++ b/apps/api/schema.graphql
@@ -1,6 +1,8 @@
-"""Auth0 user info"""
+"""
+Auth0 user info
+"""
type AuthInfo {
- sub: String
+ sub: String
}
"""
@@ -9,8 +11,8 @@ A date string, such as 2007-12-03, compliant with the `full-date` format outline
scalar Date
input DateRangeInput {
- gte: Date
- lte: Date
+ gte: Date
+ lte: Date
}
"""
@@ -19,55 +21,57 @@ A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `dat
scalar DateTime
input NumberRangeInput {
- gte: Int
- lte: Int
+ gte: Int
+ lte: Int
}
input PaginationInput {
- page: Int = 1
- perPage: Int = 10
+ page: Int = 1
+ perPage: Int = 10
}
type Query {
- """Auth0 context info"""
- authInfo: AuthInfo
- tasks(filter: TaskFilterInput, pagination: PaginationInput): [Task!]!
+ """
+ Auth0 context info
+ """
+ authInfo: AuthInfo
+ tasks(filter: TaskFilterInput, pagination: PaginationInput): [Task!]!
}
scalar SearchString
type Task {
- author: User!
- description: String!
- difficulty: String!
- id: ID!
- rating: Int!
- status: String!
- thumbnailUrl: String!
- title: String!
+ author: User!
+ description: String!
+ difficulty: String!
+ id: ID!
+ rating: Int!
+ status: String!
+ thumbnailUrl: String!
+ title: String!
}
enum TaskDifficulty {
- ADVANCED
- BEGINNER
- INTERMEDIATE
+ ADVANCED
+ BEGINNER
+ INTERMEDIATE
}
input TaskFilterInput {
- created_at: DateRangeInput
- description: SearchString
- difficulty: TaskDifficulty
- status: TaskStatus = ACTIVE
- title: SearchString
- updated_at: DateRangeInput
+ created_at: DateRangeInput
+ description: SearchString
+ difficulty: TaskDifficulty
+ status: TaskStatus = ACTIVE
+ title: SearchString
+ updated_at: DateRangeInput
}
enum TaskStatus {
- ACTIVE
- IN_REVIEW
- REJECTED
+ ACTIVE
+ IN_REVIEW
+ REJECTED
}
type User {
- id: ID!
-}
\ No newline at end of file
+ id: ID!
+}
diff --git a/apps/web/components/molecules/challengeItem/challengeItem.tsx b/apps/web/components/molecules/challengeItem/challengeItem.tsx
index 95309ad..3d86b20 100644
--- a/apps/web/components/molecules/challengeItem/challengeItem.tsx
+++ b/apps/web/components/molecules/challengeItem/challengeItem.tsx
@@ -1,18 +1,28 @@
-import { Card, Heading, Text, CategoryTag } from 'ui';
+import { Card, Heading, Text } from 'ui';
import { ChartBarIcon } from '@heroicons/react/20/solid';
import Image from 'next/image';
-import type { Challenge } from '../../../types/types';
import clsx from 'clsx';
+import type { Task } from 'generated';
-type TaskItemProps = Challenge;
+type TaskItemProps = Task;
+const translateToPolish = (difficulty: string) => {
+ switch (difficulty) {
+ case 'ADVANCED':
+ return 'Zaawansowany';
+ case 'BEGINNER':
+ return 'PoczÄ…tkujÄ…cy';
+ case 'INTERMEDIATE':
+ return 'Mid';
+ }
+};
export const ChallengeItem = ({
id,
title,
- image,
+ thumbnailUrl: image,
description,
difficulty,
- tags,
+ // tags,
rating,
}: TaskItemProps) => {
return (
@@ -23,9 +33,9 @@ export const ChallengeItem = ({