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

chore(web): abstract-sortition-module-hooks-and-hide-in-university #1723

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

Harman-singh-waraich
Copy link
Contributor

@Harman-singh-waraich Harman-singh-waraich commented Oct 17, 2024

PR-Codex overview

This PR focuses on refactoring the usage of the useSortitionModulePhase hook, updating environment configurations, and enhancing the functionality of various components to accommodate the new devnet-university build. It also introduces new hooks for reading from the SortitionModule.

Detailed summary

  • Deleted web/src/hooks/useSortitionModulePhase.ts.
  • Renamed useSortitionModulePhase hook to use the new useSortitionModule.
  • Added new environment configuration for devnet-university.
  • Updated various components to conditionally render based on isKlerosUniversity.
  • Introduced new hooks for reading multiple parameters from SortitionModule.
  • Modified button components to handle new functionality and state management.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added a new build script for the "devnet-university" environment, enhancing build process options.
    • Conditional rendering of the StakeMaintenanceButtons component based on university status.
  • Bug Fixes

    • Updated hooks in various components to improve functionality related to delayed stakes and phase management.
  • Refactor

    • Consolidated and generalized hooks for sortition module interactions, streamlining code and enhancing maintainability.
  • Chores

    • Updated .gitignore to exclude a specific development environment configuration file.

Copy link
Contributor

coderabbitai bot commented Oct 17, 2024

Walkthrough

The changes in this pull request involve updates to several files in a web application. The .gitignore file now ignores the .env.devnet-university file. A new script for building the development environment has been added to package.json. The import paths for a hook have been modified in two component files. A custom hook has been deleted, and several new hooks have been introduced in a different file. Additionally, two button components have had their hooks generalized, and a conditional rendering logic has been added to the TopSearch component.

Changes

File Path Change Summary
web/.gitignore Added entry: .env.devnet-university
web/package.json Added script: "build-devnet-university": "scripts/runEnv.sh devnet-university 'yarn generate && vite build'"
web/src/components/Phase.tsx, Updated import: useSortitionModulePhase from "hooks/useSortitionModulePhase" to "hooks/useSortitionModule"
web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx Updated import: useSortitionModulePhase from "hooks/useSortitionModulePhase" to "hooks/useSortitionModule"; added import: Field from @kleros/ui-components-library; state variable added: const [drawJuror, setDrawJuror] = useState("")
web/src/hooks/useSortitionModule.ts, Deleted hook: useSortitionModulePhase in useSortitionModulePhase.ts; added hooks: useSortitionModulePhase, useReadSortitionModuleDelayedStakeReadIndex, useReadSortitionModuleDelayedStakeWriteIndex, useReadSortitionModuleLastPhaseChange, useReadSortitionModuleMaxDrawingTime, useReadSortitionModuleMinStakingTime
web/src/hooks/useSortitionModulePhase.ts Deleted file containing useSortitionModulePhase hook
web/src/pages/Courts/StakeMaintenanceButton/ExecuteDelayedStakeButton.tsx, Replaced specific hooks with general hooks: useSimulateSortitionModule, useWriteSortitionModule
web/src/pages/Courts/StakeMaintenanceButton/PassPhaseButton.tsx Replaced specific hooks with general hooks: useSimulateSortitionModule, useWriteSortitionModule
web/src/pages/Courts/TopSearch.tsx Added import: isKlerosUniversity, defined constant isUniversity, modified rendering logic for StakeMaintenanceButtons

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant Hooks
    participant Contract

    User->>App: Interacts with UI
    App->>Hooks: Calls useSortitionModule hooks
    Hooks->>Contract: Fetches data from smart contract
    Contract-->>Hooks: Returns data
    Hooks-->>App: Provides data to UI
    App-->>User: Updates UI
Loading

🐇 "In the code where changes are made,
A new path for hooks has been laid.
With scripts for dev now in sight,
Ignored files bring peace, oh what a delight!
Conditional renders add some flair,
In our rabbit hole, we code with care!" 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for kleros-v2-testnet-devtools ready!

