alexdorowork / Sparesteuern

0 stars 0 forks source link

Create /src/components/Features.tsx #14

Closed jacob-ai-bot[bot] closed 3 months ago

jacob-ai-bot[bot] commented 3 months ago

Summary:

A new design has been added to Figma for the file /src/components/Features.tsx. The design was converted into JSX. Here is what was provided:

<div className="w-full max-w-7xl mx-auto">
  <div className="flex flex-col items-center">
    <div className="w-full h-0.5 bg-[#0b2339] mt-0"></div>
    <h1 className="text-4xl font-bold text-center text-[#0b2339] mt-12">Ziele der kostenfreien Analyse</h1>
    <div className="flex flex-wrap justify-center mt-12">
      <div className="w-72 h-56 bg-[#deefff] rounded-lg m-4 p-4 flex flex-col items-center">
        <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
          {/* ChartLineUp Icon */}
          <div className="w-8 h-8">
            {/* Replace with actual ChartLineUp SVG */}
            <div className="w-6 h-5 bg-[#2f6ba2]"></div>
          </div>
        </div>
        <p className="text-xl text-center text-[#2f6ba2] mt-4">Unentdecktes Einsparungspotential entdecken</p>
      </div>
      <div className="w-72 h-56 bg-[#deefff] rounded-lg m-4 p-4 flex flex-col items-center">
        <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
          {/* PiggyBank Icon */}
          <div className="w-8 h-8">
            {/* Replace with actual PiggyBank SVG */}
            <div className="w-8 h-6 bg-[#2f6ba2]"></div>
          </div>
        </div>
        <p className="text-xl text-center text-[#2f6ba2] mt-4">Steuerschonender Vermögensaufbau</p>
      </div>
      <div className="w-72 h-56 bg-[#deefff] rounded-lg m-4 p-4 flex flex-col items-center">
        <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
          {/* Bank Icon */}
          <div className="w-8 h-8">
            {/* Replace with actual Bank SVG */}
            <div className="w-7 h-6 bg-[#2f6ba2]"></div>
          </div>
        </div>
        <p className="text-xl text-center text-[#2f6ba2] mt-4">Rechtssichere Lösungen</p>
      </div>
      <div className="w-72 h-56 bg-[#deefff] rounded-lg m-4 p-4 flex flex-col items-center">
        <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
          {/* ShieldCheck Icon */}
          <div className="w-8 h-8">
            {/* Replace with actual ShieldCheck SVG */}
            <div className="w-6 h-6 bg-[#2f6ba2]"></div>
          </div>
        </div>
        <p className="text-xl text-center text-[#2f6ba2] mt-4">Schutz des Vermögens vor dem Zugriff durch Dritte</p>
      </div>
    </div>
    <button className="w-3/4 max-w-2xl h-14 bg-[#2f6ba2] rounded-lg mt-8 text-white text-lg font-bold tracking-wider">JETZT KOSTENFREIE ANALYSE ANFORDERN</button>
  </div>
</div>
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faEnvelope } from '@fortawesome/free-solid-svg-icons'
const element = <FontAwesomeIcon icon={faEnvelope} />
  1. For images, the figma code will likely list the image name. This image has already been saved to the public folder. You must use that image as the source for the image tag.
  2. IMPORTANT: The design team did not wire up any of the buttons or links, they assigned that critical task to you. You MUST implement the code to handle the click events.

Here is a temporary snapshot of your design. It will expire in 60 minutes for security purposes. snapshot

Here are the images from your design. These images will be downloaded to this branch and these links will expire in 60 minutes for security purposes.

Plan:

