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: Added frontend for newsletter section ( exploring backend for the same ) #331

Merged
merged 8 commits into from
Jun 7, 2024

Conversation

Adeesh-bode
Copy link
Contributor

@Adeesh-bode Adeesh-bode commented May 23, 2024

Related Issue

Issue Number : #295
Part of GirlScript summer of code
Added frontent for newletter section

Screenshots

Attached
Screenshot (114)

Summary by CodeRabbit

  • New Features

    • Introduced a Newsletter component for email sign-ups and social media sharing.
    • Added an optional type property to buttons, allowing for different button types (button, submit, reset).
  • Style

    • Updated global styles to include a red outline.

Copy link

vercel bot commented May 23, 2024

@Adeesh-bode is attempting to deploy a commit to the Sanchit Bajaj's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the title needs formatting Title of issue or pull request does not match the guidelines label May 23, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Great job, @Adeesh-bode! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project. Keep being the part of the community!

'We will promptly review your changes and offer feedback. Keep up the excellent work!
Kindly remember to check our Contributing Guidelines'

Copy link
Contributor

coderabbitai bot commented May 23, 2024

Walkthrough

The recent changes introduce a new Newsletter component for newsletter sign-ups, modify the Button component to support different button types, and update the HomePage to include the Newsletter component. Additionally, a new CSS rule is added to the global styles.

Changes

File Path Change Summary
src/components/core/buttons/index.tsx Added type property to Button interface and modified ButtonLong to render different button types.
src/components/core/newsletter/index.tsx Introduced a Newsletter component for email sign-ups and social media sharing.
src/components/pages/home/index.tsx Imported and rendered the Newsletter component within the HomePage component.
src/styles/globals.css Added a new CSS rule outline: red; to the global styles.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant HomePage
    participant Newsletter
    participant ButtonLong

    User->>HomePage: Load Home Page
    HomePage->>Newsletter: Render Newsletter Component
    User->>Newsletter: Enter Email and Submit
    Newsletter->>Newsletter: handleChange and handleSubmit
    Newsletter->>ButtonLong: Render Submit Button
    ButtonLong->>User: Display Button
Loading

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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
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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 71be276 and 40ac4c8.
Files selected for processing (3)
  • src/components/core/newsletter/index.tsx (1 hunks)
  • src/components/pages/home/index.tsx (2 hunks)
  • src/styles/globals.css (1 hunks)
Files skipped from review due to trivial changes (3)
  • src/components/core/newsletter/index.tsx
  • src/components/pages/home/index.tsx
  • src/styles/globals.css

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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 40ac4c8 and be4ac3e.
Files selected for processing (1)
  • src/components/core/newsletter/index.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/components/core/newsletter/index.tsx

