Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into feat/sg-quests
  • Loading branch information
valentinludu committed Dec 7, 2024
2 parents fcbffc9 + d73828e commit 1b388bd
Show file tree
Hide file tree
Showing 25 changed files with 235 additions and 299 deletions.
21 changes: 11 additions & 10 deletions apps/scoutgame/__e2e__/infoPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ test.describe('Info page', () => {

test.describe('Info page partners', () => {
test('Open Optimism from the scout page', async ({ page, scoutPage, infoPage, utils }) => {
const newUser = await mockScout({
onboardedAt: new Date(),
agreedToTermsAt: new Date(),
avatar: 'https://placehold.co/256'
});
const newUser = await mockScout();
await utils.loginAsUserId(newUser.id);

await page.goto('/scout');
Expand All @@ -48,16 +44,21 @@ test.describe('Info page partners', () => {
await expect(infoPage.optimismContainer).toBeVisible();
});
test('Open Moxie from the scout page', async ({ page, scoutPage, infoPage, utils }) => {
const newUser = await mockScout({
onboardedAt: new Date(),
agreedToTermsAt: new Date(),
avatar: 'https://placehold.co/256'
});
const newUser = await mockScout();
await utils.loginAsUserId(newUser.id);

await page.goto('/scout');
await scoutPage.moxiePromoCard.click();

await expect(infoPage.moxieContainer).toBeVisible();
});
test('Open Glo from the scout page', async ({ page, scoutPage, infoPage, utils }) => {
const newUser = await mockScout();
await utils.loginAsUserId(newUser.id);

await page.goto('/scout');
await scoutPage.gloCard.click();

await expect(infoPage.gloContainer).toBeVisible();
});
});
3 changes: 2 additions & 1 deletion apps/scoutgame/__e2e__/po/InfoPage.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export class InfoPage extends GeneralPageLayout {
public privacyContainer = page.locator('data-test=privacy-page'),
public dpaContainer = page.locator('data-test=dpa-page'),
public moxieContainer = page.locator('data-test=partner-moxie-page'),
public optimismContainer = page.locator('data-test=partner-optimism-page')
public optimismContainer = page.locator('data-test=partner-optimism-page'),
public gloContainer = page.locator('data-test=partner-glo-page')
) {
super(page);
}
Expand Down
3 changes: 2 additions & 1 deletion apps/scoutgame/__e2e__/po/ScoutPage.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export class ScoutPage extends GeneralPageLayout {
protected page: Page,
public container = page.locator('data-test=scout-page'),
public optimismPromoCard = page.locator('data-test=promo-card-optimism'),
public moxiePromoCard = page.locator('data-test=promo-card-moxie')
public moxiePromoCard = page.locator('data-test=promo-card-moxie'),
public gloCard = page.locator('data-test=promo-card-glo')
) {
super(page);
}
Expand Down
10 changes: 10 additions & 0 deletions apps/scoutgame/app/(general)/info/partner-rewards/glo/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { GloDollarPage } from '@packages/scoutgame-ui/components/info/partner-rewards/GloDollarPage';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Glo Rewards'
};

export default async function Game7() {
return <GloDollarPage />;
}
4 changes: 2 additions & 2 deletions apps/scoutgame/app/(general)/scout/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { prisma } from '@charmverse/core/prisma-client';
import { MAX_STARTER_PACK_PURCHASES } from '@packages/scoutgame/builderNfts/constants';
import { getStarterpackBuilders } from '@packages/scoutgame/builders/getStarterPackBuilders';
import { getStarterPackBuilders } from '@packages/scoutgame/builders/getStarterPackBuilders';
import type { BuilderInfo } from '@packages/scoutgame/builders/interfaces';
import { currentSeason } from '@packages/scoutgame/dates';
import { getUserFromSession } from '@packages/scoutgame/session/getUserFromSession';
Expand Down Expand Up @@ -38,7 +38,7 @@ export default async function Scout({
remainingStarterCards = MAX_STARTER_PACK_PURCHASES - purchases;

if (purchases < MAX_STARTER_PACK_PURCHASES) {
const [_, starterPackBuilders] = await safeAwaitSSRData(getStarterpackBuilders({ season: currentSeason }));
const [_, starterPackBuilders] = await safeAwaitSSRData(getStarterPackBuilders());
builders = starterPackBuilders ?? [];
}
}
Expand Down
5 changes: 3 additions & 2 deletions apps/scoutgame/app/api/builders/refresh-congrats/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { log } from '@charmverse/core/log';
import { prisma } from '@charmverse/core/prisma-client';
import { BuilderNftType, prisma } from '@charmverse/core/prisma-client';
import { refreshShareImage } from '@packages/scoutgame/builders/refreshShareImage';
import { currentSeason } from '@packages/scoutgame/dates';

Expand All @@ -15,7 +15,8 @@ export async function PUT(request: Request) {
const existingNft = await prisma.builderNft.findFirstOrThrow({
where: {
builderId: search,
season: currentSeason
season: currentSeason,
nftType: BuilderNftType.default
}
});

Expand Down
16 changes: 0 additions & 16 deletions apps/scoutgame/components/scout/components/StarterPackInfo.tsx

This file was deleted.

Binary file added apps/scoutgame/public/images/home/glo-ad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { GloDollarPage } from '@packages/scoutgame-ui/components/info/partner-rewards/GloDollarPage';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Glo Rewards'
};

export default async function Game7() {
return <GloDollarPage />;
}
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"@bangle.dev/pm-commands": "^0.31.6",
"@bangle.dev/utils": "^0.31.6",
"@beam-australia/react-env": "^3.1.1",
"@charmverse/core": "^0.98.3",
"@charmverse/core": "^0.98.5",
"@column-resizer/core": "^1.0.2",
"@datadog/browser-logs": "^4.42.2",
"@datadog/browser-rum": "^4.42.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const partners = [
{ href: '/info/partner-rewards/lit', text: 'Lit Protocol' },
{ href: '/info/partner-rewards/optimism', text: 'Optimism' },
{ href: '/info/partner-rewards/op-supersim', text: 'OP Supersim' },
{ href: '/info/partner-rewards/talent-protocol', text: 'Talent Protocol' }
{ href: '/info/partner-rewards/talent-protocol', text: 'Talent Protocol' },
{ href: '/info/partner-rewards/glo', text: 'Glo Dollar' }
];

export function SidebarInfo({ handleClose }: Readonly<{ handleClose?: () => void }>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@ export function CeloPage() {
);
}

const tiers = [
{
name: 'Common',
reward: '50 cUSD'
},
{
name: 'Rare',
reward: '150 cUSD'
},
{
name: 'Epic',
reward: '250 cUSD'
},
{
name: 'Mythic',
reward: '350 cUSD'
},
{
name: 'Legendary',
reward: '450 cUSD'
}
];

function Document() {
return (
<InfoCard>
Expand All @@ -36,30 +59,22 @@ function Document() {
Qualified projects will mark their issues with a Tier in GitHub. The Tier determines the builder's reward for
merging a PR that addresses the issue. Unmarked issues will default to the Common Tier.
</Typography>
<TableContainer component={Paper}>
<Table sx={{ '& th, & td': { px: 0 } }} aria-label='Celo tiers table'>
<TableHead>
<TableRow>
<TableCell>GitHub Issue Tier</TableCell>
<TableCell align='right'>Reward</TableCell>
</TableRow>
</TableHead>
<TableBody sx={{ '& td, & th': { border: 0 } }}>
<TableRow>
<TableCell>Common</TableCell>
<TableCell align='right'>50 cUSD</TableCell>
</TableRow>
<TableRow>
<TableCell>Rare</TableCell>
<TableCell align='right'>150 cUSD</TableCell>
</TableRow>
<TableRow>
<TableCell>Epic</TableCell>
<TableCell align='right'>250 cUSD</TableCell>
<Table>
<TableHead>
<TableRow>
<TableCell>GitHub Issue Tier</TableCell>
<TableCell align='right'>Reward</TableCell>
</TableRow>
</TableHead>
<TableBody>
{tiers.map((tier) => (
<TableRow key={tier.name}>
<TableCell>{tier.name}</TableCell>
<TableCell align='right'>{tier.reward}</TableCell>
</TableRow>
</TableBody>
</Table>
</TableContainer>
))}
</TableBody>
</Table>
<Typography variant='h6' color='secondary' mt={2}>
How to contribute
</Typography>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Link, Typography } from '@mui/material';

import { InfoCard } from '../../common/DocumentPageContainer/components/InfoCard';
import { List, ListItem } from '../../common/List';
import { InfoPageContainer } from '../components/InfoPageContainer';

export function GloDollarPage() {
return (
<InfoPageContainer data-test='partner-glo-page' image='/images/info/rewards-partner-glo.png' title='Glo Dollar'>
<Document />
</InfoPageContainer>
);
}

function Document() {
return (
<InfoCard>
<Typography>
Glo Dollar is rewarding Scouts for supporting Builders! The total prize pool is $1000 USDGLO through December
2024.
</Typography>
<Typography variant='h6' color='secondary' mt={2}>
How it works
</Typography>
<Typography>
A Scout receives $1 USDGLO for each Builder Card, up to 5, purchased through the end of the year. Maximum reward
per Scout is $5 USDGLO.
</Typography>
</InfoCard>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ function Document() {
competition. New Scouts will compete with each other to earn the most Scout Points during their first week
playing the game. The Top 10 point earners will be awarded OP, from a weekly pool of 500 OP, as follows:
</Typography>
<Table sx={{ '& th, & td': { px: 0 } }} size='small'>
<Table size='small'>
<TableHead>
<TableRow>
<TableCell>Rank</TableCell>
<TableCell align='right'>Reward</TableCell>
</TableRow>
</TableHead>
<TableBody sx={{ '& td, & th': { border: 0 } }}>
<TableBody>
<TableRow>
<TableCell>1</TableCell>
<TableCell align='right'>100 OP</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ function Document() {
Supersim to provide an even better local development experience
</ListItem>
</List>
<Table sx={{ '& th, & td': { px: 0 } }} aria-label='Celo tiers table'>
<Table>
<TableHead>
<TableRow>
<TableCell>Issue</TableCell>
<TableCell align='right'>Reward</TableCell>
</TableRow>
</TableHead>
<TableBody sx={{ '& td, & th': { border: 0 } }}>
<TableBody>
<TableRow>
<TableCell>
<Link
Expand Down Expand Up @@ -109,7 +109,6 @@ function Document() {
</TableRow>
</TableBody>
</Table>
<Divider />
<Typography variant='caption'>* See list of high priority additional features above for inspiration.</Typography>
<Typography variant='caption'>
** Optimism will determine the reward based on the complexity and priority of the issue.
Expand Down
Loading

0 comments on commit 1b388bd

Please sign in to comment.