Step-by-Step Plan to Create the File /src/components/Features.tsx

  1. Create the File:

    • Create a new file named /src/components/Features.tsx.
  2. Copy Initial Code:

    • Copy the provided JSX code into the newly created file.
  3. Import Necessary Libraries:

    • Import React and any other necessary libraries at the top of the file.
    • Import Font Awesome for icons.
  4. Replace Placeholder Icons:

    • Replace the placeholder divs for icons with actual Font Awesome icons.
    • Example:
      import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
      import { faChartLine, faPiggyBank, faUniversity, faShieldAlt } from '@fortawesome/free-solid-svg-icons';
  5. Adjust TailwindCSS Classes:

    • Ensure all TailwindCSS classes are valid.
    • Convert arbitrary values to standard TailwindCSS classes where possible.
    • Example:
      <div className="w-full h-px bg-[#0b2339] mt-0"></div>

      should be:

      <div className="w-full h-0.5 bg-primary-dark mt-0"></div>
  6. Replace Placeholder Text:

    • Identify and replace any placeholder text with the actual content.
    • Ensure all text matches the design specifications.
  7. Add Click Event Handlers:

    • Implement the necessary code to handle click events for buttons.
    • Example:
      const handleClick = () => {
      // Implement the click event logic here
      };
  8. Ensure Flexbox Usage:

    • Use flexbox and other modern TailwindCSS features to ensure the layout is responsive and matches the design.
    • Avoid hardcoding widths or heights unless necessary.
  9. Add Images:

    • If there are any images in the design, ensure they are correctly referenced and used in the component.
    • Example:
      <img src="/path/to/image.png" alt="Description" />
  10. Final Review and Testing:

    • Review the entire component to ensure it matches the design pixel-perfectly.
    • Test the component to ensure it works as expected, including all click events and responsive behavior.

Example Code Implementation

import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faChartLine, faPiggyBank, faUniversity, faShieldAlt } from '@fortawesome/free-solid-svg-icons';

const Features = () => {
  const handleClick = () => {
    // Implement the click event logic here
  };

  return (
    <div className="w-full max-w-7xl mx-auto">
      <div className="flex flex-col items-center">
        <div className="w-full h-0.5 bg-primary-dark mt-0"></div>
        <h1 className="text-4xl font-bold text-center text-primary-dark mt-12">Ziele der kostenfreien Analyse</h1>
        <div className="flex flex-wrap justify-center mt-12">
          <div className="w-72 h-56 bg-secondary-light rounded-lg m-4 p-4 flex flex-col items-center">
            <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
              <FontAwesomeIcon icon={faChartLine} className="text-primary" />
            </div>
            <p className="text-xl text-center text-primary mt-4">Unentdecktes Einsparungspotential entdecken</p>
          </div>
          <div className="w-72 h-56 bg-secondary-light rounded-lg m-4 p-4 flex flex-col items-center">
            <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
              <FontAwesomeIcon icon={faPiggyBank} className="text-primary" />
            </div>
            <p className="text-xl text-center text-primary mt-4">Steuerschonender Vermögensaufbau</p>
          </div>
          <div className="w-72 h-56 bg-secondary-light rounded-lg m-4 p-4 flex flex-col items-center">
            <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
              <FontAwesomeIcon icon={faUniversity} className="text-primary" />
            </div>
            <p className="text-xl text-center text-primary mt-4">Rechtssichere Lösungen</p>
          </div>
          <div className="w-72 h-56 bg-secondary-light rounded-lg m-4 p-4 flex flex-col items-center">
            <div className="w-16 h-16 bg-white rounded-full flex items-center justify-center">
              <FontAwesomeIcon icon={faShieldAlt} className="text-primary" />
            </div>
            <p className="text-xl text-center text-primary mt-4">Schutz des Vermögens vor dem Zugriff durch Dritte</p>
          </div>
        </div>
        <button onClick={handleClick} className="w-3/4 max-w-2xl h-14 bg-primary rounded-lg mt-8 text-white text-lg font-bold tracking-wider">
          JETZT KOSTENFREIE ANALYSE ANFORDERN
        </button>
      </div>
    </div>
  );
};

export default Features;

This plan and example code should help you create the /src/components/Features.tsx file accurately and efficiently.

Storybook Story:

I will update this PR with a storybook story for this component.

@jacob-ai-bot create story

jacob-ai-bot[bot] commented 3 months ago

JACoB here...

I'm busy creating a storybook story for this component.

I'll continue to comment on this pull request with status as I make progress.

jacob-ai-bot[bot] commented 3 months ago

Hello human! 👋

This PR was updated by JACoB

Next Steps

  1. Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.

  2. If you identify code that needs to be changed, please reject the PR with a specific reason. Be as detailed as possible in your comments. JACoB will take these comments, make changes to the code and push up changes. Please note that this process will take a few minutes.

  3. Once the code looks good, approve the PR and merge the code.