const Newsletter: React.FC = () => {
return <div className="w-full ">
<div className="flex flex-col justify-center items-center gap-6 px-20 py-10 ">
<h4 className="text-xs uppercase">Newsletter</h4>

Choose a reason for hiding this comment

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

The font size is way too small

<div className="flex flex-col justify-center items-center gap-6 px-20 py-10 ">
<h4 className="text-xs uppercase">Newsletter</h4>
<h2 className="text-xs md:text-base uppercase text-primary-light text-center">Sign up for latest updates and offers</h2>
<div className="flex flex-col gap-4 md:flex-row">

Choose a reason for hiding this comment

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

In light mode, it is unclear if an input is even present, put something like a border around it for light mode.

@yashd-dev
Copy link

I feel that the backend also has to be included in this PR to merge this into main. We can't ship incomplete features, @Sanchitbajaj02 thoughts?

@Sanchitbajaj02 Sanchitbajaj02 changed the title feat : Added frontend for newsletter section ( exploring backend for the same ) feat: Added frontend for newsletter section ( exploring backend for the same ) May 23, 2024
@github-actions github-actions bot removed the title needs formatting Title of issue or pull request does not match the guidelines label May 23, 2024
@Sanchitbajaj02
Copy link
Owner

I feel that the backend also has to be included in this PR to merge this into main. We can't ship incomplete features, @Sanchitbajaj02 thoughts?

Yes, backend is must. Also, @Adeesh-bode there is no need to create new button, I have already configured a customized button with an action, please use that.

@Sanchitbajaj02 Sanchitbajaj02 added ⭐ enhancement Feature enhancement ✨ goal: improve interface EASY Difficulty Level: Easy level1 10 points gssoc GSSOC'24 Required Label and removed wait for reviewers labels May 23, 2024
@Sanchitbajaj02
Copy link
Owner

@Adeesh-bode any updates on this PR?

@Adeesh-bode
Copy link
Contributor Author

I thought you rejected my work so I wasn't working on it... is it possible if only frontend part is done by me ( I would explore app write and do the if not possible ). I am asking cause a person familiar with app write can do this job better.

@Sanchitbajaj02
Copy link
Owner

I thought you rejected my work so I wasn't working on it... is it possible if only frontend part is done by me ( I would explore app write and do the if not possible ). I am asking cause a person familiar with app write can do this job better.

I never mentioned the rejection. If you scroll up we suggested the changes that needs to be done to get it merged.

Also it is alright if you don't know or not familiar with Appwrite. The PR will be merged, just do the changes that are suggested above

@Adeesh-bode
Copy link
Contributor Author

ok I will do the suggested changes and raise pr by day end..

@Adeesh-bode
Copy link
Contributor Author

hey sanchit , I started working on using already made custom button , which is used for redirection by href but the subscribe button is not redirecting it is triggering and onSubmit action for backend. I will still want to use your made custom button than I would have to make states which will pass from child component to parent i.e from custom button component to newsletter component ( which is not recommend ) or will have to use redux global state . If you say so I will work on it, as I looked in other part of project like login & register page where such trigger buttons are used , they also didn't used custom button.

@Adeesh-bode
Copy link
Contributor Author

other than button suggestion other frontend suggestion are considered.

@Sanchitbajaj02
Copy link
Owner

hey sanchit , I started working on using already made custom button , which is used for redirection by href but the subscribe button is not redirecting it is triggering and onSubmit action for backend. I will still want to use your made custom button than I would have to make states which will pass from child component to parent i.e from custom button component to newsletter component ( which is not recommend ) or will have to use redux global state . If you say so I will work on it, as I looked in other part of project like login & register page where such trigger buttons are used , they also didn't used custom button.

For the button, you can introduce an option on click event field. Like either the href will work or the onclick event will work on that button. This will help streamline the button component throughout the application

@Adeesh-bode
Copy link
Contributor Author

done, utilized the prebuilt ui component for button

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between be4ac3e and ff7fd27.

Files selected for processing (2)
  • src/components/core/buttons/index.tsx (1 hunks)
  • src/components/core/newsletter/index.tsx (1 hunks)
Additional context used
Biome
src/components/core/newsletter/index.tsx

[error] 28-28: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.

Additional comments not posted (3)
src/components/core/buttons/index.tsx (2)

5-9: The addition of the type property enhances the flexibility of the Button interface, allowing it to accommodate various user interactions. Good enhancement!


12-28: The conditional rendering in ButtonLong to support both <button> and <Link> elements based on the type property is well-implemented. This change makes the component versatile for different contexts.

src/components/core/newsletter/index.tsx (1)

6-43: The implementation of the Newsletter component is comprehensive, handling user input and form submission effectively. The use of social media icons adds a nice touch for user engagement.

src/components/core/newsletter/index.tsx Outdated Show resolved Hide resolved
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: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ff7fd27 and 589e83f.

Files selected for processing (1)
  • src/components/core/newsletter/index.tsx (1 hunks)
Additional context used
Biome
src/components/core/newsletter/index.tsx

[error] 1-2: The default import is only used as a type.

Additional comments not posted (2)
src/components/core/newsletter/index.tsx (2)

7-11: State management for subscriber email is implemented correctly.


42-42: Export of the Newsletter component is correctly implemented.

src/components/core/newsletter/index.tsx Show resolved Hide resolved
src/components/core/newsletter/index.tsx Show resolved Hide resolved
src/components/core/newsletter/index.tsx Show resolved Hide resolved
@Adeesh-bode
Copy link
Contributor Author

I didn't know app write backend so I asked sanchit , that can I do the frontend. So I did only frontend part. The image for frontend is attached in above message

@Sanchitbajaj02 Sanchitbajaj02 merged commit c66de71 into Sanchitbajaj02:master Jun 7, 2024
3 of 4 checks passed
@Sanchitbajaj02 Sanchitbajaj02 linked an issue Jun 10, 2024 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EASY Difficulty Level: Easy ⭐ enhancement Feature enhancement ✨ goal: improve interface gssoc GSSOC'24 Required Label level1 10 points
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat:Newsletter section for engaging with users and collecting their emails
3 participants