Skip to content

Commit 8b8d797

Browse files
authored
Merge pull request #490 from scaffold-eth/challenge-prediction-markets-new-ui
Prediction Markets New UI
2 parents 878d9a9 + d680962 commit 8b8d797

14 files changed

Lines changed: 29 additions & 31 deletions

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Before you begin, you need to install the following tools:
8080
Then download the challenge to your computer and install dependencies by running:
8181

8282
```sh
83-
npx create-eth@2.0.20 -e challenge-prediction-markets challenge-prediction-markets
83+
npx create-eth@2.0.22 -e challenge-prediction-markets challenge-prediction-markets
8484
cd challenge-prediction-markets
8585
```
8686

@@ -108,6 +108,8 @@ yarn start
108108

109109
📱 Open [http://localhost:3000](http://localhost:3000/) to see the app.
110110

111+
> _Note: the UI in screenshots may differ slightly from the current version._
112+
111113
> 👩‍💻 Rerun `yarn deploy` whenever you want to deploy contract changes to the frontend. Run `yarn deploy --reset` for a completely fresh deploy, even when contracts are unchanged.
112114
113115
Head to the **`Debug Contracts`** tab and you should find a smart contract named **`PredictionMarket`**. This is our main contract and the one we'll be working on throughout the challenge. Since we haven't implemented any functions yet, they all shouldn't work, nor will you see all the necessary state variables.

extension/README.md.args.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ yarn start
9696
9797
📱 Open [http://localhost:3000](http://localhost:3000/) to see the app.
9898
99+
> _Note: the UI in screenshots may differ slightly from the current version._
100+
99101
> 👩‍💻 Rerun \`yarn deploy\` whenever you want to deploy contract changes to the frontend. Run \`yarn deploy --reset\` for a completely fresh deploy, even when contracts are unchanged.
100102
101103
Head to the **\`Debug Contracts\`** tab and you should find a smart contract named **\`PredictionMarket\`**. This is our main contract and the one we'll be working on throughout the challenge. Since we haven't implemented any functions yet, they all shouldn't work, nor will you see all the necessary state variables.

extension/packages/nextjs/app/page.tsx.args.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const description = `
1212
width="727"
1313
height="231"
1414
alt="challenge banner"
15-
className="rounded-xl border-4 border-primary"
15+
className="border-4 border-primary"
1616
/>
1717
<div className="max-w-3xl">
1818
<p className="text-center text-lg mt-8">

extension/packages/nextjs/components/liquidity-provider/LPAddress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function LPAddress() {
1818

1919
if (!owner)
2020
return (
21-
<div className="flex flex-col bg-base-100 p-4 rounded-xl">
21+
<div className="flex flex-col bg-base-100 p-4">
2222
<h3 className="text-xl font-medium">Prediction Market Info</h3>
2323
<p className="text-base-content">No prediction market found</p>
2424
</div>

extension/packages/nextjs/components/liquidity-provider/PredictionMarketInfoLP.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function PredictionMarketInfoLP() {
112112
{!isReported ? (
113113
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
114114
{/* Yes Token */}
115-
<div className="bg-base-200 p-4 rounded-lg border-4 border-green-500">
115+
<div className="bg-base-200 p-4 border-4 border-green-500">
116116
<h2 className="text-2xl font-semibold mb-2">&quot;{yesOutcome}&quot; Token</h2>
117117
<h3 className="text-lg mb-2">
118118
Total Supply:
@@ -162,7 +162,7 @@ export function PredictionMarketInfoLP() {
162162
</div>
163163

164164
{/* No Token */}
165-
<div className="bg-base-200 p-4 rounded-lg border-4 border-red-500">
165+
<div className="bg-base-200 p-4 border-4 border-red-500">
166166
<h2 className="text-2xl font-semibold mb-2">&quot;{noOutcome}&quot; Token</h2>
167167
<h3 className="text-lg mb-2">
168168
Total Supply:
@@ -208,7 +208,7 @@ export function PredictionMarketInfoLP() {
208208
</div>
209209
</div>
210210
) : (
211-
<div className="bg-base-200 p-4 rounded-lg">
211+
<div className="bg-base-200 p-4">
212212
<h2 className="text-2xl font-semibold mb-2">Oracle reported: {winningOption}</h2>
213213
<h3 className="text-lg mb-2">
214214
Value of {winningOption} tokens held by prediction market:{" "}

extension/packages/nextjs/components/liquidity-provider/ResolveMarketAndWithdraw.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function ResolveMarketAndWithdraw() {
6262
<div className="card bg-base-100 w-full shadow-xl indicator">
6363
<div className="card-body">
6464
{!isLiquidityProvider ? (
65-
<div className="max-w-6xl mx-auto bg-base-100 rounded-xl">
65+
<div className="max-w-6xl mx-auto bg-base-100">
6666
<p className="text-xl font-bold text-center">❗️ Only the liquidity provider can resolve the market</p>
6767
</div>
6868
) : (

extension/packages/nextjs/components/race/Race.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ const RaceTrack: React.FC = () => {
244244
</div>
245245
</div>
246246

247-
<div className="rounded-lg overflow-hidden">
247+
<div className="overflow-hidden">
248248
<Image
249249
src={resolvedTheme === "dark" ? BackgroundImageDark : BackgroundImage}
250250
alt="Mountain Background"

extension/packages/nextjs/components/race/RaceEffects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const RaceEffects: React.FC<RaceEffectsProps> = ({ isRacing }) => {
3434
{Array.from({ length: 15 }).map((_, index) => (
3535
<div
3636
key={index}
37-
className="absolute rounded-full bg-gray-300 opacity-40"
37+
className="absolute bg-gray-300 opacity-40"
3838
style={{
3939
top: `${50 + (Math.random() * 40 - 20)}%`,
4040
left: `${Math.random() * 100}%`,

extension/packages/nextjs/components/user/OverviewBuySellShares.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ export function OverviewBuySellShares() {
6060
type="radio"
6161
name="token_tabs"
6262
role="tab"
63-
className="tab font-lexend font-semibold text-green-500 min-w-40 rounded-tl-md rounded-tr-md bg-base-300 checked:bg-green-500 checked:text-white"
63+
className="tab font-lexend font-semibold text-green-500 min-w-40 bg-base-300 checked:bg-green-500 checked:text-white"
6464
aria-label={`"${yesOutcome}" Token`}
6565
defaultChecked
6666
/>
6767
<div role="tabpanel" className="tab-content border-l-0">
68-
<div className="rounded-bl-lg rounded-br-lg p-4 border-4 border-green-500">
68+
<div className="p-4 border-4 border-green-500">
6969
<PredictionBuySellShare optionIndex={0} colorScheme="green" />
7070
</div>
7171
</div>
@@ -74,11 +74,11 @@ export function OverviewBuySellShares() {
7474
type="radio"
7575
name="token_tabs"
7676
role="tab"
77-
className="tab font-lexend font-semibold text-red-500 min-w-40 rounded-md bg-base-300 checked:bg-red-500 checked:text-white ml-4"
77+
className="tab font-lexend font-semibold text-red-500 min-w-40 bg-base-300 checked:bg-red-500 checked:text-white ml-4"
7878
aria-label={`"${noOutcome}" Token`}
7979
/>
8080
<div role="tabpanel" className="tab-content border-l-0">
81-
<div className="rounded-bl-lg rounded-br-lg p-4 border-4 border-red-500">
81+
<div className="p-4 border-4 border-red-500">
8282
<PredictionBuySellShare optionIndex={1} colorScheme="red" />
8383
</div>
8484
</div>

extension/packages/nextjs/components/user/PredictionBuySellShare.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function PredictionBuySellShare({ optionIndex, colorScheme }: { optionInd
6363

6464
if (!owner)
6565
return (
66-
<div className="max-w-lg mx-auto p-4 bg-white rounded-xl shadow-lg space-y-4">
66+
<div className="max-w-lg mx-auto p-4 bg-white shadow-lg space-y-4">
6767
<h2 className="text-lg font-semibold text-center">No prediction market found</h2>
6868
</div>
6969
);
@@ -117,12 +117,12 @@ export function PredictionBuySellShare({ optionIndex, colorScheme }: { optionInd
117117
defaultChecked
118118
/>
119119
<div role="tabpanel" className="tab-content pt-4">
120-
<div className={`bg-${colorScheme}-50 rounded-lg`}>
120+
<div className={`bg-${colorScheme}-50`}>
121121
<div className="space-y-4">
122122
<input
123123
type="number"
124124
placeholder="Amount to buy"
125-
className={`input input-bordered input-sm w-full rounded-md placeholder-${colorScheme}-500 dark:placeholder-white dark:placeholder-opacity-70`}
125+
className={`input input-bordered input-sm w-full placeholder-${colorScheme}-500 dark:placeholder-white dark:placeholder-opacity-70`}
126126
onChange={e => setInputBuyAmount(BigInt(e.target.value))}
127127
/>
128128

@@ -185,7 +185,7 @@ export function PredictionBuySellShare({ optionIndex, colorScheme }: { optionInd
185185
<input
186186
type="number"
187187
placeholder="Amount to sell"
188-
className={`input input-bordered input-sm w-full rounded-md placeholder-${colorScheme}-500 dark:placeholder-white dark:placeholder-opacity-70`}
188+
className={`input input-bordered input-sm w-full placeholder-${colorScheme}-500 dark:placeholder-white dark:placeholder-opacity-70`}
189189
onChange={e => setInputSellAmount(BigInt(e.target.value))}
190190
/>
191191

0 commit comments

Comments
 (0)