Skip to content

Commit ef09464

Browse files
committed
feat: move logo and color to header
1 parent 3894dad commit ef09464

File tree

2 files changed

+52
-44
lines changed

2 files changed

+52
-44
lines changed

frontend/app/api/generated.ts

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type Achievement = {
2828
event?: Maybe<Event>;
2929
hidden: Scalars['Boolean']['output'];
3030
id: Scalars['ID']['output'];
31-
image: Scalars['String']['output'];
31+
image?: Maybe<Scalars['String']['output']>;
3232
name: Scalars['String']['output'];
3333
points: Scalars['Int']['output'];
3434
project: Project;
@@ -69,13 +69,13 @@ export type Article = {
6969
author: Scalars['String']['output'];
7070
id: Scalars['ID']['output'];
7171
title: Scalars['String']['output'];
72-
url: Scalars['String']['output'];
72+
url?: Maybe<Scalars['String']['output']>;
7373
};
7474

7575
export type ArticleInput = {
7676
author: Scalars['String']['input'];
7777
title: Scalars['String']['input'];
78-
url: Scalars['String']['input'];
78+
url?: InputMaybe<Scalars['String']['input']>;
7979
};
8080

8181
export type AssignRoleInput = {
@@ -105,11 +105,11 @@ export type Challenge = {
105105
endTime?: Maybe<Scalars['DateTime']['output']>;
106106
event?: Maybe<Event>;
107107
id: Scalars['ID']['output'];
108-
image: Scalars['String']['output'];
108+
image?: Maybe<Scalars['String']['output']>;
109109
name: Scalars['String']['output'];
110110
project: Project;
111111
publishedAt: Scalars['DateTime']['output'];
112-
url: Scalars['String']['output'];
112+
url?: Maybe<Scalars['String']['output']>;
113113
userCompletedAt?: Maybe<Scalars['DateTime']['output']>;
114114
};
115115

@@ -182,13 +182,11 @@ export type ColorsInput = {
182182

183183
export type CreateChallengeInput = {
184184
buttonText: Scalars['String']['input'];
185-
description: Scalars['HTML']['input'];
185+
description?: InputMaybe<Scalars['HTML']['input']>;
186186
endTime?: InputMaybe<Scalars['DateTime']['input']>;
187-
eventId?: InputMaybe<Scalars['ID']['input']>;
188-
image: Scalars['String']['input'];
187+
image?: InputMaybe<Scalars['String']['input']>;
189188
name: Scalars['String']['input'];
190-
projectId: Scalars['ID']['input'];
191-
url: Scalars['String']['input'];
189+
url?: InputMaybe<Scalars['String']['input']>;
192190
};
193191

194192
export type CreateChurchInput = {
@@ -209,7 +207,7 @@ export type CreateListeningAchievementInput = {
209207
description: Scalars['String']['input'];
210208
eventId?: InputMaybe<Scalars['ID']['input']>;
211209
hidden: Scalars['Boolean']['input'];
212-
image: Scalars['String']['input'];
210+
image?: InputMaybe<Scalars['String']['input']>;
213211
name: Scalars['String']['input'];
214212
points: Scalars['Int']['input'];
215213
projectId: Scalars['ID']['input'];
@@ -230,7 +228,7 @@ export type CreateReadingAchievementInput = {
230228
description: Scalars['String']['input'];
231229
eventId?: InputMaybe<Scalars['ID']['input']>;
232230
hidden: Scalars['Boolean']['input'];
233-
image: Scalars['String']['input'];
231+
image?: InputMaybe<Scalars['String']['input']>;
234232
name: Scalars['String']['input'];
235233
points: Scalars['Int']['input'];
236234
projectId: Scalars['ID']['input'];
@@ -241,7 +239,7 @@ export type CreateSimpleAchievementInput = {
241239
description: Scalars['String']['input'];
242240
eventId?: InputMaybe<Scalars['ID']['input']>;
243241
hidden: Scalars['Boolean']['input'];
244-
image: Scalars['String']['input'];
242+
image?: InputMaybe<Scalars['String']['input']>;
245243
name: Scalars['String']['input'];
246244
points: Scalars['Int']['input'];
247245
projectId: Scalars['ID']['input'];
@@ -252,7 +250,7 @@ export type CreateStreakAchievementInput = {
252250
description: Scalars['String']['input'];
253251
eventId?: InputMaybe<Scalars['ID']['input']>;
254252
hidden: Scalars['Boolean']['input'];
255-
image: Scalars['String']['input'];
253+
image?: InputMaybe<Scalars['String']['input']>;
256254
name: Scalars['String']['input'];
257255
neededStreak: Scalars['Int']['input'];
258256
points: Scalars['Int']['input'];
@@ -403,7 +401,7 @@ export type ListeningAchievement = Achievement & {
403401
event?: Maybe<Event>;
404402
hidden: Scalars['Boolean']['output'];
405403
id: Scalars['ID']['output'];
406-
image: Scalars['String']['output'];
404+
image?: Maybe<Scalars['String']['output']>;
407405
name: Scalars['String']['output'];
408406
nextTrack: Track;
409407
points: Scalars['Int']['output'];
@@ -595,7 +593,9 @@ export type MutationBulkCompleteChallengesArgs = {
595593

596594

597595
export type MutationBulkCreateChallengesArgs = {
596+
eventId: Scalars['ID']['input'];
598597
inputs: Array<CreateChallengeInput>;
598+
projectId: Scalars['ID']['input'];
599599
};
600600

601601

@@ -613,7 +613,9 @@ export type MutationCompleteChallengeArgs = {
613613

614614

615615
export type MutationCreateChallengeArgs = {
616+
eventId: Scalars['ID']['input'];
616617
input: CreateChallengeInput;
618+
projectId: Scalars['ID']['input'];
617619
};
618620

619621

@@ -1096,7 +1098,7 @@ export type ReadingAchievement = Achievement & {
10961098
event?: Maybe<Event>;
10971099
hidden: Scalars['Boolean']['output'];
10981100
id: Scalars['ID']['output'];
1099-
image: Scalars['String']['output'];
1101+
image?: Maybe<Scalars['String']['output']>;
11001102
name: Scalars['String']['output'];
11011103
nextArticle: Article;
11021104
points: Scalars['Int']['output'];
@@ -1144,7 +1146,7 @@ export type SimpleAchievement = Achievement & {
11441146
event?: Maybe<Event>;
11451147
hidden: Scalars['Boolean']['output'];
11461148
id: Scalars['ID']['output'];
1147-
image: Scalars['String']['output'];
1149+
image?: Maybe<Scalars['String']['output']>;
11481150
name: Scalars['String']['output'];
11491151
points: Scalars['Int']['output'];
11501152
project: Project;
@@ -1174,7 +1176,7 @@ export type StreakAchievement = Achievement & {
11741176
event?: Maybe<Event>;
11751177
hidden: Scalars['Boolean']['output'];
11761178
id: Scalars['ID']['output'];
1177-
image: Scalars['String']['output'];
1179+
image?: Maybe<Scalars['String']['output']>;
11781180
name: Scalars['String']['output'];
11791181
neededStreak: Scalars['Int']['output'];
11801182
points: Scalars['Int']['output'];
@@ -1282,13 +1284,13 @@ export type Track = {
12821284
__typename?: 'Track';
12831285
description: Scalars['String']['output'];
12841286
id: Scalars['ID']['output'];
1285-
image: Scalars['String']['output'];
1287+
image?: Maybe<Scalars['String']['output']>;
12861288
name: Scalars['String']['output'];
12871289
};
12881290

12891291
export type TrackInput = {
12901292
description: Scalars['String']['input'];
1291-
image: Scalars['String']['input'];
1293+
image?: InputMaybe<Scalars['String']['input']>;
12921294
name: Scalars['String']['input'];
12931295
};
12941296

@@ -1465,7 +1467,7 @@ export type AdminUsersPageQuery = { __typename?: 'Query', users: { __typename?:
14651467
export type ChallengesPageQueryVariables = Exact<{ [key: string]: never; }>;
14661468

14671469

1468-
export type ChallengesPageQuery = { __typename?: 'Query', myCurrentProject: { __typename?: 'Project', challenges: Array<{ __typename?: 'Challenge', id: string, name: string, description: any, userCompletedAt?: any | null, image: string, url: string, buttonText: string, publishedAt: any, endTime?: any | null }> } };
1470+
export type ChallengesPageQuery = { __typename?: 'Query', myCurrentProject: { __typename?: 'Project', challenges: Array<{ __typename?: 'Challenge', id: string, name: string, description: any, userCompletedAt?: any | null, image?: string | null, url?: string | null, buttonText: string, publishedAt: any, endTime?: any | null }> } };
14691471

14701472
export type StandingsPageQueryVariables = Exact<{
14711473
entityType: LeaderboardEntityType;
@@ -1479,10 +1481,10 @@ export type ProfilePageQueryVariables = Exact<{ [key: string]: never; }>;
14791481

14801482

14811483
export type ProfilePageQuery = { __typename?: 'Query', me: { __typename?: 'User', id: string, name: string, image?: string | null, projects: Array<{ __typename?: 'Project', id: string, achievements: Array<
1482-
| { __typename?: 'ListeningAchievement', id: string, name: string, description: string, image: string, hidden: boolean, achievedAt?: any | null, points: number }
1483-
| { __typename?: 'ReadingAchievement', id: string, name: string, description: string, image: string, hidden: boolean, achievedAt?: any | null, points: number }
1484-
| { __typename?: 'SimpleAchievement', id: string, name: string, description: string, image: string, hidden: boolean, achievedAt?: any | null, points: number }
1485-
| { __typename?: 'StreakAchievement', id: string, name: string, description: string, image: string, hidden: boolean, achievedAt?: any | null, points: number }
1484+
| { __typename?: 'ListeningAchievement', id: string, name: string, description: string, image?: string | null, hidden: boolean, achievedAt?: any | null, points: number }
1485+
| { __typename?: 'ReadingAchievement', id: string, name: string, description: string, image?: string | null, hidden: boolean, achievedAt?: any | null, points: number }
1486+
| { __typename?: 'SimpleAchievement', id: string, name: string, description: string, image?: string | null, hidden: boolean, achievedAt?: any | null, points: number }
1487+
| { __typename?: 'StreakAchievement', id: string, name: string, description: string, image?: string | null, hidden: boolean, achievedAt?: any | null, points: number }
14861488
> }> } };
14871489

14881490
export type UnitPageQueryVariables = Exact<{ [key: string]: never; }>;

frontend/app/pages/admin/projects/[projectId].vue

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,37 +118,43 @@ watch(data, () => {
118118
<ErrorState v-else-if="error" :error class="h-[600px]" />
119119
<template v-else-if="data">
120120
<header class="my-12">
121-
<div class="my-8 flex flex-col gap-6">
122-
<div>
123-
<h1 class="mb-2 text-3xl">
124-
{{ state.name }}
125-
</h1>
126-
<p v-if="state.description" class="text-muted max-w-2xl">
127-
{{ state.description }}
128-
</p>
121+
<div>
122+
<div class="mb-6 flex justify-between gap-4">
123+
<UFormField>
124+
<NuxtImg
125+
v-if="state.branding.logo"
126+
:src="state.branding.logo"
127+
width="64"
128+
class="rounded"
129+
/>
130+
<div
131+
v-else
132+
class="bg-muted text-dimmed flex size-16 items-center justify-center rounded text-lg"
133+
>
134+
<UIcon name="lucide:image" />
135+
</div>
136+
</UFormField>
137+
<UFormField label="Accent color">
138+
<ColorPickerInput v-model="state.branding.colors.primary" />
139+
</UFormField>
129140
</div>
141+
<h1 class="mb-2 text-3xl">
142+
{{ state.name }}
143+
</h1>
144+
<p v-if="state.description" class="text-muted max-w-2xl">
145+
{{ state.description }}
146+
</p>
130147
</div>
131148
</header>
132149
<UTabs
133150
:items="[
134-
{ label: 'Branding', slot: 'branding' },
135151
{ label: 'Events', slot: 'events' },
136152
{ label: 'Challenges', slot: 'challenges' },
137153
{ label: 'Streaks', slot: 'streaks' },
138154
{ label: 'Achievements', slot: 'achievements' },
139155
]"
140156
variant="link"
141157
>
142-
<template #branding>
143-
<div class="mt-4 flex flex-col gap-4">
144-
<UFormField label="Logo">
145-
<NuxtImg :src="state.branding.logo || ''" width="64" />
146-
</UFormField>
147-
<UFormField label="Accent color">
148-
<ColorPickerInput v-model="state.branding.colors.primary" />
149-
</UFormField>
150-
</div>
151-
</template>
152158
<template #events>
153159
<UTable :data="data.events.edges.map((e) => e.node)" />
154160
</template>

0 commit comments

Comments
 (0)