Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch PR 4 of week ending 9/17/24 #2365

Merged
merged 25 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
734721a
fix(deps): update dependency viem to v2.21.6
renovate[bot] Sep 11, 2024
7172c09
fix(deps): update dependency wagmi to v2.12.11
renovate[bot] Sep 12, 2024
bbcdbf2
fix(deps): update nextjs monorepo to v14.2.10
renovate[bot] Sep 12, 2024
20efcfa
fix(deps): update aws-sdk-js-v3 monorepo to v3.650.0
renovate[bot] Sep 12, 2024
ce361e3
fix(deps): update dependency @headlessui/react to v2.1.8 (#2360)
renovate[bot] Sep 12, 2024
5b9863e
fix(deps): update dependency @tanstack/react-query to v5.56.0
renovate[bot] Sep 12, 2024
515bd95
fix(deps): update dependency @tanstack/react-query to v5.56.1 (#2363)
renovate[bot] Sep 12, 2024
57b4e29
enhancement: improve voting slider on mobile (#2362)
nakedfool Sep 12, 2024
b8f3e1e
chore: replace placeholder color with darker grey (#2364)
nakedfool Sep 12, 2024
4602027
docs: rm vercel reference (#2366)
Sep 12, 2024
05ef6ce
fix(deps): update dependency @tanstack/react-query to v5.56.2
renovate[bot] Sep 12, 2024
a6ff344
fix(deps): update nextjs monorepo to v14.2.11
renovate[bot] Sep 13, 2024
cd131eb
chore: add commands (#2370)
Sep 13, 2024
44ff4fe
fix(deps): update aws-sdk-js-v3 monorepo to v3.651.0
renovate[bot] Sep 13, 2024
db948eb
feat: add nextjs build github action (#2371)
Sep 13, 2024
4ecf30d
chore: rename forge tests (#2373)
Sep 13, 2024
5500c4e
chore: group actions on branch (#2374)
Sep 13, 2024
67c831d
chore: use prod env vars if main (#2375)
Sep 13, 2024
620ea03
fix(deps): update aws-sdk-js-v3 monorepo to v3.651.1
renovate[bot] Sep 13, 2024
7da467e
fix(deps): update dependency viem to v2.21.7
renovate[bot] Sep 14, 2024
3192761
fix(deps): update dependency postcss to v8.4.47
renovate[bot] Sep 14, 2024
ac24fbc
fix(deps): update dependency @types/react to v18.3.6 (#2383)
renovate[bot] Sep 16, 2024
f48f501
fix(deps): update dependency valibot to v0.42.0 (#2381)
renovate[bot] Sep 16, 2024
e55920a
chore: ignore next build files (#2377)
Sep 16, 2024
a337880
enhancement: tightening contest UI real estate (#2372)
nakedfool Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/forge_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ on: push
env:
FOUNDRY_PROFILE: ci

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/nextjs_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: nextjs

on: push

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: yarn install --production
- name: Build with Next.js
run: yarn build
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_SUPABASE_URL || secrets.DEV_NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_SUPABASE_ANON_KEY || secrets.DEV_NEXT_PUBLIC_SUPABASE_ANON_KEY }}
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || secrets.DEV_NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }}
NEXT_PUBLIC_R2_ACCOUNT_ID: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_R2_ACCOUNT_ID || secrets.DEV_NEXT_PUBLIC_R2_ACCOUNT_ID }}
NEXT_PUBLIC_R2_ACCESS_KEY_ID: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_R2_ACCESS_KEY_ID || secrets.DEV_NEXT_PUBLIC_R2_ACCESS_KEY_ID }}
NEXT_PUBLIC_R2_SECRET_ACCESS_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_R2_SECRET_ACCESS_KEY || secrets.DEV_NEXT_PUBLIC_R2_SECRET_ACCESS_KEY }}
NEXT_PUBLIC_MERKLE_TREES_BUCKET: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_MERKLE_TREES_BUCKET || secrets.DEV_NEXT_PUBLIC_MERKLE_TREES_BUCKET }}
NEXT_PUBLIC_IMAGE_UPLOAD_BUCKET: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_IMAGE_UPLOAD_BUCKET || secrets.DEV_NEXT_PUBLIC_IMAGE_UPLOAD_BUCKET }}
NEXT_PUBLIC_ETHERSCAN_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_ETHERSCAN_KEY || secrets.DEV_NEXT_PUBLIC_ETHERSCAN_KEY }}
NEXT_PUBLIC_ALCHEMY_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PROD_NEXT_PUBLIC_ALCHEMY_KEY || secrets.DEV_NEXT_PUBLIC_ALCHEMY_KEY }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ packages/react-app-revamp/public/sw.js
packages/react-app-revamp/public/workbox-*.js
packages/react-app-revamp/public/worker-*.js


