Skip to content

Commit

Permalink
Revert "feat: Desabled vote buttom"
Browse files Browse the repository at this point in the history
This reverts commit cf223c2.
  • Loading branch information
josephpdf committed Nov 8, 2024
1 parent cf223c2 commit 730146c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 56 deletions.
1 change: 1 addition & 0 deletions frontend/gostarkme-web/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_APP_ROOT = "/"
16 changes: 1 addition & 15 deletions frontend/gostarkme-web/components/modules/Fund/FundVote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,7 @@ export const FundVote = ({ upVotes, upVotesNeeded, addr, setLoading, getDetails
<p className="text-center mx-2">{upVotes.toString()} / {upVotesNeeded.toString()} </p>
<p>&#127775;</p>
</div>
{wallet ? ( // Check if a wallet is connected by evaluating 'wallet' condition
<Button label="Vote" onClick={vote} /> // If the wallet is connected, render a button that allows voting
) : ( // If the wallet is not connected, render a disabled vote button with instructions
<div className="text-center">
<Button
label="Vote"
onClick={() => {}}
className="opacity-50 cursor-not-allowed"
disabled={true}
/>
<p className="text-sm text-gray-500 mt-2">
Connect your wallet to vote
</p>
</div>
)}
<Button label="Vote" onClick={vote}></Button>
</div>
);
};
4 changes: 1 addition & 3 deletions frontend/gostarkme-web/components/ui/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ interface ButtonProps {
onClick: () => void;
Icon?: React.ComponentType<any>;
className?: string;
disabled?: boolean; // Determines if the button is disabled (unclickable).
}

