<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Muhammed Mushtaha</title>
    <description>The latest articles on Forem by Muhammed Mushtaha (@muhmushtaha).</description>
    <link>https://forem.com/muhmushtaha</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F309157%2F31089f2b-e099-49ce-a089-8cd2b9b00321.jpeg</url>
      <title>Forem: Muhammed Mushtaha</title>
      <link>https://forem.com/muhmushtaha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/muhmushtaha"/>
    <language>en</language>
    <item>
      <title>Simplify Facebook Login in React with react-fb-login-btn</title>
      <dc:creator>Muhammed Mushtaha</dc:creator>
      <pubDate>Mon, 16 Sep 2024 20:57:13 +0000</pubDate>
      <link>https://forem.com/muhmushtaha/simplify-facebook-login-in-react-with-react-fb-login-btn-3f9a</link>
      <guid>https://forem.com/muhmushtaha/simplify-facebook-login-in-react-with-react-fb-login-btn-3f9a</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;I want to share with you a new React component called &lt;code&gt;react-fb-login-btn&lt;/code&gt;. It helps you add Facebook login to your React applications easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Adding Facebook login to your app can be hard sometimes. With &lt;code&gt;react-fb-login-btn&lt;/code&gt;, you can do it in a simple way. This component is built with TypeScript and Tailwind CSS. It allows you to customize the button to fit your app's design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use &lt;code&gt;react-fb-login-btn&lt;/code&gt;?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Easy to Use&lt;/strong&gt;: You don't need to deal with the Facebook SDK directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable&lt;/strong&gt;: Change the button's look to match your app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript Support&lt;/strong&gt;: It uses TypeScript for better code quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handles Events&lt;/strong&gt;: Easy to handle login success or failure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports RTL&lt;/strong&gt;: Works with languages that are right-to-left.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;You can install it using npm:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm &lt;span class="nb"&gt;install &lt;/span&gt;react-fb-login-btn


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Or with yarn:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

yarn add react-fb-login-btn


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Basic Usage
&lt;/h2&gt;

&lt;p&gt;First, import the component into your project:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;FacebookLoginButton&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-fb-login-btn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSuccess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Login successful:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Handle successful login here&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleFailure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Login failed:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Handle login failure here&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;FacebookLoginButton&lt;/span&gt;
        &lt;span class="na"&gt;appId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"YOUR_FACEBOOK_APP_ID"&lt;/span&gt;
        &lt;span class="na"&gt;onSuccess&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSuccess&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;onFail&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleFailure&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Replace &lt;code&gt;"YOUR_FACEBOOK_APP_ID"&lt;/code&gt; with your actual Facebook App ID. You can get it from the &lt;a href="https://developers.facebook.com/" rel="noopener noreferrer"&gt;Facebook Developers website&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customization Options
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;FacebookLoginButton&lt;/code&gt; has several props to customize it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;appId&lt;/code&gt;&lt;/strong&gt; (string, required): Your Facebook App ID.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;onSuccess&lt;/code&gt;&lt;/strong&gt; (function): Called when login is successful.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;onFail&lt;/code&gt;&lt;/strong&gt; (function): Called when login fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;shape&lt;/code&gt;&lt;/strong&gt; (string): &lt;code&gt;'rectangular'&lt;/code&gt; or &lt;code&gt;'circle'&lt;/code&gt;. Default is &lt;code&gt;'rectangular'&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;theme&lt;/code&gt;&lt;/strong&gt; (string): &lt;code&gt;'blue'&lt;/code&gt;, &lt;code&gt;'dark'&lt;/code&gt;, &lt;code&gt;'light'&lt;/code&gt;, or &lt;code&gt;'custom'&lt;/code&gt;. Default is &lt;code&gt;'blue'&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;text&lt;/code&gt;&lt;/strong&gt; (string): The text on the button. Default is &lt;code&gt;'Login with Facebook'&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;scope&lt;/code&gt;&lt;/strong&gt; (string): Permissions you want to request. Default is &lt;code&gt;'public_profile,email'&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  More Examples
&lt;/h2&gt;

&lt;p&gt;To see more examples and how to customize the button, please visit our &lt;a href="https://muhmushtaha.github.io/react-fb-login-btn/" rel="noopener noreferrer"&gt;Storybook documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope you find it useful!&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback and Contributions
&lt;/h2&gt;

&lt;p&gt;If you have any questions or suggestions, please visit the &lt;a href="https://github.com/muhmushtaha/react-fb-login-btn" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;. Contributions are welcome!&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>react</category>
      <category>npm</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Let's Learn About Frontend Development!</title>
      <dc:creator>Muhammed Mushtaha</dc:creator>
      <pubDate>Mon, 26 Jun 2023 13:29:30 +0000</pubDate>
      <link>https://forem.com/muhmushtaha/lets-learn-about-frontend-development-32nh</link>
      <guid>https://forem.com/muhmushtaha/lets-learn-about-frontend-development-32nh</guid>
      <description>&lt;p&gt;Hello, everyone! Today, we're starting a fun journey to learn about frontend development. No matter if you've been working in tech for years or if you're just curious about it, this series will help you understand how we build the parts of websites and apps that people interact with.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Frontend Development?
&lt;/h2&gt;

&lt;p&gt;Frontend development is about creating the parts of a website or app that you can see and touch. It's everything you see when you're surfing the internet. Every button you click, every picture you look at, every form you fill out - that's all part of frontend.&lt;/p&gt;

&lt;p&gt;Frontend development is all about bringing designs to life. It's what you experience directly when you use an app or website.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Building Blocks: HTML, CSS, and JavaScript
&lt;/h2&gt;

&lt;p&gt;Frontend development is based on three main tools: HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;HTML (HyperText Markup Language):&lt;/strong&gt; HTML is like the blueprint of a webpage. It decides where everything goes and what content is on the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS (Cascading Style Sheets):&lt;/strong&gt; CSS makes a webpage look nice. It picks the colors, the fonts, and how everything is arranged on the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript:&lt;/strong&gt; JavaScript makes everything work. It lets webpages do more than just sit there. With JavaScript, buttons can change when you click them, and data can be sent and received.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why is Frontend Development Important?
&lt;/h2&gt;

&lt;p&gt;These days, a company's website or app is often the first thing a customer sees. The frontend interface is their first impression of the business.&lt;/p&gt;

&lt;p&gt;Good frontend development makes sure that the website or app is nice to look at, easy to use, and works well. It connects the users with the business's systems and makes using web applications easier and more enjoyable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Frontend development is a big part of how we use the web. It shapes our online experiences and helps businesses reach their customers more effectively. In the next few weeks, we'll learn more about this important part of web development, including some special lessons on a tool called React.js that many developers love to use.&lt;/p&gt;

&lt;p&gt;So, let's get ready to learn more about the amazing world of frontend development!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