Name Link
🔨 Latest commit 6ee1d71
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet-devtools/deploys/6712137397e15300085373f2
😎 Deploy Preview https://deploy-preview-1723--kleros-v2-testnet-devtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 6ee1d71
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet/deploys/671213739de933000805d992
😎 Deploy Preview https://deploy-preview-1723--kleros-v2-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for kleros-v2-university ready!

Name Link
🔨 Latest commit 6ee1d71
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-university/deploys/6712137335a5df0008a62bd7
😎 Deploy Preview https://deploy-preview-1723--kleros-v2-university.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 6ee1d71
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-neo/deploys/67121373cfa5470008e62c66
😎 Deploy Preview https://deploy-preview-1723--kleros-v2-neo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Outside diff range and nitpick comments (4)
web/src/hooks/useSortitionModule.ts (1)

1-54: Consider performance optimizations.

While the use of REFETCH_INTERVAL ensures data freshness, it might lead to performance issues in certain scenarios.

Consider the following optimizations:

  1. Implement caching: Use a caching mechanism (e.g., React Query's caching capabilities) to store and share results across components, reducing redundant network requests.

  2. Dynamic intervals: Instead of a fixed REFETCH_INTERVAL, consider implementing dynamic intervals based on the application's state or user activity.

  3. Batch requests: If multiple hooks are often used together, consider creating a combined hook that fetches all required data in a single request.

  4. Lazy loading: Implement lazy loading for hooks that aren't immediately necessary, reducing the initial load time.

Example of a combined hook with caching:

import { useQueries } from 'react-query';

export const useSortitionModuleData = () => {
  const results = useQueries([
    { queryKey: ['phase'], queryFn: () => useReadSortitionModule({ functionName: "phase" }) },
    { queryKey: ['delayedStakeReadIndex'], queryFn: () => useReadSortitionModule({ functionName: "delayedStakeReadIndex" }) },
    // ... other queries
  ]);

  return {
    phase: results[0].data,
    delayedStakeReadIndex: results[1].data,
    // ... other data
    isLoading: results.some(result => result.isLoading),
    error: results.find(result => result.error)?.error,
  };
};

This approach would reduce the number of separate hook calls and leverage React Query's built-in caching mechanisms.

web/src/pages/Courts/StakeMaintenanceButton/ExecuteDelayedStakeButton.tsx (1)

Line range hint 1-85: Overall changes improve flexibility while maintaining functionality.

The refactoring of this component to use more generalized hooks (useSimulateSortitionModule and useWriteSortitionModule) improves the flexibility of the code without changing its core functionality. The logic for determining whether the button can execute and the handling of loading and disabled states remain intact.

These changes align well with the PR objectives of abstracting sortition module hooks. However, to ensure the refactoring hasn't introduced any regressions, consider adding or updating unit tests for this component.

Would you like assistance in generating unit tests for the ExecuteDelayedStakeButton component?

web/src/pages/Courts/StakeMaintenanceButton/PassPhaseButton.tsx (1)

Line range hint 79-92: Approve component logic changes with a minor suggestion

The component logic has been successfully adapted to work with the new, more generic hooks while maintaining the original functionality. This is a good example of refactoring that improves code structure without changing behavior.

Minor suggestion for improvement:
Consider adding more specific error handling or logging when the required objects are undefined. For example:

const handleClick = () => {
  if (!passPhaseConfig) {
    console.error('passPhaseConfig is undefined');
    return;
  }
  if (!publicClient) {
    console.error('publicClient is undefined');
    return;
  }
  if (!passPhase) {
    console.error('passPhase function is undefined');
    return;
  }

  setIsSending(true);

  wrapWithToast(async () => await passPhase(passPhaseConfig.request), publicClient).finally(() => {
    setIsSending(false);
    setIsOpen(false);
  });
};

This would provide more clarity on which specific condition caused the function to return early, aiding in debugging if issues arise.

web/package.json (1)

38-38: LGTM! Consider updating the default build script.

The new build-devnet-university script is correctly implemented and follows the existing pattern for build scripts. It's appropriately placed in the scripts section.

Consider updating the default build script to include the new environment:

-  "build": "yarn build-devnet",
+  "build": "yarn build-devnet-university",

This change would make the new "devnet-university" environment the default build target, which might be desirable if it's intended to be the primary development environment moving forward.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between fd8766e and 1d3969e.

📒 Files selected for processing (9)
  • web/.gitignore (1 hunks)
  • web/package.json (1 hunks)
  • web/src/components/Phase.tsx (1 hunks)
  • web/src/hooks/useSortitionModule.ts (1 hunks)
  • web/src/hooks/useSortitionModulePhase.ts (0 hunks)
  • web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx (1 hunks)
  • web/src/pages/Courts/StakeMaintenanceButton/ExecuteDelayedStakeButton.tsx (2 hunks)
  • web/src/pages/Courts/StakeMaintenanceButton/PassPhaseButton.tsx (2 hunks)
  • web/src/pages/Courts/TopSearch.tsx (3 hunks)
💤 Files with no reviewable changes (1)
  • web/src/hooks/useSortitionModulePhase.ts
✅ Files skipped from review due to trivial changes (1)
  • web/.gitignore
🧰 Additional context used
🔇 Additional comments (14)
web/src/components/Phase.tsx (1)

4-4: LGTM! Verify consistency of import changes across the codebase.

The import statement has been updated to reflect a change in the hook's file location or naming convention. This change appears to be part of a larger refactoring effort.

Let's verify if this change has been consistently applied across the codebase:

This script will help us ensure that all relevant files have been updated consistently.

web/src/pages/Courts/TopSearch.tsx (2)

17-17: LGTM: New import statement is correctly placed and follows conventions.

The import of isKlerosUniversity from "src/consts" is well-placed and follows proper naming conventions.


37-37: LGTM: Conditional rendering implemented correctly.

The new constant isUniversity and the conditional rendering of StakeMaintenanceButtons are implemented correctly. This change aligns with the PR objective of hiding certain elements in the university context.

To ensure consistency, let's verify if similar changes have been made in other components where StakeMaintenanceButtons is used:

Please review the results to ensure that this change is consistently applied across the application where necessary.

Also applies to: 49-49

✅ Verification successful

Verified: Conditional rendering is correctly implemented and consistent.

The StakeMaintenanceButtons component is only rendered in TopSearch.tsx, where it is properly conditionally rendered based on the isUniversity flag. No other instances require similar conditional logic.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other usages of StakeMaintenanceButtons and verify if they have similar conditional rendering.

# Search for other files using StakeMaintenanceButtons
echo "Files using StakeMaintenanceButtons:"
rg --type typescript --type tsx "StakeMaintenanceButtons"

# Search for other occurrences of isKlerosUniversity
echo "\nOther occurrences of isKlerosUniversity:"
rg --type typescript --type tsx "isKlerosUniversity"

Length of output: 358


Script:

#!/bin/bash
# Description: Check for other usages of StakeMaintenanceButtons and verify if they have similar conditional rendering.

# Search for other files using StakeMaintenanceButtons
echo "Files using StakeMaintenanceButtons:"
rg --type ts --type tsx "StakeMaintenanceButtons"

# Search for other occurrences of isKlerosUniversity
echo "\nOther occurrences of isKlerosUniversity:"
rg --type ts --type tsx "isKlerosUniversity"

Length of output: 328


Script:

#!/bin/bash
# Description: Check for other usages of StakeMaintenanceButtons and verify if they have similar conditional rendering.

# Search for other files using StakeMaintenanceButtons
echo "Files using StakeMaintenanceButtons:"
rg --glob '*.ts' --glob '*.tsx' "StakeMaintenanceButtons"

# Search for other occurrences of isKlerosUniversity
echo "\nOther occurrences of isKlerosUniversity:"
rg --glob '*.ts' --glob '*.tsx' "isKlerosUniversity"

Length of output: 1215

web/src/hooks/useSortitionModule.ts (2)

1-3: LGTM: Imports look good.

The imports are appropriate for the file's purpose. The REFETCH_INTERVAL constant and useReadSortitionModule hook are correctly imported from their respective locations.


1-54: Approve overall structure and naming conventions.

The overall structure of the file and the naming conventions used are well-implemented:

  1. The file name useSortitionModule.ts accurately reflects its contents.
  2. All hooks follow the React convention of using the use prefix.
  3. Hooks are exported individually, which allows for easy tree-shaking and selective imports.

These practices contribute to good code organization and maintainability.

web/src/pages/Courts/StakeMaintenanceButton/ExecuteDelayedStakeButton.tsx (2)

56-56: LGTM! Verify contract write execution.

The change to use useWriteSortitionModule is consistent with the move towards more generalized hooks. This should provide more flexibility in the long run.

To ensure that the correct function is called when executing the contract write, please review the implementation of executeDelayedStake in the component's handleClick function. You can use the following script to locate and examine the relevant code:

#!/bin/bash
# Description: Locate and examine the handleClick function implementation

echo "Locating handleClick function:"
rg --type typescript -A 15 'const handleClick = \(\) => \{' web/src/pages/Courts/StakeMaintenanceButton/ExecuteDelayedStakeButton.tsx

8-13: LGTM! Verify new hook implementations.

The import statements have been updated to use more generalized hooks, which aligns with the PR objectives. This change suggests a positive move towards a more flexible and maintainable codebase.

To ensure the new hooks are correctly implemented, please run the following script:

web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx (3)

Line range hint 36-36: LGTM. Hook usage remains consistent.

The usage of useSortitionModulePhase in the component remains unchanged, which is correct given that only the import path was modified. This consistency suggests that the refactoring was properly implemented.


Line range hint 1-93: Summary: Import path updated as part of refactoring

The only change in this file is the update to the import path for the useSortitionModulePhase hook. The rest of the component, including its logic and structure, remains unchanged. This change appears to be part of a larger refactoring effort to better organize hooks.

To ensure the refactoring was applied consistently across the project, consider running a project-wide search for any remaining imports from the old path:

rg -t typescript "from ['\"]hooks/useSortitionModulePhase['\"]"

This will help identify any files that might have been missed during the refactoring process.


9-9: LGTM. Verify the new import path.

The import statement has been updated to reflect a change in the hook's location. This change looks good, as it's likely part of a larger refactoring effort to organize hooks better.

To ensure the refactoring was done correctly, please run the following script to verify the new import path and the hook's availability:

Ensure that Test 1 and Test 2 return results, while Test 3 should not return any results if the refactoring was done consistently across the project.

✅ Verification successful

Verified the import path and hook availability successfully.

All tests passed:

  • The new useSortitionModule.ts file exists.
  • useSortitionModulePhase is correctly exported from the new module.
  • No imports from the old path remain.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import path and hook availability

# Test 1: Check if the new file exists
fd -t f useSortitionModule.ts$ src/hooks

# Test 2: Verify that useSortitionModulePhase is exported from the new file
rg -t typescript "export.*useSortitionModulePhase" src/hooks/useSortitionModule.ts

# Test 3: Check for any remaining imports from the old path
rg -t typescript "from ['\"]hooks/useSortitionModulePhase['\"]"

Length of output: 366


Script:

#!/bin/bash
# Description: Verify the new import path and hook availability after addressing previous errors

# Test 1: Check if the new file exists by searching the entire repository
fd -t f 'useSortitionModule.ts$'

# Test 2: Verify that useSortitionModulePhase is exported from the new file
rg 'export\s+.*useSortitionModulePhase' $(fd -t f 'useSortitionModule.ts$')

# Test 3: Check for any remaining imports from the old path across all TypeScript and TSX files
rg "from ['\"]hooks/useSortitionModulePhase['\"]" --type-add 'tsx:*.tsx' --type-add 'ts:*.ts' -t ts -t tsx

Length of output: 344

web/src/pages/Courts/StakeMaintenanceButton/PassPhaseButton.tsx (4)

10-18: Approve import changes: Improved hook abstraction

The changes to the imports reflect a positive refactoring of the sortition module hooks. By replacing specific hooks (useSimulateSortitionModulePassPhase, useWriteSortitionModulePassPhase) with more generic ones (useSimulateSortitionModule, useWriteSortitionModule), the code becomes more flexible and maintainable. This abstraction allows for potential reuse across different phase-related operations.


76-76: Approve write hook usage change

The switch to useWriteSortitionModule is consistent with the earlier changes and improves the abstraction of the sortition module functionality. Renaming the destructured function to passPhase maintains clear semantics within this component's context.


Line range hint 1-94: Summary of PassPhaseButton.tsx changes

The changes to this file represent a positive step towards better code abstraction and maintainability:

  1. The sortition module hooks have been generalized, allowing for more flexible usage.
  2. The component logic has been successfully adapted to these new hooks with minimal changes.
  3. The overall functionality of the component remains intact.

To further improve the code:

  1. Address the TypeScript issues with the useSimulateSortitionModule hook.
  2. Consider implementing more specific error handling in the handleClick function.

These changes demonstrate good refactoring practices, improving the code structure while preserving behavior.


67-73: ⚠️ Potential issue

Address type issues in useSimulateSortitionModule usage

The switch to useSimulateSortitionModule with a functionName parameter is a good abstraction. However, the presence of @ts-ignore and eslint disable comments indicates potential type issues.

Consider the following:

  1. Update the type definitions for useSimulateSortitionModule to properly handle the functionName parameter.
  2. If the type definitions are correct, ensure that the functionName parameter is being passed correctly.

Resolving these type issues will improve code reliability and maintainability.

To verify the correct usage of useSimulateSortitionModule, please run the following script:

Copy link

codeclimate bot commented Oct 18, 2024

Code Climate has analyzed commit 6ee1d71 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx (1)

108-110: Consider adding validation feedback for juror address input

Providing real-time validation feedback for the juror address input would enhance user experience. Users should be immediately informed if the entered address is invalid.

You might consider using the Field component's validation features or adding helper text to guide the user.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1d3969e and 6ee1d71.

📒 Files selected for processing (1)
  • web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx (5 hunks)
🧰 Additional context used
🔇 Additional comments (9)
web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx (9)

6-6: Importing Field component is appropriate

The Field component is imported to enable rendering the juror address input field in university mode.


9-9: Updated import path for useSortitionModulePhase

The import path for useSortitionModulePhase has been correctly updated to reflect the new module structure after refactoring.


21-22: Imported isKlerosUniversity and isAddress functions

These imports are necessary for determining if the environment is Kleros University and for validating the juror address input.


34-35: Initialized isUniversity flag

The isUniversity constant appropriately checks if the current environment is Kleros University, enabling conditional logic based on this flag.


40-41: Added new state variables isSending and drawJuror

Introducing isSending to track the loading state and drawJuror to store the juror address are necessary for the new functionality in university mode.


46-51: Updated canDraw logic to accommodate university mode

The canDraw computation now allows drawing in any phase when in university mode, which aligns with the intended behavior for Kleros University.


65-70: Modified enabled condition to validate drawJuror in university mode

The enabled condition now correctly validates the juror address using isAddress(drawJuror) when in university mode, ensuring that only valid addresses are processed.


81-88: Updated isDisabled logic to handle juror address validation

The isDisabled computation now includes a check for a valid drawJuror address in university mode, which prevents users from initiating actions with invalid addresses.


102-107: Adjusted conditional rendering for phase message in university mode

The message prompting to pass the phase is now hidden when in university mode, as it's not relevant in that context.

@jaybuidl jaybuidl added this pull request to the merge queue Oct 18, 2024
@jaybuidl jaybuidl removed this pull request from the merge queue due to a manual request Oct 18, 2024
@jaybuidl jaybuidl merged commit 4f2e88f into dev Oct 18, 2024
27 of 28 checks passed
@jaybuidl jaybuidl deleted the chore/handle-stake-maintenance-buttons-in-university branch October 18, 2024 11:11
@coderabbitai coderabbitai bot mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants