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

[New Homepage] 4-b: Add component UseCases #1416

Closed
5 tasks
mamadoudicko opened this issue Oct 17, 2023 · 2 comments
Closed
5 tasks

[New Homepage] 4-b: Add component UseCases #1416

mamadoudicko opened this issue Oct 17, 2023 · 2 comments
Assignees
Labels
area: cms Related to the CMS (content management system) or under the /cms directory area: frontend Related to frontend functionality or under the /frontend directory Stale

Comments

@mamadoudicko
Copy link
Contributor

mamadoudicko commented Oct 17, 2023

Epic:#1232

Functional:

  • Add UseCases components
  • Data are from local for now
  • Setup a structure to be able to fetch data from CMS

Strat tech:

  • In (home)/components, create a component UseCases which will contains some use cases for Quivr

Validation:

  • Activate onboarding on Growthbook
  • Go to homepage
  • Check there is use cases section
  • Check that some use cases are here
  • Check that it is iso design

Design

Screenshot 2023-10-17 at 12 42 29
Screenshot 2023-10-17 at 12 42 15

@mamadoudicko mamadoudicko self-assigned this Oct 17, 2023
@mamadoudicko mamadoudicko converted this from a draft issue Oct 17, 2023
@dosubot dosubot bot added area: frontend Related to frontend functionality or under the /frontend directory area: cms Related to the CMS (content management system) or under the /cms directory labels Oct 17, 2023
@dosubot
Copy link

dosubot bot commented Oct 17, 2023

🤖

Hello,

To add the UseCases component to the Quivr homepage, you can follow the steps below:

  1. Create a new file in the (home)/components directory named UseCases.tsx. This file will contain the UseCases component.

  2. In the UseCases.tsx file, you can start by creating a functional component that fetches data locally. Here's a basic structure to get you started:

import React from 'react';

const UseCases = () => {
  // Fetch data locally
  const data = [
    // Your local data here
  ];

  return (
    <div>
      {/* Render your use cases here using the local data */}
    </div>
  );
};

export default UseCases;
  1. Import the UseCases component in the HomePage component and add it to the render method. Here's how you can do it:
import UseCases from './components/UseCases'; // Import the UseCases component

// In the render method
<UseCases /> // Add the UseCases component

Please note that this is a basic implementation and you might need to adjust it according to your needs. For example, you might need to add state management to handle the fetched data, or add props to the UseCases component to make it more reusable.

Regarding the design, I'm sorry but I can't see the images you provided. Could you please describe the design in words or provide the design specifications?

For the validation, you can add tests to check if the use cases section is present on the homepage and if it contains some use cases. You can use a testing library like Jest or React Testing Library for this. Here's a basic example of how you can do it:

import { render, screen } from '@testing-library/react';
import HomePage from './HomePage';

test('renders use cases section', () => {
  render(<HomePage />);
  const useCasesSection = screen.getByTestId('use-cases-section');
  expect(useCasesSection).toBeInTheDocument();
});

test('renders some use cases', () => {
  render(<HomePage />);
  const useCases = screen.getAllByTestId('use-case');
  expect(useCases.length).toBeGreaterThan(0);
});

Please note that this is a basic example and you might need to adjust it according to your needs. For example, you might need to add more tests to check if the use cases match the provided design.

I hope this helps! If you have any other questions, feel free to ask.

Best,
Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Copy link
Contributor

Thanks for your contributions, we'll be closing this issue as it has gone stale. Feel free to reopen if you'd like to continue the discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cms Related to the CMS (content management system) or under the /cms directory area: frontend Related to frontend functionality or under the /frontend directory Stale
Projects
None yet
Development

No branches or pull requests

1 participant