diff --git a/api/functions/graphql/nexus-typegen.ts b/api/functions/graphql/nexus-typegen.ts
index 28338b2..3f35201 100644
--- a/api/functions/graphql/nexus-typegen.ts
+++ b/api/functions/graphql/nexus-typegen.ts
@@ -192,6 +192,10 @@ export interface NexusGenObjects {
twitter?: string | null; // String
website?: string | null; // String
}
+ ParticipationInfo: { // root type
+ createdAt: NexusGenScalars['Date']; // Date!
+ hacking_status: NexusGenEnums['TournamentMakerHackingStatusEnum']; // TournamentMakerHackingStatusEnum!
+ }
PostComment: { // root type
author: NexusGenRootTypes['Author']; // Author!
body: string; // String!
@@ -275,7 +279,12 @@ export interface NexusGenObjects {
TournamentMakersResponse: { // root type
hasNext?: boolean | null; // Boolean
hasPrev?: boolean | null; // Boolean
- makers: NexusGenRootTypes['User'][]; // [User!]!
+ makers: NexusGenRootTypes['TournamentParticipant'][]; // [TournamentParticipant!]!
+ }
+ TournamentParticipant: { // root type
+ hacking_status: NexusGenEnums['TournamentMakerHackingStatusEnum']; // TournamentMakerHackingStatusEnum!
+ is_registered?: boolean | null; // Boolean
+ user: NexusGenRootTypes['User']; // User!
}
TournamentPrize: { // root type
amount: string; // String!
@@ -464,6 +473,10 @@ export interface NexusGenFieldTypes {
walletsKeys: NexusGenRootTypes['WalletKey'][]; // [WalletKey!]!
website: string | null; // String
}
+ ParticipationInfo: { // field return type
+ createdAt: NexusGenScalars['Date']; // Date!
+ hacking_status: NexusGenEnums['TournamentMakerHackingStatusEnum']; // TournamentMakerHackingStatusEnum!
+ }
PostComment: { // field return type
author: NexusGenRootTypes['Author']; // Author!
body: string; // String!
@@ -514,6 +527,7 @@ export interface NexusGenFieldTypes {
projectsByCategory: NexusGenRootTypes['Project'][]; // [Project!]!
searchProjects: NexusGenRootTypes['Project'][]; // [Project!]!
similarMakers: NexusGenRootTypes['User'][]; // [User!]!
+ tournamentParticipationInfo: NexusGenRootTypes['ParticipationInfo'] | null; // ParticipationInfo
}
Question: { // field return type
author: NexusGenRootTypes['Author']; // Author!
@@ -593,7 +607,12 @@ export interface NexusGenFieldTypes {
TournamentMakersResponse: { // field return type
hasNext: boolean | null; // Boolean
hasPrev: boolean | null; // Boolean
- makers: NexusGenRootTypes['User'][]; // [User!]!
+ makers: NexusGenRootTypes['TournamentParticipant'][]; // [TournamentParticipant!]!
+ }
+ TournamentParticipant: { // field return type
+ hacking_status: NexusGenEnums['TournamentMakerHackingStatusEnum']; // TournamentMakerHackingStatusEnum!
+ is_registered: boolean | null; // Boolean
+ user: NexusGenRootTypes['User']; // User!
}
TournamentPrize: { // field return type
amount: string; // String!
@@ -807,6 +826,10 @@ export interface NexusGenFieldTypeNames {
walletsKeys: 'WalletKey'
website: 'String'
}
+ ParticipationInfo: { // field return type name
+ createdAt: 'Date'
+ hacking_status: 'TournamentMakerHackingStatusEnum'
+ }
PostComment: { // field return type name
author: 'Author'
body: 'String'
@@ -857,6 +880,7 @@ export interface NexusGenFieldTypeNames {
projectsByCategory: 'Project'
searchProjects: 'Project'
similarMakers: 'User'
+ tournamentParticipationInfo: 'ParticipationInfo'
}
Question: { // field return type name
author: 'Author'
@@ -936,7 +960,12 @@ export interface NexusGenFieldTypeNames {
TournamentMakersResponse: { // field return type name
hasNext: 'Boolean'
hasPrev: 'Boolean'
- makers: 'User'
+ makers: 'TournamentParticipant'
+ }
+ TournamentParticipant: { // field return type name
+ hacking_status: 'TournamentMakerHackingStatusEnum'
+ is_registered: 'Boolean'
+ user: 'User'
}
TournamentPrize: { // field return type name
amount: 'String'
@@ -1133,6 +1162,9 @@ export interface NexusGenArgTypes {
similarMakers: { // args
id: number; // Int!
}
+ tournamentParticipationInfo: { // args
+ tournamentId: number; // Int!
+ }
}
User: {
in_tournament: { // args
diff --git a/api/functions/graphql/schema.graphql b/api/functions/graphql/schema.graphql
index 56b9e0a..ba9a87e 100644
--- a/api/functions/graphql/schema.graphql
+++ b/api/functions/graphql/schema.graphql
@@ -188,6 +188,11 @@ enum POST_TYPE {
Story
}
+type ParticipationInfo {
+ createdAt: Date!
+ hacking_status: TournamentMakerHackingStatusEnum!
+}
+
union Post = Bounty | Question | Story
interface PostBase {
@@ -272,6 +277,7 @@ type Query {
projectsByCategory(category_id: Int!, skip: Int = 0, take: Int = 10): [Project!]!
searchProjects(search: String!, skip: Int = 0, take: Int = 50): [Project!]!
similarMakers(id: Int!): [User!]!
+ tournamentParticipationInfo(tournamentId: Int!): ParticipationInfo
}
type Question implements PostBase {
@@ -393,7 +399,13 @@ enum TournamentMakerHackingStatusEnum {
type TournamentMakersResponse {
hasNext: Boolean
hasPrev: Boolean
- makers: [User!]!
+ makers: [TournamentParticipant!]!
+}
+
+type TournamentParticipant {
+ hacking_status: TournamentMakerHackingStatusEnum!
+ is_registered: Boolean
+ user: User!
}
type TournamentPrize {
diff --git a/api/functions/graphql/types/tournament.js b/api/functions/graphql/types/tournament.js
index 2eb4572..121cbb3 100644
--- a/api/functions/graphql/types/tournament.js
+++ b/api/functions/graphql/types/tournament.js
@@ -39,7 +39,14 @@ const TournamentFAQ = objectType({
}
})
-
+const TournamentParticipant = objectType({
+ name: "TournamentParticipant",
+ definition(t) {
+ t.nonNull.field('hacking_status', { type: TournamentMakerHackingStatusEnum });
+ t.boolean('is_registered')
+ t.nonNull.field('user', { type: "User" })
+ }
+})
const TournamentEventTypeEnum = enumType({
name: 'TournamentEventTypeEnum',
@@ -152,7 +159,7 @@ const TournamentMakersResponse = objectType({
t.boolean('hasNext');
t.boolean('hasPrev');
- t.nonNull.list.nonNull.field('makers', { type: "User" })
+ t.nonNull.list.nonNull.field('makers', { type: TournamentParticipant })
}
}
)
@@ -185,7 +192,40 @@ const getTournamentById = extendType({
}
})
+const ParticipationInfo = objectType({
+ name: "ParticipationInfo",
+ definition(t) {
+ t.nonNull.date('createdAt')
+ t.nonNull.field('hacking_status', { type: TournamentMakerHackingStatusEnum });
+ }
+})
+
+const tournamentParticipationInfo = extendType({
+ type: "Query",
+ definition(t) {
+ t.field('tournamentParticipationInfo', {
+ type: ParticipationInfo,
+ args: {
+ tournamentId: nonNull(intArg()),
+ },
+ async resolve(_, args, ctx) {
+
+ const user = await getUserByPubKey(ctx.userPubKey);
+ if (!user)
+ return null
+
+
+ return prisma.tournamentParticipant.findFirst({
+ where: {
+ user_id: user.id,
+ tournament_id: args.tournamentId
+ }
+ })
+ }
+ })
+ }
+})
const getMakersInTournament = extendType({
type: "Query",
@@ -198,7 +238,9 @@ const getMakersInTournament = extendType({
search: stringArg(),
roleId: intArg(),
},
- async resolve(_, args) {
+ async resolve(_, args, ctx) {
+
+ const user = await getUserByPubKey(ctx.userPubKey);
let filters = [];
@@ -229,6 +271,12 @@ const getMakersInTournament = extendType({
}
})
+ if (user?.id) filters.push({
+ id: {
+ not: user.id
+ }
+ })
+
const makers = (await prisma.tournamentParticipant.findMany({
where: {
tournament_id: args.tournamentId,
@@ -238,12 +286,19 @@ const getMakersInTournament = extendType({
}
})
},
+ orderBy: {
+ createdAt: 'desc'
+ },
include: {
user: true,
},
skip: args.skip,
take: args.take + 1,
- })).map(item => item.user)
+ }))
+ .map(item => ({
+ hacking_status: item.hacking_status,
+ user: item.user
+ }))
@@ -381,6 +436,7 @@ const registerInTournament = extendType({
module.exports = {
// Types
Tournament,
+
// Enums
TournamentEventTypeEnum,
@@ -388,8 +444,9 @@ module.exports = {
getTournamentById,
getMakersInTournament,
getProjectsInTournament,
+ tournamentParticipationInfo,
// Mutations
registerInTournament,
-}
\ No newline at end of file
+}
diff --git a/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx b/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx
index dce9916..bf8307c 100644
--- a/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx
+++ b/src/features/Tournaments/pages/MakersPage/ConnectToMakerModal/ConnectToMakerModal.tsx
@@ -16,22 +16,22 @@ export default function LinkingAccountModal({ onClose, direction, maker, ...prop
const links = [
{
- hasValue: maker.twitter,
- text: maker.twitter,
+ hasValue: maker.user.twitter,
+ text: maker.user.twitter,
icon: FiTwitter,
- url: `https://twitter.com/${maker.twitter}`
+ url: `https://twitter.com/${maker.user.twitter}`
},
{
- hasValue: maker.github,
- text: maker.github,
+ hasValue: maker.user.github,
+ text: maker.user.github,
icon: FiGithub,
- url: `https://github.com/${maker.github}`
+ url: `https://github.com/${maker.user.github}`
},
{
- hasValue: maker.linkedin,
+ hasValue: maker.user.linkedin,
text: "LinkedIn",
icon: FiLinkedin,
- url: maker.linkedin && withHttp(maker.linkedin),
+ url: maker.user.linkedin && withHttp(maker.user.linkedin),
}
];
@@ -51,10 +51,10 @@ export default function LinkingAccountModal({ onClose, direction, maker, ...prop
-
+
-
{maker.name}
-
{maker.jobTitle}
+
{maker.user.name}
+
{maker.user.jobTitle}
Team up with this maker by sending them a message on one of the following platforms.
diff --git a/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx b/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx
index 013d14e..697418d 100644
--- a/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx
+++ b/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx
@@ -1,11 +1,13 @@
import Button from "src/Components/Button/Button"
-import { GetMakersInTournamentQuery, } from "src/graphql";
+import { GetMakersInTournamentQuery, TournamentMakerHackingStatusEnum, } from "src/graphql";
import { useAppDispatch, } from "src/utils/hooks";
import Card from 'src/Components/Card/Card';
import Avatar from 'src/features/Profiles/Components/Avatar/Avatar';
import Badge from 'src/Components/Badge/Badge';
import { createRoute } from 'src/utils/routing';
import { openModal } from "src/redux/features/modals.slice";
+import InfoCard from "src/Components/InfoCard/InfoCard";
+import { Link } from "react-router-dom";
type MakerType = GetMakersInTournamentQuery['getMakersInTournament']['makers'][number]
@@ -18,27 +20,33 @@ export default function MakerCard({ maker, isMe }: Props) {
const dispatch = useAppDispatch();
- const contactLinksAvailable = maker.github || maker.email || maker.linkedin || maker.twitter;
+ const contactLinksAvailable = maker.user.github || maker.user.linkedin || maker.user.twitter;
- let actionBtn =
+ let actionBtn = <>>
- if (isMe) actionBtn =
;
- else if (contactLinksAvailable) actionBtn =
+ if (isMe)
+ actionBtn =
;
+ else if (maker.hacking_status === TournamentMakerHackingStatusEnum.OpenToConnect && contactLinksAvailable)
+ actionBtn =
+ else if (maker.hacking_status === TournamentMakerHackingStatusEnum.Solo)
+ actionBtn =
+ const missingFields = isMe && getMissingFields(maker)
+
return (
-
{maker.name}
- {maker.jobTitle ?
{maker.jobTitle}
+
{maker.user.name}
+ {maker.user.jobTitle ?
{maker.user.jobTitle}
:
No job title
}
- {maker.roles.length ?
- {maker.roles.map(role => - {role.icon} {role.title}
)}
+ {maker.user.roles.length ?
+ {maker.user.roles.map(role => - {role.icon} {role.title}
)}
:
No roles added
@@ -51,8 +59,8 @@ export default function MakerCard({ maker, isMe }: Props) {
π Roles
- {maker.roles.length ?
- {maker.roles.map(role => - {role.icon} {role.title}
)}
+ {maker.user.roles.length ?
+ {maker.user.roles.map(role => - {role.icon} {role.title}
)}
:
No roles added
@@ -61,14 +69,33 @@ export default function MakerCard({ maker, isMe }: Props) {
π οΈ Skills
- {maker.skills.length ?
- {maker.skills.map(skill => - {skill.title}
)}
+ {maker.user.skills.length ?
+ {maker.user.skills.map(skill => - {skill.title}
)}
:
No skills added
}
{actionBtn}
+ {missingFields &&
+ πΎ Complete your profile: make it easy for other makers to find you by adding your {missingFields}. You can add this information in your profileβs Settings βοΈ menu.
+ }
)
}
+
+
+function getMissingFields(maker: Props['maker']) {
+ let res: string[] = [];
+
+ if (!maker.user.jobTitle) res.push("job title")
+
+ if (maker.user.roles.length === 0) res.push('roles')
+
+ if (maker.user.skills.length === 0) res.push('skills')
+
+ if (!maker.user.linkedin && !maker.user.twitter) res.push('contacts')
+
+ return res.join(', ');
+
+}
\ No newline at end of file
diff --git a/src/features/Tournaments/pages/MakersPage/MakersPage.tsx b/src/features/Tournaments/pages/MakersPage/MakersPage.tsx
index 4732a8c..4c1b90a 100644
--- a/src/features/Tournaments/pages/MakersPage/MakersPage.tsx
+++ b/src/features/Tournaments/pages/MakersPage/MakersPage.tsx
@@ -1,4 +1,4 @@
-import { Tournament, useMeTournamentQuery, User } from 'src/graphql'
+import { Tournament, useMeTournamentQuery, User, } from 'src/graphql'
import MakerCard from './MakerCard/MakerCard';
import MakerCardSkeleton from './MakerCard/MakerCard.Skeleton';
import ParticipantsSection from './ParticipantsSection/ParticipantsSection';
@@ -12,7 +12,7 @@ interface Props {
export default function MakersPage({ data: { id } }: Props) {
const query = useMeTournamentQuery({
- variables: { inTournamentId: id }
+ variables: { id: id }
});
return (
@@ -21,8 +21,8 @@ export default function MakersPage({ data: { id } }: Props) {
{query.loading ?
:
- query.data?.me?.in_tournament ?
-
+ query.data?.me ?
+
: null
}
diff --git a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx
index e59d470..b40239c 100644
--- a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx
+++ b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/MakersList.tsx
@@ -87,7 +87,7 @@ export default function MakersList(props: Props) {
>
:
(itemsCount !== 0 ?
- query.data?.getMakersInTournament.makers.map(maker => ) :
+ query.data?.getMakersInTournament.makers.map(maker => ) :
)
diff --git a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx
index 3ef5805..cf3c1f2 100644
--- a/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx
+++ b/src/features/Tournaments/pages/MakersPage/ParticipantsSection/ParticipantsSection.tsx
@@ -64,7 +64,7 @@ export default function ParticipantsSection({ tournamentId }: Props) {
>
Makers looking for a team
-
+ */}
{curTab === 'projects' &&
}
diff --git a/src/features/Tournaments/pages/MakersPage/tournamentMakers.graphql b/src/features/Tournaments/pages/MakersPage/tournamentMakers.graphql
index 949f80d..08448fc 100644
--- a/src/features/Tournaments/pages/MakersPage/tournamentMakers.graphql
+++ b/src/features/Tournaments/pages/MakersPage/tournamentMakers.graphql
@@ -23,22 +23,24 @@ query GetMakersInTournament(
hasNext
hasPrev
makers {
- id
- name
- avatar
- jobTitle
- email
- twitter
- linkedin
- github
- roles {
+ hacking_status
+ user {
id
- icon
- title
- }
- skills {
- id
- title
+ name
+ avatar
+ jobTitle
+ twitter
+ linkedin
+ github
+ roles {
+ id
+ icon
+ title
+ }
+ skills {
+ id
+ title
+ }
}
}
}
diff --git a/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx b/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx
index de6f63b..88cdba8 100644
--- a/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx
+++ b/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx
@@ -12,6 +12,7 @@ import useCopyToClipboard from 'src/utils/hooks/useCopyToClipboard';
import { useLnurlQuery } from 'src/features/Auth/pages/LoginPage/LoginPage';
import { useAppDispatch } from 'src/utils/hooks';
import { Direction, replaceModal } from 'src/redux/features/modals.slice';
+import { NotificationsService } from 'src/services';
interface Props extends ModalCard {
@@ -34,13 +35,15 @@ export default function LinkingAccountModal({ onClose, direction, tournamentId,
const meQuery = useMeTournamentQuery({
variables: {
- inTournamentId: tournamentId
+ id: tournamentId
},
onCompleted: (data) => {
if (data.me) {
- const already_registerd = data.me.in_tournament;
- if (already_registerd)
+ const already_registerd = !!data.tournamentParticipationInfo;
+ if (already_registerd) {
onClose?.();
+ NotificationsService.info("You are already registered")
+ }
else dispatch(replaceModal({
Modal: "RegisterTournamet_RegistrationDetails",
direction: Direction.NEXT,
diff --git a/src/features/Tournaments/pages/TournamentDetailsPage/Navigation/Navigation.tsx b/src/features/Tournaments/pages/TournamentDetailsPage/Navigation/Navigation.tsx
index b6e4f49..fa910a2 100644
--- a/src/features/Tournaments/pages/TournamentDetailsPage/Navigation/Navigation.tsx
+++ b/src/features/Tournaments/pages/TournamentDetailsPage/Navigation/Navigation.tsx
@@ -28,20 +28,21 @@ export default function Navigation({ data }: Props) {
path: "makers",
},
{
- text: `Projects (${data.projects_count})`,
+ text: `Projects π`,
path: "projects",
- },
- {
- text: "???? π§",
- path: "ideas",
isDisabled: true,
},
- {
- text: "?????????? π§",
- path: "resources",
- isDisabled: true,
- },
- ], [data.events_count, data.makers_count, data.projects_count])
+ // {
+ // text: "???? π§",
+ // path: "ideas",
+ // isDisabled: true,
+ // },
+ // {
+ // text: "?????????? π§",
+ // path: "resources",
+ // isDisabled: true,
+ // },
+ ], [data.events_count, data.makers_count])
return (
diff --git a/src/features/Tournaments/pages/TournamentDetailsPage/TournamentDetailsPage.tsx b/src/features/Tournaments/pages/TournamentDetailsPage/TournamentDetailsPage.tsx
index 9778532..366705b 100644
--- a/src/features/Tournaments/pages/TournamentDetailsPage/TournamentDetailsPage.tsx
+++ b/src/features/Tournaments/pages/TournamentDetailsPage/TournamentDetailsPage.tsx
@@ -44,7 +44,7 @@ export default function TournamentDetailsPage() {
} />
- m.avatar)} isRegistered={!!tournaemntQuery.data.me?.in_tournament} />} />
+ m.user.avatar)} isRegistered={!!tournaemntQuery.data.tournamentParticipationInfo} />} />
} />
} />
} />
diff --git a/src/features/Tournaments/pages/TournamentDetailsPage/meTournament.graphql b/src/features/Tournaments/pages/TournamentDetailsPage/meTournament.graphql
index c7615c3..aacee27 100644
--- a/src/features/Tournaments/pages/TournamentDetailsPage/meTournament.graphql
+++ b/src/features/Tournaments/pages/TournamentDetailsPage/meTournament.graphql
@@ -1,11 +1,16 @@
-query MeTournament($inTournamentId: Int!) {
+query MeTournament($id: Int!) {
+ tournamentParticipationInfo(tournamentId: $id) {
+ createdAt
+ hacking_status
+ }
me {
id
name
avatar
jobTitle
-
- in_tournament(id: $inTournamentId)
+ twitter
+ linkedin
+ github
...UserRolesSkills
}
diff --git a/src/features/Tournaments/pages/TournamentDetailsPage/tournamentDetails.graphql b/src/features/Tournaments/pages/TournamentDetailsPage/tournamentDetails.graphql
index b1c4b29..750a881 100644
--- a/src/features/Tournaments/pages/TournamentDetailsPage/tournamentDetails.graphql
+++ b/src/features/Tournaments/pages/TournamentDetailsPage/tournamentDetails.graphql
@@ -44,18 +44,25 @@ query GetTournamentById($id: Int!) {
getMakersInTournament(tournamentId: $id, take: 4) {
makers {
- id
- avatar
+ user {
+ id
+ avatar
+ }
}
}
+ tournamentParticipationInfo(tournamentId: $id) {
+ createdAt
+ hacking_status
+ }
me {
id
name
avatar
jobTitle
-
- in_tournament(id: $id)
+ twitter
+ linkedin
+ github
...UserRolesSkills
}
diff --git a/src/graphql/index.tsx b/src/graphql/index.tsx
index f848154..caced71 100644
--- a/src/graphql/index.tsx
+++ b/src/graphql/index.tsx
@@ -279,6 +279,12 @@ export enum Post_Type {
Story = 'Story'
}
+export type ParticipationInfo = {
+ __typename?: 'ParticipationInfo';
+ createdAt: Scalars['Date'];
+ hacking_status: TournamentMakerHackingStatusEnum;
+};
+
export type Post = Bounty | Question | Story;
export type PostBase = {
@@ -366,6 +372,7 @@ export type Query = {
projectsByCategory: Array;
searchProjects: Array;
similarMakers: Array;
+ tournamentParticipationInfo: Maybe;
};
@@ -473,6 +480,11 @@ export type QuerySimilarMakersArgs = {
id: Scalars['Int'];
};
+
+export type QueryTournamentParticipationInfoArgs = {
+ tournamentId: Scalars['Int'];
+};
+
export type Question = PostBase & {
__typename?: 'Question';
author: Author;
@@ -600,7 +612,14 @@ export type TournamentMakersResponse = {
__typename?: 'TournamentMakersResponse';
hasNext: Maybe;
hasPrev: Maybe;
- makers: Array;
+ makers: Array;
+};
+
+export type TournamentParticipant = {
+ __typename?: 'TournamentParticipant';
+ hacking_status: TournamentMakerHackingStatusEnum;
+ is_registered: Maybe;
+ user: User;
};
export type TournamentPrize = {
@@ -875,7 +894,7 @@ export type GetMakersInTournamentQueryVariables = Exact<{
}>;
-export type GetMakersInTournamentQuery = { __typename?: 'Query', getMakersInTournament: { __typename?: 'TournamentMakersResponse', hasNext: boolean | null, hasPrev: boolean | null, makers: Array<{ __typename?: 'User', id: number, name: string, avatar: string, jobTitle: string | null, email: string | null, twitter: string | null, linkedin: string | null, github: string | null, roles: Array<{ __typename?: 'MakerRole', id: number, icon: string, title: string }>, skills: Array<{ __typename?: 'MakerSkill', id: number, title: string }> }> } };
+export type GetMakersInTournamentQuery = { __typename?: 'Query', getMakersInTournament: { __typename?: 'TournamentMakersResponse', hasNext: boolean | null, hasPrev: boolean | null, makers: Array<{ __typename?: 'TournamentParticipant', hacking_status: TournamentMakerHackingStatusEnum, user: { __typename?: 'User', id: number, name: string, avatar: string, jobTitle: string | null, twitter: string | null, linkedin: string | null, github: string | null, roles: Array<{ __typename?: 'MakerRole', id: number, icon: string, title: string }>, skills: Array<{ __typename?: 'MakerSkill', id: number, title: string }> } }> } };
export type GetProjectsInTournamentQueryVariables = Exact<{
tournamentId: Scalars['Int'];
@@ -897,18 +916,18 @@ export type RegisterInTournamentMutationVariables = Exact<{
export type RegisterInTournamentMutation = { __typename?: 'Mutation', registerInTournament: { __typename?: 'User', id: number, in_tournament: boolean } | null };
export type MeTournamentQueryVariables = Exact<{
- inTournamentId: Scalars['Int'];
+ id: Scalars['Int'];
}>;
-export type MeTournamentQuery = { __typename?: 'Query', me: { __typename?: 'MyProfile', id: number, name: string, avatar: string, jobTitle: string | null, in_tournament: boolean, skills: Array<{ __typename?: 'MakerSkill', id: number, title: string }>, roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }> } | null };
+export type MeTournamentQuery = { __typename?: 'Query', tournamentParticipationInfo: { __typename?: 'ParticipationInfo', createdAt: any, hacking_status: TournamentMakerHackingStatusEnum } | null, me: { __typename?: 'MyProfile', id: number, name: string, avatar: string, jobTitle: string | null, twitter: string | null, linkedin: string | null, github: string | null, skills: Array<{ __typename?: 'MakerSkill', id: number, title: string }>, roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }> } | null };
export type GetTournamentByIdQueryVariables = Exact<{
id: Scalars['Int'];
}>;
-export type GetTournamentByIdQuery = { __typename?: 'Query', getTournamentById: { __typename?: 'Tournament', id: number, title: string, description: string, thumbnail_image: string, cover_image: string, start_date: any, end_date: any, location: string, website: string, events_count: number, makers_count: number, projects_count: number, prizes: Array<{ __typename?: 'TournamentPrize', title: string, amount: string, image: string }>, judges: Array<{ __typename?: 'TournamentJudge', name: string, company: string, avatar: string }>, events: Array<{ __typename?: 'TournamentEvent', id: number, title: string, image: string, description: string, starts_at: any, ends_at: any, location: string, website: string, type: TournamentEventTypeEnum, links: Array }>, faqs: Array<{ __typename?: 'TournamentFAQ', question: string, answer: string }> }, getMakersInTournament: { __typename?: 'TournamentMakersResponse', makers: Array<{ __typename?: 'User', id: number, avatar: string }> }, me: { __typename?: 'MyProfile', id: number, name: string, avatar: string, jobTitle: string | null, in_tournament: boolean, skills: Array<{ __typename?: 'MakerSkill', id: number, title: string }>, roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }> } | null };
+export type GetTournamentByIdQuery = { __typename?: 'Query', getTournamentById: { __typename?: 'Tournament', id: number, title: string, description: string, thumbnail_image: string, cover_image: string, start_date: any, end_date: any, location: string, website: string, events_count: number, makers_count: number, projects_count: number, prizes: Array<{ __typename?: 'TournamentPrize', title: string, amount: string, image: string }>, judges: Array<{ __typename?: 'TournamentJudge', name: string, company: string, avatar: string }>, events: Array<{ __typename?: 'TournamentEvent', id: number, title: string, image: string, description: string, starts_at: any, ends_at: any, location: string, website: string, type: TournamentEventTypeEnum, links: Array }>, faqs: Array<{ __typename?: 'TournamentFAQ', question: string, answer: string }> }, getMakersInTournament: { __typename?: 'TournamentMakersResponse', makers: Array<{ __typename?: 'TournamentParticipant', user: { __typename?: 'User', id: number, avatar: string } }> }, tournamentParticipationInfo: { __typename?: 'ParticipationInfo', createdAt: any, hacking_status: TournamentMakerHackingStatusEnum } | null, me: { __typename?: 'MyProfile', id: number, name: string, avatar: string, jobTitle: string | null, twitter: string | null, linkedin: string | null, github: string | null, skills: Array<{ __typename?: 'MakerSkill', id: number, title: string }>, roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }> } | null };
export type VoteMutationVariables = Exact<{
itemType: Vote_Item_Type;
@@ -2281,22 +2300,24 @@ export const GetMakersInTournamentDocument = gql`
hasNext
hasPrev
makers {
- id
- name
- avatar
- jobTitle
- email
- twitter
- linkedin
- github
- roles {
+ hacking_status
+ user {
id
- icon
- title
- }
- skills {
- id
- title
+ name
+ avatar
+ jobTitle
+ twitter
+ linkedin
+ github
+ roles {
+ id
+ icon
+ title
+ }
+ skills {
+ id
+ title
+ }
}
}
}
@@ -2433,13 +2454,19 @@ export type RegisterInTournamentMutationHookResult = ReturnType;
export type RegisterInTournamentMutationOptions = Apollo.BaseMutationOptions;
export const MeTournamentDocument = gql`
- query MeTournament($inTournamentId: Int!) {
+ query MeTournament($id: Int!) {
+ tournamentParticipationInfo(tournamentId: $id) {
+ createdAt
+ hacking_status
+ }
me {
id
name
avatar
jobTitle
- in_tournament(id: $inTournamentId)
+ twitter
+ linkedin
+ github
...UserRolesSkills
}
}
@@ -2457,7 +2484,7 @@ export const MeTournamentDocument = gql`
* @example
* const { data, loading, error } = useMeTournamentQuery({
* variables: {
- * inTournamentId: // value for 'inTournamentId'
+ * id: // value for 'id'
* },
* });
*/
@@ -2516,16 +2543,24 @@ export const GetTournamentByIdDocument = gql`
}
getMakersInTournament(tournamentId: $id, take: 4) {
makers {
- id
- avatar
+ user {
+ id
+ avatar
+ }
}
}
+ tournamentParticipationInfo(tournamentId: $id) {
+ createdAt
+ hacking_status
+ }
me {
id
name
avatar
jobTitle
- in_tournament(id: $id)
+ twitter
+ linkedin
+ github
...UserRolesSkills
}
}
diff --git a/src/mocks/handlers.ts b/src/mocks/handlers.ts
index b6a8bc4..dc1fe80 100644
--- a/src/mocks/handlers.ts
+++ b/src/mocks/handlers.ts
@@ -37,6 +37,7 @@ import {
GetMakersInTournamentQuery,
GetMakersInTournamentQueryVariables,
MeTournamentQuery,
+ TournamentMakerHackingStatusEnum,
} from 'src/graphql'
const delay = (ms = 1000) => new Promise((res) => setTimeout(res, ms + Math.random() * 1000))
@@ -284,7 +285,12 @@ export const handlers = [
ctx.data({
getTournamentById: getTournamentById(12),
getMakersInTournament: getMakersInTournament({ roleId: null, search: null, skip: null, take: 4, tournamentId: 12 }),
- me: { ...me() }
+ me: { ...me() },
+ tournamentParticipationInfo: {
+ hacking_status: TournamentMakerHackingStatusEnum.OpenToConnect,
+ createdAt: new Date()
+ }
+
})
)
}),
@@ -294,7 +300,11 @@ export const handlers = [
return res(
ctx.data({
- me: { ...me() }
+ me: { ...me() },
+ tournamentParticipationInfo: {
+ hacking_status: TournamentMakerHackingStatusEnum.OpenToConnect,
+ createdAt: new Date()
+ }
})
)
}),
@@ -304,7 +314,7 @@ export const handlers = [
return res(
ctx.data({
- getMakersInTournament: getMakersInTournament(req.variables)
+ getMakersInTournament: getMakersInTournament(req.variables),
})
)
}),
diff --git a/src/mocks/resolvers.ts b/src/mocks/resolvers.ts
index 74ffc2d..6045106 100644
--- a/src/mocks/resolvers.ts
+++ b/src/mocks/resolvers.ts
@@ -1,5 +1,5 @@
import { MOCK_DATA } from "./data";
-import { GetMakersInTournamentQueryVariables, MyProfile, Query, QueryGetFeedArgs, QueryGetPostByIdArgs, User } from 'src/graphql'
+import { GetMakersInTournamentQueryVariables, MyProfile, Query, QueryGetFeedArgs, QueryGetPostByIdArgs, TournamentMakerHackingStatusEnum, User } from 'src/graphql'
import { Chance } from "chance";
import { tags } from "./data/tags";
import { hackathons } from "./data/hackathon";
@@ -114,7 +114,8 @@ export function getMakersInTournament(vars: GetMakersInTournamentQueryVariables)
if (!vars.roleId) return true;
return u.roles.some(r => r.id === vars.roleId)
})
- .slice(offsetStart, offsetEnd + 1) as User[]
+ .slice(offsetStart, offsetEnd + 1)
+ .map(u => ({ user: u as User, hacking_status: TournamentMakerHackingStatusEnum.OpenToConnect }))
;
return {