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

feat: sexier landing pages #184

Merged
merged 2 commits into from
Jan 8, 2025
Merged

feat: sexier landing pages #184

merged 2 commits into from
Jan 8, 2025

Conversation

chalabi2
Copy link
Collaborator

@chalabi2 chalabi2 commented Jan 8, 2025

fixes #178

Summary by CodeRabbit

  • New Features

    • Enhanced user experience for empty states in Bank and Factory pages
    • Added informative components when no assets or activities are found
    • Conditional rendering of search inputs and lists based on data availability
  • User Experience Improvements

    • Implemented user-friendly messages for empty asset and activity scenarios
    • Added navigation options when no assets are present

Copy link
Contributor

coderabbitai bot commented Jan 8, 2025

Walkthrough

The pull request introduces enhanced user experience for the Bank and Factory pages by implementing conditional rendering when no assets or activities are found. Two new components, NoAssetsFound, are added to pages/bank.tsx and pages/factory/index.tsx to provide informative and visually appealing screens when users have no tokens or transaction history. The changes include adding Link from next/link and modifying the rendering logic to display these new components based on the presence of data.

Changes

File Change Summary
pages/bank.tsx - Added Link import
- Conditionally render search input based on combined balances
- Added NoAssetsFound component for empty asset state
- Added NoActivityFound component for empty transaction history
pages/factory/index.tsx - Added Link import
- Conditionally render token list based on combinedData
- Added NoAssetsFound component for empty token state

Assessment against linked issues

Objective Addressed Explanation
Sexier landing screen [#178]

Possibly related PRs

Poem

🐰 In the realm of tokens sparse and lean,
A rabbit's code brings screens serene
No assets? No worry, no need to fret
With NoAssetsFound, we'll make it a set! 🚀
A digital warren of empty grace


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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 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

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.40%. Comparing base (12555f6) to head (8dc6bcf).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
- Coverage   55.04%   54.40%   -0.64%     
==========================================
  Files         153      153              
  Lines       15515    15787     +272     
==========================================
+ Hits         8540     8589      +49     
- Misses       6975     7198     +223     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fmorency fmorency merged commit 7101c5a into main Jan 8, 2025
6 checks passed
@fmorency fmorency deleted the chalabi/sexy-landing branch January 8, 2025 15:16
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

🧹 Nitpick comments (3)
pages/bank.tsx (1)

237-255: Consider adding a call-to-action button.

For consistency with the factory page's empty state, consider adding a CTA button that guides users on how to acquire assets.

 function NoAssetsFound() {
   return (
     <section className="transition-opacity duration-300 h-auto mt-12 ease-in-out animate-fadeIn w-full flex items-center justify-center">
       <div className="grid max-w-4xl bg-base-300 p-12 rounded-md w-full mx-auto gap-8 lg:grid-cols-12">
         <div className="mr-auto place-self-center lg:col-span-7">
           <h1 className="max-w-2xl mb-4 text-2xl font-extrabold tracking-tight leading-none md:text-3xl xl:text-4xl dark:text-white text-black">
             No Assets Found
           </h1>
           <p className="max-w-2xl mb-6 font-light text-gray-500 lg:mb-8 md:text-lg lg:text-xl">
             You do not have any assets yet.
           </p>
+          <Link href="/factory" passHref>
+            <button className="btn btn-gradient">Create New Token</button>
+          </Link>
         </div>
         <div className="hidden lg:mt-0 lg:ml-24 lg:col-span-5 lg:flex">
           <BankIcon className="h-60 w-60 text-primary" />
         </div>
       </div>
     </section>
   );
 }
pages/factory/index.tsx (2)

121-164: Consider enhancing the search experience.

When search results are empty (but combinedData is not), consider showing a "No matching tokens" message instead of an empty list.

 <DenomList
   denoms={combinedData}
   isLoading={isLoading}
   refetchDenoms={refetchData}
   pageSize={denomListPageSize}
   address={address ?? ''}
   admin={address ?? ''}
   searchTerm={searchTerm}
+  emptySearchMessage="No matching tokens found"
 />

175-175: Maintain consistent height across empty states.

The height of empty states differs between pages (h-[80vh] vs h-auto). Consider using a consistent height for a uniform experience.

Choose one approach and apply it consistently:

# In pages/bank.tsx
-    <section className="transition-opacity duration-300 h-auto mt-12 ease-in-out animate-fadeIn w-full flex items-center justify-center">
+    <section className="transition-opacity duration-300 h-[80vh] ease-in-out animate-fadeIn w-full flex items-center justify-center">

# Or in pages/factory/index.tsx
-    <section className="transition-opacity duration-300 h-[80vh] ease-in-out animate-fadeIn w-full flex items-center justify-center">
+    <section className="transition-opacity duration-300 h-auto mt-12 ease-in-out animate-fadeIn w-full flex items-center justify-center">

Also applies to: 239-239

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12555f6 and 8dc6bcf.

📒 Files selected for processing (2)
  • pages/bank.tsx (4 hunks)
  • pages/factory/index.tsx (2 hunks)
🔇 Additional comments (3)
pages/bank.tsx (3)

153-164: LGTM! Well-implemented conditional search input.

The search input is properly hidden when there are no assets, preventing user confusion, and includes accessibility features.


195-208: LGTM! Clean conditional rendering of assets.

The implementation elegantly handles both empty and populated states, with proper prop passing to the TokenList component.


257-276: LGTM! Clear and helpful empty state message.

The component provides excellent user guidance by explaining how to generate activity.

Comment on lines +184 to +186
<Link href="/groups/create" passHref>
<button className="btn btn-gradient">Create New Token</button>
</Link>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix incorrect navigation link.

The "Create New Token" button links to "/groups/create" instead of the token creation page.

-          <Link href="/groups/create" passHref>
+          <Link href="/factory/create" passHref>
             <button className="btn btn-gradient">Create New Token</button>
           </Link>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link href="/groups/create" passHref>
<button className="btn btn-gradient">Create New Token</button>
</Link>
<Link href="/factory/create" passHref>
<button className="btn btn-gradient">Create New Token</button>
</Link>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sexier landing screen on bank and factory pages
2 participants