# next.js
/.next/
/out/

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
**/node_modules
Expand Down Expand Up @@ -71,4 +73,4 @@ yarn-error.log*
*.stackdump

# doc directory
/doc
/doc
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,3 @@ Our smart contracts were audited by Certik in September 2023, the audit report i
- Tailwind CSS & Headless-UI
- ethers, wagmi, @wagmi/core, @rainbow-me/rainbowkit
- zustand
- [Vercel](https://vercel.com/?utm_source=jokedao&utm_campaign=oss).

jokerace front-end is hosted on [Vercel](https://vercel.com/?utm_source=jokedao&utm_campaign=oss).
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"private": true,
"scripts": {
"dev": "yarn workspace @scaffold-eth/react-app-revamp dev",
"build": "yarn workspace @scaffold-eth/react-app-revamp build",
"start": "yarn workspace @scaffold-eth/react-app-revamp start",
"format": "yarn workspace @scaffold-eth/forge forgeformat",
"test": "yarn workspace @scaffold-eth/forge forgetest",
"forgebuild": "yarn workspace @scaffold-eth/forge forgebuild",
Expand Down
3 changes: 0 additions & 3 deletions packages/react-app-revamp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,3 @@ You will also need to do two more things if the ABI is changed:
- Tailwind CSS & Headless-UI
- ethers, wagmi, @wagmi/core, @rainbow-me/rainbowkit
- zustand
- [Vercel](https://vercel.com/?utm_source=jokedao&utm_campaign=oss).

jokerace front-end is hosted on [Vercel](https://vercel.com/?utm_source=jokedao&utm_campaign=oss).
58 changes: 30 additions & 28 deletions packages/react-app-revamp/components/UI/Slider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Slider from "rc-slider";
import "rc-slider/assets/index.css";
import { FC, useEffect, useState } from "react";
import { useMediaQuery } from "react-responsive";
import { Tooltip } from "react-tooltip";

interface StepSliderProps {
Expand All @@ -23,6 +24,7 @@ const StepSlider: FC<StepSliderProps> = ({
onKeyDown,
}) => {
const [value, setValue] = useState(defaultValue);
const isMobile = useMediaQuery({ query: "(max-width: 768px)" });

useEffect(() => {
setValue(val);
Expand All @@ -33,44 +35,44 @@ const StepSlider: FC<StepSliderProps> = ({
onChange?.(value);
};

const trackStyle = {
backgroundColor: "#BB65FF",
height: 8,
};

const handleStyle = {
borderColor: "#D9D9D9",
height: 16,
width: 16,
backgroundColor: "#D9D9D9",
opacity: "1",
};

const railStyle = {
backgroundColor: "#6A6A6A",
height: 8,
};

const dotStyle = {
borderColor: "#D9D9D9",
height: 10,
width: 10,
backgroundColor: "#D9D9D9",
const styles = {
track: {
backgroundColor: "#BB65FF",
height: 8,
},
handle: {
borderColor: "#D9D9D9",
height: isMobile ? 32 : 16,
width: isMobile ? 32 : 16,
backgroundColor: "#D9D9D9",
opacity: 1,
cursor: "pointer",
marginTop: isMobile ? -12 : -4,
},
rail: {
backgroundColor: "#6A6A6A",
height: 8,
},
dot: {
borderColor: "#D9D9D9",
height: 10,
width: 10,
backgroundColor: "#D9D9D9",
},
};

return (
<div onKeyDown={onKeyDown} tabIndex={0}>
<div onKeyDown={onKeyDown} tabIndex={0} className="p-4 md:p-0">
<Slider
className="w-60"
min={min}
max={max}
value={value}
dotStyle={dotStyle}
step={step}
trackStyle={trackStyle}
handleStyle={handleStyle}
railStyle={railStyle}
onChange={handleSliderChange}
allowCross={false}
pushable={true}
styles={styles}
handleRender={renderProps => {
return (
<div {...renderProps.props} data-tooltip-id="voting-slider">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const UserProfileDisplay = ({
if (textualVersion) {
return (
<Link
className="text-[16px] font-bold"
className="text-[16px] font-bold text-neutral-11"
target="_blank"
rel="noopener noreferrer"
href={`${ROUTE_VIEW_USER.replace("[address]", ethereumAddress)}`}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-app-revamp/components/Voting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const VotingWidget: FC<VotingWidgetProps> = ({
{charge ? <ChargeInfo charge={charge} /> : null}
</div>
<div
className={`relative flex w-full md:w-80 h-16 items-center px-4 text-[16px] bg-transparent font-bold ${
className={`relative flex w-full md:w-80 h-16 items-center px-8 text-[16px] bg-transparent font-bold ${
isInvalid ? "text-negative-11" : "text-neutral-11"
} border-2 ${isFocused && !isInvalid ? "border-neutral-11" : isInvalid ? "border-negative-11" : "border-neutral-10"} rounded-[40px] transition-colors duration-300`}
>
Expand All @@ -173,7 +173,7 @@ const VotingWidget: FC<VotingWidgetProps> = ({
max={amountOfVotes}
onKeyDown={handleKeyDownInput}
onInput={handleInput}
className="w-full text-center text-[32px] bg-transparent outline-none placeholder-neutral-9"
className="w-full text-[32px] bg-transparent outline-none placeholder-primary-5"
/>
<span className="absolute right-4 text-neutral-9 text-[16px] font-bold">
vote{amount !== 1 ? "s" : ""}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,22 @@ const ContestTab = () => {
if (qualifiedToSubmit)
return (
<ButtonV3
colorClass="bg-gradient-vote rounded-[40px]"
colorClass="bg-gradient-purple rounded-[40px]"
textColorClass="text-[16px] md:text-[20px] font-bold text-true-black"
size={isMobile ? ButtonSize.FULL : ButtonSize.EXTRA_LARGE_LONG}
onClick={() => {
setIsSubmitProposalSuccess(false);
setIsSubmitProposalModalOpen(!isSubmitProposalModalOpen);
}}
>
submit a response
enter contest
</ButtonV3>
);
};

return (
<div className="animate-reveal">
<div className="mt-6">
<div className="mt-4 md:mt-6">
<div className="flex flex-col gap-6">
{isContestCanceled ? (
<div className="flex">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const CancelContest = () => {
return (
<>
<button disabled={isLoading} onClick={handleOpenModal}>
<TrashIcon className="w-6 h-6 text-negative-11 hover:text-negative-10 transition-colors duration-300 ease-in-out" />
<TrashIcon className="-ml-0 md:-ml-8 w-6 h-6 text-negative-11 hover:text-negative-10 transition-colors duration-300 ease-in-out" />
</button>

<CancelContestModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ import GradientText from "@components/UI/GradientText";
import { ContestStateEnum, useContestStateStore } from "@hooks/useContestState/store";
import { FC } from "react";
import CancelContest from "../CancelContest";
import { useMediaQuery } from "react-responsive";

interface ContestNameProps {
contestName: string;
address: string;
chainName: string;
}

const ContestName: FC<ContestNameProps> = ({ contestName, address, chainName }) => {
const ContestName: FC<ContestNameProps> = ({ contestName }) => {
const { contestState } = useContestStateStore(state => state);
const isContestCanceled = contestState === ContestStateEnum.Canceled;
const isMobile = useMediaQuery({ query: "(max-width: 768px)" });

return (
<div className="flex items-center justify-between">
<div className={`flex items-center justify-between md:justify-normal`}>
{!isMobile && <CancelContest />}
<GradientText text={contestName} isStrikethrough={isContestCanceled} />
<CancelContest />
{isMobile && <CancelContest />}
</div>
);
};
Expand Down
Loading