-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: group creation form theme #110
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,7 @@ | |
const renderAuthors = () => { | ||
if (Array.isArray(formData.authors)) { | ||
return formData.authors.map((author, index) => ( | ||
<div | ||
key={index} | ||
className="dark:bg-[#2A2A38] bg-[#FFFFFF] p-4 rounded-lg flex items-center" | ||
> | ||
<div key={index} className="bg-base-300 p-4 rounded-lg flex items-center"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Test coverage exists but needs enhancement for renderAuthors edge cases The Success component already has test coverage in
Add the following test cases to
🔗 Analysis chainAdd test coverage for author rendering logic The renderAuthors function handles both array and single author cases, but lacks test coverage. This is critical functionality that should be tested to prevent regressions. Would you like me to help generate test cases for the author rendering scenarios? Also applies to: 27-27 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for existing tests
rg -l "renderAuthors|Success.test" --type ts --type tsx
Length of output: 85 Script: #!/bin/bash
# Check for existing tests with correct file extensions
rg -l "renderAuthors|Success.test" -t ts -t jsx -t tsx
# Find all test files in the components directory
fd ".*\.(test|spec)\.(ts|tsx|jsx)$" components/
# Look for Success component test files specifically
fd "Success\.(test|spec)\.(ts|tsx|jsx)$" components/
Length of output: 2510 Script: #!/bin/bash
# Check the content of the existing Success test file
cat components/groups/forms/groups/__tests__/Success.test.tsx
# Look for renderAuthors function implementation
ast-grep --pattern 'function renderAuthors' -l ts,tsx
Length of output: 1828 Script: #!/bin/bash
# Look for renderAuthors function with correct ast-grep syntax
ast-grep --pattern 'const renderAuthors = $_'
# Check the Success component implementation
cat components/groups/forms/groups/Success.tsx
Length of output: 6657 🧰 Tools🪛 GitHub Check: codecov/patch[warning] 17-17: components/groups/forms/groups/Success.tsx#L17 |
||
{author.trim().startsWith('manifest') ? ( | ||
<TruncatedAddressWithCopy address={author.trim()} slice={14} /> | ||
) : ( | ||
|
@@ -27,7 +24,7 @@ | |
)); | ||
} else { | ||
return ( | ||
<div className="dark:bg-[#2A2A38] bg-[#FFFFFF] p-4 rounded-lg flex items-center"> | ||
<div className="bg-base-300 p-4 rounded-lg flex items-center"> | ||
{formData.authors.trim().startsWith('manifest') ? ( | ||
<TruncatedAddressWithCopy address={formData.authors.trim()} slice={14} /> | ||
) : ( | ||
|
@@ -50,11 +47,11 @@ | |
|
||
<div className="space-y-6"> | ||
<p className="text-lg mb-2">Your transaction was successfully signed and broadcasted.</p> | ||
<p className="text-md text-gray-400 mb-6"> | ||
<p className="text-md text-gray-500 dark:text-gray-400 mb-6"> | ||
You may now interact with your group by adding members, submitting or voting on | ||
proposals, and changing group parameters. | ||
</p> | ||
<div className="text-md text-gray-400 mb-6 flex-col flex gap-2 "> | ||
<div className="text-md text-gray-500 dark:text-gray-400 mb-6 flex-col flex gap-2 "> | ||
<span>Remember to fund your group by sending tokens to the policy address </span> | ||
<TruncatedAddressWithCopy address={recentGroup?.policies[0].address} slice={24} /> | ||
</div> | ||
|
@@ -63,12 +60,14 @@ | |
<div> | ||
<h2 className="text-xl font-semibold mb-4">Group Information</h2> | ||
<div className="grid grid-cols-2 gap-4"> | ||
<div className="dark:bg-[#2A2A38] bg-[#FFFFFF] p-4 rounded-lg"> | ||
<label className="text-sm text-gray-400">Voting period</label> | ||
<div className="bg-base-300 p-4 rounded-lg"> | ||
<label className="text-sm text-gray-500 dark:text-gray-400">Voting period</label> | ||
<div>{secondsToHumanReadable(Number(formData.votingPeriod.seconds))}</div> | ||
</div> | ||
<div className="dark:bg-[#2A2A38] bg-[#FFFFFF] p-4 rounded-lg"> | ||
<label className="text-sm text-gray-400">Qualified Majority</label> | ||
<div className="bg-base-300 p-4 rounded-lg"> | ||
<label className="text-sm text-gray-500 dark:text-gray-400"> | ||
Qualified Majority | ||
</label> | ||
<div> | ||
{formData.votingThreshold} / {formData.members.length} | ||
</div> | ||
|
@@ -87,10 +86,10 @@ | |
<h2 className="text-xl font-semibold mb-4">Members</h2> | ||
<div className="grid grid-cols-3 gap-4"> | ||
{formData.members.map((member, index) => ( | ||
<div key={index} className="dark:bg-[#2A2A38] bg-[#FFFFFF] p-4 rounded-lg"> | ||
<div className="text-sm text-gray-400">Address</div> | ||
<div key={index} className="bg-base-300 p-4 rounded-lg"> | ||
<div className="text-sm text-gray-500 dark:text-gray-400">Address</div> | ||
<TruncatedAddressWithCopy address={member.address} slice={14} /> | ||
<div className="text-sm text-gray-400 mt-2">Name</div> | ||
<div className="text-sm text-gray-500 dark:text-gray-400 mt-2">Name</div> | ||
<div>{member.name}</div> | ||
</div> | ||
))} | ||
|
@@ -100,7 +99,9 @@ | |
</div> | ||
<div className="flex gap-6 mt-6 mx-auto w-full"> | ||
<Link href="/groups" className="w-[calc(50%-12px)]"> | ||
<button className="btn btn-neutral w-full text-white">Back to Groups Page</button> | ||
<button className="btn btn-neutral text-black dark:text-white w-full"> | ||
Back to Groups Page | ||
</button> | ||
</Link> | ||
<Link | ||
href={`/groups${recentGroup?.policies[0]?.address ? `?policyAddress=${recentGroup.policies[0].address}` : ''}`} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Replace hardcoded background color with Tailwind class
The background color
#2A2A38
is hardcoded while other similar elements use thebg-base-300
class. Consider using Tailwind classes for consistency.📝 Committable suggestion