export const Button = ({ label, onClick, Icon, className, disabled }: ButtonProps) => { // Button component that displays either an icon or a label.
export const Button = ({ label, onClick, Icon, className }: ButtonProps) => {
return (
<button
onClick={onClick}
disabled={disabled} // Makes the button unclickable if 'disabled' is true.
className={`self-center bg-darkblue text-white py-2 px-6 md:py-3 md:px-10 rounded-md shadow-xl hover:bg-starkorange active:bg-darkblue ease-in-out duration-500 active:duration-0 shadow-gray-400
text-left text-1xl font-light leading-tight ${className}`}
>
Expand Down
20 changes: 10 additions & 10 deletions frontend/gostarkme-web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@

//** @type {import('next').NextConfig} */
//const nextConfig = {
/** @type {import('next').NextConfig} */
const nextConfig = {
/**
* Enable static exports for the App Router.
*
* @see https://nextjs.org/docs/app/building-your-application/deploying/static-exports
*/
//output: "export",
output: "export",

/**
* Set base path. This is the slug of your GitHub repository.
*
* @see https://nextjs.org/docs/app/api-reference/next-config-js/basePath
*/
//basePath: "/gostarkme",
basePath: "/gostarkme",

//assetPrefix: 'https://web3wagers.github.io/gostarkme',
assetPrefix: 'https://web3wagers.github.io/gostarkme',

/**
* Disable server-based image optimization. Next.js does not support
* dynamic features with static exports.
*
* @see https://nextjs.org/docs/app/api-reference/components/image#unoptimized
*/
//images: {
// unoptimized: true,
//},
//};
images: {
unoptimized: true,
},
};

//export default nextConfig;
export default nextConfig;
47 changes: 19 additions & 28 deletions frontend/gostarkme-web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@
dependencies:
glob "10.3.10"

"@next/swc-win32-x64-msvc@14.2.10":
"@next/swc-darwin-arm64@14.2.10":
version "14.2.10"
resolved "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.10.tgz"
integrity sha512-UjeVoRGKNL2zfbcQ6fscmgjBAS/inHBh63mjIlfPg/NG8Yn2ztqylXt5qilYb6hoHIwaU2ogHknHWWmahJjgZQ==
resolved "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.10.tgz"
integrity sha512-V3z10NV+cvMAfxQUMhKgfQnPbjw+Ew3cnr64b0lr8MDiBJs3eLnM6RpGC46nhfMZsiXgQngCJKWGTC/yDcgrDQ==

"@noble/curves@~1.3.0":
version "1.3.0"
Expand Down Expand Up @@ -451,6 +451,11 @@
resolved "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz"
integrity sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==

"@parcel/[email protected]":
version "2.4.1"
resolved "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz"
integrity sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==

"@parcel/watcher-wasm@^2.4.1":
version "2.4.1"
resolved "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.4.1.tgz"
Expand All @@ -460,11 +465,6 @@
micromatch "^4.0.5"
napi-wasm "^1.1.0"

"@parcel/[email protected]":
version "2.4.1"
resolved "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz"
integrity sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==

"@parcel/watcher@^2.4.1":
version "2.4.1"
resolved "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz"
Expand Down Expand Up @@ -719,7 +719,7 @@
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@^16.8.0 || ^17.0.0 || ^18.0.0", "@types/react@^16.9.0 || ^17.0.0 || ^18.0.0", "@types/react@^18.3.4", "@types/react@>=17.0.0":
"@types/react@*", "@types/react@^16.8.0 || ^17.0.0 || ^18.0.0", "@types/react@^16.9.0 || ^17.0.0 || ^18.0.0", "@types/react@^18.3.4":
version "18.3.4"
resolved "https://registry.npmjs.org/@types/react/-/react-18.3.4.tgz"
integrity sha512-J7W30FTdfCxDDjmfRM+/JqLHBIyl7xUIp9kwK637FGmY7+mkSFSe6L4jpZzhj5QMfLssSDP4/i75AKkrdC7/Jw==
Expand Down Expand Up @@ -2289,13 +2289,21 @@ get-starknet-core@^3.1.0:
dependencies:
"@module-federation/runtime" "^0.1.2"

get-starknet-core@^4.0.0-next.3:
get-starknet-core@^4.0.0, get-starknet-core@^4.0.0-next.3:
version "4.0.0"
resolved "https://registry.npmjs.org/get-starknet-core/-/get-starknet-core-4.0.0.tgz"
integrity sha512-6pLmidQZkC3wZsrHY99grQHoGpuuXqkbSP65F8ov1/JsEI8DDLkhsAuLCKFzNOK56cJp+f1bWWfTJ57e9r5eqQ==
dependencies:
"@starknet-io/types-js" "^0.7.7"

get-starknet@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/get-starknet/-/get-starknet-4.0.0.tgz"
integrity sha512-WnvpFJortTZ0CSRejgqvgBrncvRwQ5CSLuvcCrt+mwGH65z12utUD0QFAeO31ZLlNUxPnhzvdLgbKlYSbcwngQ==
dependencies:
bowser "^2.11.0"
get-starknet-core "^4.0.0"

get-stream@^8.0.1:
version "8.0.1"
resolved "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz"
Expand Down Expand Up @@ -2849,11 +2857,6 @@ jiti@^2.0.0:
resolved "https://registry.npmjs.org/jiti/-/jiti-2.1.0.tgz"
integrity sha512-Nftp80J8poC3u+93ZxpjstsgfQ5d0o5qyD6yStv32sgnWr74xRxBppEwsUoA/GIdrJpgGRkC1930YkLcAsFdSw==

jotai@^2.10.1:
version "2.10.1"
resolved "https://registry.npmjs.org/jotai/-/jotai-2.10.1.tgz"
integrity sha512-4FycO+BOTl2auLyF2Chvi6KTDqdsdDDtpaL/WHQMs8f3KS1E3loiUShQzAzFA/sMU5cJ0hz/RT1xum9YbG/zaA==

"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
Expand Down Expand Up @@ -3000,11 +3003,6 @@ lodash-es@^4.17.21:
resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==

lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz"
integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==

[email protected]:
version "4.5.0"
resolved "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz"
Expand Down Expand Up @@ -3676,7 +3674,7 @@ react-style-singleton@^2.2.1:
invariant "^2.2.4"
tslib "^2.0.0"

"react@^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", "react@^16.8.0 || ^17 || ^18", "react@^16.8.0 || ^17.0.0 || ^18.0.0", react@^18, react@^18.0.0, react@^18.2.0, react@^18.3.1, "react@>= 16.8.0 || 17.x.x || ^18.0.0-0", react@>=16.8.0, react@>=17.0.0, react@>=18, [email protected]:
"react@^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", react@^18, react@^18.0.0, react@^18.2.0, react@^18.3.1, "react@>= 16.8.0 || 17.x.x || ^18.0.0-0", react@>=16.8.0, react@>=18, [email protected]:
version "18.3.1"
resolved "https://registry.npmjs.org/react/-/react-18.3.1.tgz"
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
Expand Down Expand Up @@ -4520,13 +4518,6 @@ use-sidecar@^1.1.2:
detect-node-es "^1.1.0"
tslib "^2.0.0"

usehooks-ts@^3.1.0:
version "3.1.0"
resolved "https://registry.npmjs.org/usehooks-ts/-/usehooks-ts-3.1.0.tgz"
integrity sha512-bBIa7yUyPhE1BCc0GmR96VU/15l/9gP1Ch5mYdLcFBaFGQsdmXkvjV0TtOqW1yUd6VjIwDunm+flSciCQXujiw==
dependencies:
lodash.debounce "^4.0.8"

util-deprecate@^1.0.1, util-deprecate@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
Expand Down

0 comments on commit 730146c

Please sign in to comment.