<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sudhir Kumar on Medium]]></title>
        <description><![CDATA[Stories by Sudhir Kumar on Medium]]></description>
        <link>https://medium.com/@sudhirkr?source=rss-66abb82b5d4e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PgkRMKdqdWbb_FEFfAgRnQ.jpeg</url>
            <title>Stories by Sudhir Kumar on Medium</title>
            <link>https://medium.com/@sudhirkr?source=rss-66abb82b5d4e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:34:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sudhirkr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Loggo: Simplifying Health Tracking with a Modern Web App]]></title>
            <link>https://sudhirkr.medium.com/loggo-simplifying-health-tracking-with-a-modern-web-app-4e0212d4faef?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e0212d4faef</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[habits]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[tracking]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Sun, 04 May 2025 14:06:05 GMT</pubDate>
            <atom:updated>2025-05-04T14:08:59.689Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s fast-paced world, maintaining a healthy lifestyle often takes a backseat. However, with the advent of digital tools, tracking health metrics has become more accessible than ever. One such tool is <strong>Loggo</strong>, a minimalist web application designed to help users monitor their health effortlessly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EJ01jkhWjz4pduJl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-0jQCpdgziHLHCJ7KdTgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5FceRPMz_bwEjbrGtWIuw.png" /></figure><h3>🧭 What is Loggo?</h3><p>Loggo is a straightforward health tracking application accessible via <a href="https://loggoapp.netlify.app/">loggoapp.netlify.app</a>. Built using modern web technologies, it offers a clean and intuitive interface for users to log and monitor various health metrics.</p><h3>🎯 Key Features</h3><h3>1. User-Friendly Interface</h3><p>Loggo’s design prioritizes simplicity. Upon visiting the site, users are greeted with a clean layout that makes navigation seamless. The absence of clutter ensures that users can focus solely on inputting and viewing their health data.</p><h3>2. Health Metric Logging</h3><p>Users can log various health metrics, such as weight, sleep hours, and water intake. This feature allows individuals to keep track of their daily habits and make informed decisions about their health.<a href="https://www.getloggo.app/privacy-policy?utm_source=chatgpt.com">getloggo.app</a></p><h3>3. Data Visualization</h3><p>Loggo provides visual representations of the logged data, making it easier for users to identify trends and patterns over time. These insights can be crucial for understanding one’s health journey and making necessary adjustments.</p><h3>4. Responsive Design</h3><p>The application is designed to be responsive, ensuring a smooth experience across various devices, be it a desktop, tablet, or smartphone. This flexibility allows users to log their health metrics anytime, anywhere.</p><h3>🛠️ Technical Overview</h3><p>Loggo is hosted on Netlify, leveraging its robust platform for continuous deployment and scalability. The application is built using React, a popular JavaScript library for building user interfaces. For data storage and backend services, Loggo integrates with Appwrite, an open-source backend-as-a-service platform that provides essential APIs for user authentication, database management, and more.<a href="https://medium.com/%40samanabk49/creating-a-to-do-app-with-appwrite-and-netlify-605d98cfc492?utm_source=chatgpt.com">Medium</a></p><h3>🚀 Getting Started with Loggo</h3><p>Using Loggo is straightforward:</p><ol><li>Visit <a href="https://loggoapp.netlify.app/">loggoapp.netlify.app</a>.</li><li>Sign up or log in to your account.</li><li>Begin logging your health metrics.</li><li>Review your data through the provided visualizations.<a href="https://www.getloggo.app/privacy-policy?utm_source=chatgpt.com">Vecteezy+2getloggo.app+2Netlify+2</a></li></ol><p>For developers interested in exploring or contributing to Loggo, the source code is available on GitHub. The repository provides insights into the application’s architecture and offers a starting point for those looking to build similar applications.</p><h3>🔗 Conclusion</h3><p>Loggo exemplifies how simplicity in design can lead to powerful tools for personal health management. By focusing on essential features and providing a seamless user experience, Loggo empowers individuals to take charge of their health journey. Whether you’re looking to monitor your weight, track your sleep patterns, or ensure adequate water intake, Loggo serves as a reliable companion in your health tracking endeavors.<a href="https://www.getloggo.app/privacy-policy?utm_source=chatgpt.com">getloggo.app</a></p><p><em>Note: The information provided is based on the available details as of the current date. For the most up-to-date features and functionalities, please visit </em><a href="https://loggoapp.netlify.app/"><em>loggoapp.netlify.app</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e0212d4faef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Contentful API in React Like a Pro : A Step-by-Step Guide]]></title>
            <link>https://sudhirkr.medium.com/using-contentful-api-in-react-like-a-pro-a-step-by-step-guide-527615b35632?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/527615b35632</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[blogging]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-js-tutorials]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 13:30:42 GMT</pubDate>
            <atom:updated>2024-06-11T01:22:25.598Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Contentful as a Blog Section in React Like a Pro : A Step-by-Step Guide</h3><h3>Introduction</h3><p>Recently, while developing a <a href="https://aijobster.work/blog">website</a>, I encountered challenges with integrating Contentful. The documentation was not helpful, so I decided to write this article to provide a clearer guide. Contentful is a popular headless CMS that allows you to manage and deliver content across various platforms. When working with React, Contentful offers a flexible and efficient way to handle content without being tied to a traditional CMS. However, many developers face challenges with outdated or confusing documentation. This guide aims to provide a clear, step-by-step approach to integrating Contentful with a React application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hqQqK9zR_UWnRIR3nxrNFA.png" /><figcaption>aijobster.work — React WebApp</figcaption></figure><p><a href="https://www.contentful.com/">Contentful</a> is a popular headless CMS that allows you to manage and deliver content across various platforms. When working with React, Contentful provides a flexible and efficient way to handle content without being tied to a traditional CMS.</p><p>However, many developers face challenges with outdated or confusing documentation. This guide aims to provide a clear, step-by-step approach to integrating Contentful with a React application.</p><h3>Prerequisites</h3><p>Before we start, make sure you have the following:</p><ul><li>Basic knowledge of React and JavaScript.</li><li>Node.js and npm installed on your machine.</li><li>An account on Contentful.</li></ul><h3>Step 1: Setting Up the Contentful Space</h3><h4>Sign Up/Log In to Contentful</h4><p>Head over to <a href="https://www.contentful.com/">Contentful</a> and sign up for an account or log in if you already have one.</p><h4>Create a New Space</h4><p>Once logged in, navigate to your dashboard and create a new space. This space will hold your content models and entries.</p><h4>Create Content Types</h4><p>In your new space, define the structure of your content by creating content types. For this tutorial, let’s create a content type called “Blog Post” with the following fields:</p><ul><li>Title (Short text)</li><li>Body (Long text)</li><li>Image (Media)</li></ul><h4>Add Content</h4><p>Add some sample entries to your content types. These entries will be the data we fetch and display in our React application.</p><h3>Step 2: Setting Up a React Project</h3><h4>Initialize a React App</h4><p>Open your terminal and run the following command to create a new React app:</p><pre>npx create-react-app contentful-react-app<br>cd contentful-react-app</pre><h4>Install Contentful SDK</h4><p>Install the Contentful JavaScript SDK using npm:</p><pre>npm install contentful</pre><h3>Step 3: Connecting to Contentful</h3><h4>Create a Contentful Client</h4><p>Create a new file named contentfulClient.js in the src directory and add the following code:</p><pre>import { createClient } from &#39;contentful&#39;;</pre><pre>const client = createClient({<br>  space: &#39;YOUR_SPACE_ID&#39;,<br>  accessToken: &#39;YOUR_ACCESS_TOKEN&#39;,<br>});</pre><pre>export default client;</pre><p>Replace YOUR_SPACE_ID and YOUR_ACCESS_TOKEN with your actual Contentful space ID and access token. These can be found in the Contentful dashboard under API keys.</p><h3>Install other dependencies to render the content</h3><pre>npm install @contentful/rich-text-react-renderer @contentful/rich-text-types</pre><p>Add the following code in Blog.tsx</p><pre>import React, { useState, useEffect } from &quot;react&quot;;<br>import { useParams } from &quot;react-router-dom&quot;;<br>import Banner from &quot;../CommonComponents/Banner&quot;;<br>import Footer from &quot;../CommonComponents/Footer&quot;;<br>import { fetchContent, Content } from &quot;./ContentfulService&quot;;<br>import { documentToReactComponents } from &quot;@contentful/rich-text-react-renderer&quot;;<br>import { BLOCKS, MARKS } from &#39;@contentful/rich-text-types&#39;;<br>import { FiArrowLeft } from &quot;react-icons/fi&quot;;<br><br>const BlogDetails: React.FC = () =&gt; {<br>  const { heading } = useParams&lt;{ heading?: string }&gt;();<br>  const decodedHeading = heading || &quot;&quot;;<br>  const [blogContent, setBlogContent] = useState&lt;Content | null&gt;(null);<br><br>  useEffect(() =&gt; {<br>    const fetchData = async () =&gt; {<br>      try {<br>        const data = await fetchContent();<br>        const selectedBlog = data.find(<br>          (content) =&gt; content.fields.headline === decodeURIComponent(decodedHeading)<br>        );<br>        setBlogContent(selectedBlog || null);<br>      } catch (error) {<br>        console.error(&quot;Error fetching content:&quot;, error);<br>      }<br>    };<br>    fetchData();<br>  }, [decodedHeading]);<br><br> <br>  return (<br>    &lt;div className=&quot;mt&quot;&gt;<br>      &lt;Banner title={blogContent !== null ?blogContent.fields.headline: &#39;Blog&#39;} /&gt;<br>      &lt;div className=&quot;page&quot;&gt;<br>      &lt;div className=&quot;container bg-white&quot;&gt;<br>        &lt;a href={&quot;/blog&quot;} className=&quot;py-3 d-flex align-items-center&quot;&gt;<br>            &lt;FiArrowLeft className=&quot;me-2&quot; /&gt;Blogs<br>          &lt;/a&gt;<br>        {blogContent &amp;&amp; (<br>          &lt;div&gt;<br>            &lt;h2 className=&quot;fw-bold&quot;&gt;{blogContent.fields.headline}&lt;/h2&gt;<br>            {documentToReactComponents(blogContent.fields.content, options)}<br>          &lt;/div&gt;<br>        )}<br>      &lt;/div&gt;<br>      &lt;/div&gt;<br>      &lt;Footer showFilter /&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default BlogDetails;</pre><h3>Create a Data Fetching Function</h3><p>In the same contentfulClient.js file, add a function to fetch data:</p><pre>export const fetchEntries = async () =&gt; {<br>  try {<br>    const entries = await client.getEntries();<br>    return entries.items;<br>  } catch (error) {<br>    console.error(&#39;Error fetching entries:&#39;, error);<br>  }<br>};</pre><h3>Fetch Data in a React Component</h3><pre>import { createClient, Entry } from &#39;contentful&#39;;<br>import { Document } from &#39;@contentful/rich-text-types&#39;;<br><br>export interface Content {<br>  sys: {<br>    id: string;<br>    updatedAt: string;<br>  };<br>  fields: {<br>    headline: string;<br>    content: Document;<br>  };<br>}<br><br>const space = process.env.REACT_APP_CONTENTFUL_SPACE_ID;<br>const accessToken = process.env.REACT_APP_CONTENTFUL_ACCESS_TOKEN;<br><br>if (!space || !accessToken) {<br>  throw new Error(&#39;Contentful space ID and access token must be provided.&#39;);<br>}<br><br>const client = createClient({<br>  space,<br>  accessToken<br>});<br><br>export const fetchContent = async (): Promise&lt;Content[]&gt; =&gt; {<br>  try {<br>    const response = await client.getEntries();<br>    const content = response.items.map((item: Entry&lt;any&gt;) =&gt; ({<br>      sys: item.sys,<br>      fields: item.fields as Content[&#39;fields&#39;] <br>    }));<br>    return content;<br>  } catch (error) {<br>    console.error(&#39;Error fetching content:&#39;, error);<br>    throw error;<br>  }<br>};</pre><h3>Step 6: Styling and Enhancements</h3><h3>Styling</h3><p>Add some CSS to style your components as desired. You can use plain CSS, Sass, or any CSS-in-JS solution.</p><h3>Error Handling</h3><p>Enhance your data fetching function to handle errors more gracefully and display a user-friendly message if something goes wrong.</p><h3>Pagination</h3><p>If you have a lot of data, consider implementing pagination. Contentful’s API supports querying with limits and offsets to fetch data in chunks.</p><h3>Conclusion</h3><p>In this guide, we covered how to integrate Contentful with a React application, from setting up Contentful to fetching and displaying content. Contentful’s flexibility and React’s power make a great combination for building modern web applications.</p><p>Feel free to leave comments and ask questions. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=527615b35632" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Google Analytics 4 with a React Application]]></title>
            <link>https://sudhirkr.medium.com/integrating-google-analytics-4-with-a-react-application-09f4d5230ee3?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/09f4d5230ee3</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Sun, 02 Jun 2024 09:32:33 GMT</pubDate>
            <atom:updated>2024-06-02T09:32:33.095Z</atom:updated>
            <content:encoded><![CDATA[<p>Google Analytics 4 (GA4) offers robust analytics and insights for modern web applications. Integrating GA4 with a React application can help track user interactions and improve user experience. Here’s a comprehensive guide on how to set up GA4 in a React app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hSo0OioTjSmaJktZaa4GA.png" /></figure><h3>Step 1: Set Up Google Analytics 4 Property</h3><h4>1. Create a GA4 Property</h4><ul><li>Go to <a href="https://analytics.google.com/">Google Analytics</a>.</li><li>Click on the <strong>Admin</strong> gear icon in the bottom-left corner.</li><li>Under the Property column, select <strong>Create Property</strong>.</li><li>Follow the prompts to set up a new GA4 property.</li></ul><h4><strong>2.Obtain the Measurement ID</strong></h4><ul><li>In the Admin area, navigate to <strong>Data Streams</strong> under the Property column.</li><li>Select your web data stream.</li><li>Your Measurement ID (starts with G-) will be displayed at the top right of the data stream details.</li></ul><h4>Step 2: Install react-ga4</h4><p>To integrate GA4 with your React application, you’ll need the react-ga4 library.</p><pre>npm install react-ga4</pre><h4>Step 3: Initialize GA4 in Your React Application</h4><p>Initialize GA4 in your main entry file (index.js or App.js).</p><pre>// index.js or App.js<br>import React from &#39;react&#39;;<br>import ReactDOM from &#39;react-dom&#39;;<br>import App from &#39;./App&#39;;<br>import ReactGA from &#39;react-ga4&#39;;<br><br>// Initialize GA4 with your Measurement ID<br>ReactGA.initialize(&#39;G-XXXXXXXXXX&#39;); // Replace with your Measurement ID<br><br>// Send a pageview for the initial load<br>ReactGA.send(&quot;pageview&quot;);<br><br>ReactDOM.render(<br>  &lt;React.StrictMode&gt;<br>    &lt;App /&gt;<br>  &lt;/React.StrictMode&gt;,<br>  document.getElementById(&#39;root&#39;)<br>);</pre><h4>Step 4: Track Page Views</h4><p>Track page views by listening to route changes. This example uses React Router.</p><pre>// App.js<br>import React, { useEffect } from &#39;react&#39;;<br>import { BrowserRouter as Router, Route, Switch, useLocation } from &#39;react-router-dom&#39;;<br>import ReactGA from &#39;react-ga4&#39;;<br><br>const usePageTracking = () =&gt; {<br>  const location = useLocation();<br><br>  useEffect(() =&gt; {<br>    ReactGA.send(&quot;pageview&quot;);<br>  }, [location]);<br>};<br><br>const HomePage = () =&gt; &lt;div&gt;Home Page&lt;/div&gt;;<br>const AboutPage = () =&gt; &lt;div&gt;About Page&lt;/div&gt;;<br><br>const App = () =&gt; {<br>  usePageTracking();<br><br>  return (<br>    &lt;Router&gt;<br>      &lt;Switch&gt;<br>        &lt;Route path=&quot;/about&quot; component={AboutPage} /&gt;<br>        &lt;Route path=&quot;/&quot; component={HomePage} /&gt;<br>      &lt;/Switch&gt;<br>    &lt;/Router&gt;<br>  );<br>};<br><br>export default App;</pre><h4>Step 5: Track Custom Events</h4><p>Track custom events by calling ReactGA.event within your components.</p><pre>// ExampleComponent.js<br>import React from &#39;react&#39;;<br>import ReactGA from &#39;react-ga4&#39;;<br><br>const ExampleComponent = () =&gt; {<br>  const handleClick = () =&gt; {<br>    ReactGA.event({<br>      category: &#39;User&#39;,<br>      action: &#39;Clicked example button&#39;<br>    });<br>  };<br><br>  return &lt;button onClick={handleClick}&gt;Click me&lt;/button&gt;;<br>};<br><br>export default ExampleComponent;</pre><h3>Conclusion</h3><p>By following these steps, you’ll successfully integrate Google Analytics 4 into your React application, enabling you to track user interactions and gather valuable insights. For advanced tracking and customization, refer to the <a href="https://github.com/pricecomstock/react-ga4">react-ga4 documentation</a> and the Google Analytics 4 API documentation.</p><p>Happy tracking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09f4d5230ee3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hooked — Web design UI-UX]]></title>
            <link>https://medium.com/weekly-webtips/hooked-web-design-ui-ux-f3b0d011b6f7?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3b0d011b6f7</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[typography]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[graphic-design]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Fri, 07 Jul 2023 10:34:32 GMT</pubDate>
            <atom:updated>2023-07-20T04:19:12.994Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hooked: Where Design and Collaboration Unite — A Blog on Seamless Web Design and Collaboration</h3><h4><em>Introduction:</em></h4><p>In the fast-paced world of web design and development, efficiency and collaboration are key to creating successful projects. Today, we’ll explore “Hooked,” a web platform that revolutionizes the way designers and teams work together to build captivating websites. Join us as we delve into the power of “Hooked” and how it streamlines the design process, fosters collaboration, and leads to stunning web experiences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OKva-6mKsTBjerR9E-k-xw.png" /><figcaption>Hooked Upcoming website- Homepage</figcaption></figure><h4><em>Understanding Hooked:</em></h4><p>Hooked is an innovative web-based platform designed to cater specifically to designers, developers, and teams working on web projects. It combines the best features of prototyping tools, collaboration platforms, and design systems to create an all-in-one solution.</p><h4><em>Seamless Web Design:</em></h4><p>With Hooked, designers can unleash their creativity without limitations. The platform offers an array of design tools and features that make crafting stunning web layouts a breeze. From customizable templates to a vast library of design elements, Hooked empowers designers to bring their visions to life.</p><h4><em>Prototyping Made Easy:</em></h4><p>Prototyping is an integral part of the design process, and Hooked excels in this area. Designers can create interactive prototypes with ease, enabling them to visualize the user experience and gather valuable feedback early on in the project.</p><h4><em>Collaboration that Inspires:</em></h4><p>Gone are the days of cumbersome email chains and scattered feedback. Hooked fosters collaboration by allowing team members to work together in real-time. Designers, developers, and stakeholders can collaborate seamlessly, ensuring a unified vision for the project.</p><h4><em>Integrations and Handoffs:</em></h4><p>Hooked integrates with popular design and development tools, making handoffs smoother than ever before. Developers can access design specifications and assets directly, reducing the chance of misinterpretations and speeding up the development process.</p><h4><em>Security and Accessibility:</em></h4><p>Security and accessibility are paramount when working with valuable design assets. Hooked takes data security seriously, providing a safe and encrypted environment for your projects, ensuring your work is always protected.</p><h4><em>Conclusion:</em></h4><p>In a world where design and collaboration go hand in hand, “Hooked” emerges as a game-changer. With its seamless web design capabilities, powerful collaboration features, and dedication to maintaining design consistency, Hooked empowers designers and teams to achieve exceptional results. Embrace the future of web design with Hooked, and elevate your projects to new heights.</p><p><em>Call to Action:</em> Curious to experience the magic of Hooked yourself? Visit their <a href="https://www.behance.net/gallery/174679503/Hooked-Web-Design">homepage design</a> to explore the platform and sign up for a free trial. Unleash your creativity, streamline your collaboration, and create web experiences that leave users “hooked”! Happy designing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3b0d011b6f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weekly-webtips/hooked-web-design-ui-ux-f3b0d011b6f7">Hooked — Web design UI-UX</a> was originally published in <a href="https://medium.com/weekly-webtips">Webtips</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom  Event Date Selector in React Native]]></title>
            <link>https://medium.com/hackernoon/today-custom-event-date-selector-in-react-native-b1ca0dc45c16?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1ca0dc45c16</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Wed, 07 Jun 2023 05:25:19 GMT</pubDate>
            <atom:updated>2023-06-07T06:10:53.558Z</atom:updated>
            <content:encoded><![CDATA[<h3>Custom Event Date Selector Component in React Native</h3><h3>Introduction</h3><p>In React Native development, working with dates and calendars is a common requirement. One particular use case is creating a date picker that dynamically displays events based on the current date or a selected date. In this blog post, we will explore how to implement an event-based date picker in React Native, allowing users to easily navigate through dates and view relevant events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dP-QYkCLruKcyPruRtWcOA.jpeg" /></figure><blockquote>Goal:</blockquote><blockquote>To create a component which can be used as a date selector to sort events based on their past or future date.</blockquote><h4>Component UI : Snaps of the final component.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*9sKWbkaUkFDtYZZ4R3oTeA.png" /><figcaption>Today with left right arrow for Tomorrow and Yesterday</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*f3QPQEad-goTRFcr1iXKQQ.png" /><figcaption>Snap of home screen with Today Events — Current Date Events</figcaption></figure><h4>Prerequisites:</h4><p>Before diving into the implementation, ensure you have the following set up:</p><ol><li>Basic knowledge of React Native.</li><li>A React Native project created and configured on your machine.</li></ol><h4>Installing Dependencies</h4><p>In your project directory, install the necessary dependencies by executing the following command:</p><pre>npm install moment @expo/vector-icons</pre><h4>DateSelectBox Component</h4><p>Create a new file called DateSelectBox.js in your project&#39;s component directory and import the required dependencies:</p><pre>import { View, Text, Pressable } from &#39;react-native&#39;<br>import React from &#39;react&#39;<br>import { styles } from &#39;../design/styles&#39;<br>import { theme } from &#39;../design/theme&#39;<br>import { Feather } from &#39;@expo/vector-icons&#39;; <br><br>export default function DateSelectBox({<br>  calculateTomorrow,calculateYesterday,<br>  headerTitle,setCurrentDate}) <br>{<br>  return (<br>    &lt;View style={[styles.row,styles.ctr,styles.pv]}&gt;<br>     &lt;Pressable onPress={calculateYesterday}&gt;<br>      &lt;Feather name={&#39;arrow-left&#39;} size={24} color={theme.light} /&gt;<br>     &lt;/Pressable&gt;<br>     &lt;Pressable style={{width: 300}} onPress={setCurrentDate}&gt;<br>      &lt;Text style={[styles.lg,{textAlign: &#39;center&#39;}]}&gt;{headerTitle}&lt;/Text&gt;<br>     &lt;/Pressable&gt;<br>     &lt;Pressable onPress={calculateTomorrow}&gt;<br>      &lt;Feather name={&#39;arrow-right&#39;} size={24} color={theme.light} /&gt;<br>     &lt;/Pressable&gt;<br>    &lt;/View&gt;<br>  )<br>}</pre><p>In this component, we initialize a headerTitle state variable using the current date as default and pressing the left and right icon will run the calculateYesterday and calculateTomorrow function. The setCurrentDate function updates the selectedDate state when a date is pressed on the calendar.</p><h4>Rendering Events</h4><p>To display events based on the selected date we can have a state currentDate which will be fetching currentDate based on the moment date for today.</p><p>In order to filter data in respective of selected date filterData can be used to filter and re-render the component.</p><p>Here is the code snippet for the whole flow.</p><pre>export default function DateSlider({navigation}) {<br><br>-------------<br><br>const todayDate = moment().format(&#39;MMM DD, YYYY&#39;);<br>const todoData = useSelector((state) =&gt; state.appData.todoData);<br>const [currentDate, setCurrentDate] = useState(todayDate);<br><br>-------------<br><br>const calculateTomorrow=()=&gt; {<br>  const nextDate = <br>  moment(currentDate).add(1, &quot;days&quot;).format(&quot;MMM DD, YYYY &quot;)<br>  setCurrentDate(nextDate);<br>}<br><br>const calculateYesterday=()=&gt;{<br>  const pastDate = <br>  moment(currentDate).subtract(1, &quot;days&quot;).format(&quot;MMM DD, YYYY&quot;)<br>  setCurrentDate(pastDate);<br>}<br><br>const headerTitle = currentDate === moment().format(&#39;MMM DD, YYYY&#39;) ? `Today` : currentDate;<br>const filterData=todoData.filter(item=&gt;item.date === moment(currentDate).format(&#39;DD MMM, YYYY&#39;))<br><br>return (<br><br>&lt;View&gt;<br><br>-----------<br><br>// Rendering DateSelectBox Component<br> &lt;DateSelectBox<br>    calculateTomorrow={()=&gt;calculateTomorrow()}<br>    calculateYesterday={()=&gt;calculateYesterday()}<br>    headerTitle={headerTitle}<br>    setCurrentDate={()=&gt;setCurrentDate(todayDate)}<br>  /&gt;<br><br>------------<br><br>  // Rendering items based on selected date filter<br>  &lt;FlatList<br>    showsVerticalScrollIndicator={false}<br>    data={filterData}<br>    ListEmptyComponent={EmptyComponent}<br>    renderItem={(item) =&gt; (<br>      &lt;View style={{marginVertical: 5, backgroundColor: theme.gray, padding: 10,borderRadius: 5}}&gt;<br>        &lt;Text style={styles.lg}&gt;{item.item.text}&lt;/Text&gt;<br>        &lt;TouchableOpacity onPress={() =&gt; dispatch(wpActions.removeTodoData(item.item.key))} style={{width: 100}}&gt;<br>          &lt;Text style={[styles.lg,{color: theme.bright}]}&gt;Delete&lt;/Text&gt;<br>        &lt;/TouchableOpacity&gt;<br>      &lt;/View&gt;<br>    )}<br>    keyExtractor={(item) =&gt; item.key}<br>  /&gt;<br><br>-----------<br><br>&lt;/View&gt;<br>}<br></pre><figure><img alt="Yesterday Event" src="https://cdn-images-1.medium.com/max/427/1*nE8IW9bibJtbVhlt7Pb1tw.png" /><figcaption>Yesterday Events</figcaption></figure><h4>Conclusion:</h4><p>Congratulations! You have successfully implemented an event-based date picker in React Native. Users can now select a date from the arrow icons, and the component will display the corresponding events. Feel free to customise the design and integrate with your own event data or APIs to further enhance the functionality.</p><p>Remember to handle error scenarios and incorporate additional features as per your application’s requirements. With this foundation, you can build upon the date picker to create more advanced features such as event details, event creation, and reminders.</p><p>Happy coding!</p><p>Reach out to me on <a href="https://www.instagram.com/navigatorkumar/">Instagram </a>if you have any questions on the same or want to learn more about React Native and Code. I am also interested in collaboration of wireframes and design mockups for building awesome application based on Mobile and Web.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1ca0dc45c16" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/today-custom-event-date-selector-in-react-native-b1ca0dc45c16">Custom  Event Date Selector in React Native</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have an excellent idea and wondering how much does a mobile app cost?]]></title>
            <link>https://sudhirkr.medium.com/have-an-excellent-idea-and-wondering-how-much-does-a-mobile-app-cost-2851a1c7bd22?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2851a1c7bd22</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Wed, 14 Apr 2021 15:21:38 GMT</pubDate>
            <atom:updated>2021-04-14T15:21:38.308Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are a client who is looking for an app to be developed for his organization or an entrepreneur who has an excellent idea but still figuring out how much it would cost to turn that idea into reality. I think you are at the right place to know all the information you need before jumping on to this adventurous ride of App development.</p><p>In this article, you would learn about both dark and clear aspects of app development. We would be covering some usual questions and answers which we have in mind before investing in an app venture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Deq0Vns1V2941RwR" /><figcaption>Photo by <a href="https://unsplash.com/@kellysikkema?utm_source=medium&amp;utm_medium=referral">Kelly Sikkema</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Categorizing the application</h3><p>With the increasing affordability of smartphones across the world, the app industry has absolutely exploded in the last 10 years. This has lead to the development of many different types of apps. You can categorize your app under any one category.</p><ol><li>Utilities</li><li>Entertainment</li><li>Games</li><li>News</li><li>Productivity</li><li>Lifestyle</li><li>Social Networking</li><li>Health and Fitness</li></ol><h3>App Platform Selection: Native or Hybrid</h3><p>This is the first barrier which we need to pass once we have a clear understanding of our requirements and project specifics. We have two options mainly</p><p><strong>Native apps:</strong> These are specific to any one platform either iOS, Android, or Windows. The developer needs to write code based on one platform for iOS it is usually Swift for Android it is Java.</p><p><strong>Hybrid apps</strong>: As the name suggests, these are a combination of both the platforms i.e iOS and Android. Recently web is also included in this so common options under this category are React Native and Flutter. The most important advantage Hybrid has over Native is that the same codebase can be used to run on multiple platforms which reduces the overall cost and time.</p><p>If you have a tight budget and want to get your application build fast on both platforms. Hybrid is the best approach. But if you are certain of the user base and have more time and budget overall you can go for native. I know this is debatable but when you are an owner this is the most important decision you need to make before investing your hard-earned money. The best advice is to consult with your team about what should be the best platform based on user base and timeline. Make sure the end call is yours as each potter will praise its pot until it leaks.</p><h3>Going for MVP</h3><p>Users these days are BRUTAL!! when it comes to reviews. Nobody loves a bloated product, so it is only right that you go all in to ensure the development of an app that provides a seamless user experience.</p><blockquote>MVP is the version of the new product that allows a team to collect the maximum amount of validated learning about customers with the least amount of effort.</blockquote><p>The perfect successful example of the MVP is WhatsApp. It started with just the chat feature using the contact number. Soon it moved on to video calls, calls, media uploads, and many more. The latest being the payment gateway. Now you must be wondering how they were able to do that?</p><p>The answer is simple, there is a power you hold when you are developing an app, called <strong>Version</strong>. It enables you to add the core features to your app and then push them to the stores, get feedback from the user, make enhancements and improve. This is called the progressive approach. God forbids, In case you create a blunder you can easily switch back to the previous version and get hold of the error.</p><h4>Advantage: This is the best approach if you have a tight budget and timeline and want to test how the idea is in reality. It will give you a clear idea of how the user reacts to your app or website.</h4><p>Now we are clear of all the pre-development barriers. It is time to know what exactly it will cost you to get it developed. We are going to discuss some of the bullet points or sections of app development and know the options we have and discuss the average cost involved in these areas.</p><blockquote>About the cost details, it can vary from individual to individual to organization. These days we have freelancers who can do that very cheap in comparison to big tech giants. But the question of quality and timeline is there along with professionalism. So that is totally upto you and your decision to choose.</blockquote><h3>Wireframing</h3><p>Wireframes are the backbone of any project. Wireframes serve as a middle ground between low-fidelity sketches and first interactive prototypes. The actual process of wireframing for mobile varies drastically. Better the clarity of wireframes better is the code and ultimately better is the app.</p><blockquote><strong><em>Cost: 10% of the overall budget</em></strong></blockquote><h3>User Management</h3><p>User Access Management, also known as identity and access management, is the administration of giving individual users within the system access to the tools they need at the right time. For businesses, this usually includes access to external applications, permissions, and security requirements.</p><p>Today, challenges can arise as companies grow, and employees with varying roles and responsibilities increasingly use external enterprise solutions to do their jobs. An identity and access management solution helps manage this by providing a seamless way to manage user identities and access all in one place. There are many ways usually it is authentication. You can go for social login or normal login. Depends on the options Social Media Login / Username-Email Login, if your app is pretty simple and needs no social media go for normal login and signup.</p><blockquote><strong><em>Cost: 5% of the overall budget</em></strong></blockquote><h3>Features</h3><p>Once you have your basic idea, the layout, and color scheme right, you need to start thinking about what the customer actually wants, because if you don’t meet their needs, a competitor might, and as a result, you could lose significant business. There are a few features which are nice to have and some which are must-haves, but many will make your app really stand out. Email Notification, Push notification, Cloud computing, Real-time tracking the list is endless. So decide and select based on budget and requirements.</p><blockquote><strong><em>Cost: 25% of the overall budget</em></strong></blockquote><h3>Third-party plugins</h3><p>Depending on the features you decide the third-party plugins will be the next requirement, more the plugins more will be the cost. Third-party plugins are basically software or libraries which help your feature to work, suppose you want a tracking system in case of getting the real-time feedback you need to integrate libraries like Pusher or Pubnub. All the third-party plugins usually have pricing plans based on users. You can review those</p><blockquote><strong><em>Cost: 10-15% of the overall budget based on users</em></strong></blockquote><h3>Frontend Development &amp; Backend development</h3><p>It stands to reason that app development per se makes the biggest impact on the app cost. Seasoned developers, who have successfully delivered multiple projects, are still scarce resources. That’s why coding an app usually accounts for 50–70 percent of the total cost of app development, and the coding times vary depending on the type of app. The frontend is the View part of the app, Backend is something that can withstand huge loads and work smoothly under any conditions, which will entail more time spent on designing and building a complex app architecture. Moreover, you’ll require multiple programming languages to create your app’s backend, which means you’ll need to pay for a more diverse team of professionals.</p><blockquote><strong><em>Cost: 10–15% of the overall budget based on users</em></strong></blockquote><h3>Server and Network Maintenance</h3><p>Most apps nowadays run their back ends on cloud service providers like AWS, Google Cloud, or Azure, which (depending on the scale required) can cost pennies or thousands of dollars each month. Besides, many third-party services (such as payment systems) that an app might use operate under a SaaS model, requiring subscription costs. As an app gains popularity, its throughput needs in both these areas are likely to grow, which in turn racks up the costs of its upkeep. Once an app has been battle-tested in the real world with real users, bugs are bound to crop up and need addressing continually.</p><blockquote><strong><em>Cost: Pricing plans based on app users</em></strong></blockquote><h3>Money earning</h3><p>Mobile apps are critical for any business, not just for smooth business operations and functioning, but also as a separate channel for revenue generation. As a mobile app development company, one of the most commonly asked questions that we hear is — how do apps make money.</p><ol><li><strong>Paid App</strong>: You can put a certain charge on the app to be paid by the user to install the application. A percentage is charged by the stores on that payment.</li><li><strong>Free App</strong>: Most of the apps on stores lie in this category the only source of revenue is either ads or a large number of users. If your app is doing great stores and business agencies pay you to host their ads.</li><li><strong>In-App purchase</strong>: This is a process in which you provide for free to the end-user but charge a subsequent amount for some parts of the app. To access those areas they have to pay a subscription fee.</li></ol><p>This should be the last thing on your mind as it usually takes time for the app to be a hit in the market. So that is not going to be that quick. If the focus is on the app and you are sure that the idea is unique and will attract users, you can expect a better future.</p><h3>Overall Cost</h3><p>The cost of making a mobile app is most often based on the number of hours the project may take, and the more difficult the functionality, the longer it will take to implement. Let me divide these into three categories:</p><ol><li><strong>Average</strong>: These apps include some basic functionality, don’t require integration with any third-party APIs, and may not need a backend infrastructure. Features of such applications may include standard UI components, a feed list, simple filters, and map markers. Developing a simple app like this usually takes about 250–400 hours and starts at $15000.</li><li><strong>Medium</strong>: These apps may include custom UI features, real-time chat, payment functionality, tablet and handset adaptation, integration with APIs, and a simple backend server. It takes around 1,000 hours to build such an app, and the price starts at $50,000</li><li><strong>Complex</strong>: Highly complex apps include advanced functionality such as audio/video processing, real-time synchronization, custom animations, integrations with third-party services, complex backends with several types of database relationships, and more. The timeframe for building complex apps is 2,400+ hours, and the price starts at $80,000. A full-fledged social media application, dating app, data collection, and a video streaming app may all fall into this category.</li></ol><h3><strong>Conclusion</strong>:</h3><p>You’re nearly ready to get started with the development process. If you have any questions or just want to run your idea past a panel of experts, we’re <a href="https://www.ithands.com/">here</a> to talk. Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2851a1c7bd22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[react-native-slider-text]]></title>
            <link>https://medium.com/swlh/react-native-slider-text-7f5054f733dd?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f5054f733dd</guid>
            <category><![CDATA[slider]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Fri, 26 Jun 2020 07:59:56 GMT</pubDate>
            <atom:updated>2020-07-01T04:26:15.303Z</atom:updated>
            <content:encoded><![CDATA[<p>React Native Slider is a component to select a single value from a range of values. We have mostly seen slider while increasing or decreasing the volume or brightness of our phone. Here is the example of the slider which will be helpful for you to integrate slider in your app.</p><h3>Source Code:</h3><ol><li><a href="https://github.com/sudhirkumarojhaa/react-native-slider-text">Github Account</a></li><li><a href="https://www.npmjs.com/package/react-native-slider-text">npm </a>package</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*MTzyvlAN1pTIV50oo5n6tQ.png" /><figcaption>react-native-slider-text</figcaption></figure><h3>Installation</h3><p>You need to install the following packages to integrate this component into your react native app.</p><h4>Create a new React Native Project</h4><p>Add the following commands to create a new react native project.</p><pre>npm install -g react-native-cli</pre><pre>react-native init ProjectName</pre><pre>cd ProjectName</pre><p>Once you have created the app. Add the following dependency to create your first custom slider text component</p><pre>yarn add @react-native-community/slider</pre><pre>yarn add react-native-slider-text</pre><pre>cd ios &amp;&amp; pod install</pre><h4>Update App.js File</h4><p>Remove the existing code in the App.js file and add the following code.</p><pre>import React, { useState } from &#39;react&#39;;<br>import {View, Text, StyleSheet} from &#39;react-native&#39;;<br>import SliderText from &#39;react-native-slider-text&#39;;</pre><pre>const App = () =&gt; {<br>const [sliderValue, setSliderValue] = useState(0);<br>return (<br> &lt;View style={styles.container}&gt;<br>   &lt;Text style={styles.title}&gt;<br>     Little interest or pleasure in doing things?<br>   &lt;/Text&gt;<br>   &lt;SliderText<br>     minimumTrackTintColor=&quot;#000&quot;<br>     thumbTintColor=&quot;#000&quot;<br>     maximumTrackTintColor=&quot;#099&quot;<br>     maximumValue={5}<br>     stepValue={1}<br>     minimumValueLabel=&quot;Never&quot;<br>     maximumValueLabel=&quot;Always&quot;<br>     onValueChange={(id) =&gt; setSliderValue(id)}<br>     sliderValue={sliderValue}<br>   /&gt;<br> &lt;/View&gt;<br>);};</pre><pre>const styles = StyleSheet.create({<br> container: {<br>  flex: 1,<br>  padding: 10,<br> },<br> title: {<br>  fontSize: 24,<br>  fontWeight: &#39;bold&#39;,<br> },<br>});</pre><pre>export default App;</pre><h3>Custom Props to the component</h3><h4>maximumValue:</h4><p>You can change the maximum value of the slider to a max of 100000 and it will adjust the display accordingly.</p><h4>stepValue:</h4><p>The step is basically the dividend value by default it is 1. You can customize it based on your requirements.</p><h4>multiplier:</h4><p>This is a decimal value that handles the position in a perfect position. By default, it is 1.12. Feel free to play with this value and the position of the slider will be handled in real-time.</p><h4>minimumTrackTintColor:</h4><p>Add any hex code or color value string depending on your requirements.</p><h4>thumbTintColor:</h4><p>Add any hex code or color value string depending on your requirements.</p><h4>maximumTrackTintColor:</h4><p>Add any hex code or color value string depending on your requirements.</p><h4>sliderValueStyle:</h4><p>Custom Text styles can be added to update the look and feel of the moving label over the slider.</p><h4>customLabelStyle:</h4><p>Custom Text styles can be added to update the look and feel of the labels that are showing the start and end labels at the bottom of the slider.</p><h4>onValueChange:</h4><p>A custom function can be added to update the slider value to manage the state</p><h4>sliderValue:</h4><p>the current value of the slider. You can use this value to access the slider value.</p><h3>Final Step</h3><p>Now you are done with the installation and ready to launch the app with a brand new custom slider with moving text.</p><pre>react-native run-ios</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SkjJtpdTYjXKqEZHijym6Q.png" /></figure><h4>Conclusion:</h4><h4>Have Questions? Reach out to me via my<a href="https://www.instagram.com/navigatorkumar/"> Instagram</a> or my Github page mentioned in the medium profile section.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f5054f733dd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/react-native-slider-text-7f5054f733dd">react-native-slider-text</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Components]]></title>
            <link>https://sudhirkr.medium.com/react-native-components-a86d68c925ed?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a86d68c925ed</guid>
            <category><![CDATA[input-field]]></category>
            <category><![CDATA[customer-experience]]></category>
            <category><![CDATA[button]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Thu, 11 Jun 2020 04:39:24 GMT</pubDate>
            <atom:updated>2020-06-18T05:51:55.243Z</atom:updated>
            <content:encoded><![CDATA[<p>Here in this article, I am going to push some ready to pick components that are used quite often.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GQ78PaerPHt9AK1Z" /><figcaption>Photo by <a href="https://unsplash.com/@frankiefoto?utm_source=medium&amp;utm_medium=referral">frank mckenna</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Installation</h3><p>Before we begin installing the basic libraries which we are going to require to create custom components.</p><pre>yarn add  react-native-responsive-screen react-native-vector-icons</pre><p>Installing the react-native vector icons these days is little complex. Let me know if you face any problem I will help you out. I guess we are ready now. Let’s add some components to our app now:</p><h3>Text Button Component:</h3><p>Create a custom button component with TouchableOpacity and Text component.</p><pre>import React from &#39;react&#39;;<br>import {Text, TouchableOpacity, StyleSheet} from &#39;react-native&#39;;<br>import {colorCode} from &#39;../design/colorCode&#39;;<br>import {<br>widthPercentageToDP as wp,<br>heightPercentageToDP as hp,<br>} from &#39;react-native-responsive-screen&#39;;</pre><pre>export const Button = ({style, title, titleStyle, ...props}) =&gt; (<br>&lt;TouchableOpacity {...props} style={[styles.btnBox, style]}&gt;<br>  &lt;Text style={[styles.text, titleStyle]}&gt;{title}&lt;/Text&gt;<br>&lt;/TouchableOpacity&gt;<br>);</pre><pre>const styles = StyleSheet.create({<br>btnBox: {<br>backgroundColor: colorCode.brand,<br>width: wp(60),<br>justifyContent: &#39;center&#39;,<br>alignItems: &#39;center&#39;,<br>alignSelf: &#39;center&#39;,<br>borderRadius: 5,<br>paddingVertical: 15,<br>marginTop: 30,<br>},</pre><pre>text: {<br>fontWeight: &#39;bold&#39;,<br>color: colorCode.light,<br>fontSize: hp(2),<br>},<br>});</pre><h3>Icon Button Component:</h3><p>Create a custom icon component using Icon from vector icons and TouchableOpacity from the react-native library.</p><pre>import React from &#39;react&#39;;<br>import {TouchableOpacity} from &#39;react-native&#39;;<br>import Icon from &#39;react-native-vector-icons/FontAwesome&#39;;</pre><pre>export default function ButtonIcon(<br>{style, onPress, name, size, color}) {</pre><pre>return (<br> &lt;TouchableOpacity onPress={onPress} style={style}&gt;<br>   &lt;Icon name={name} size={size} color={color} /&gt;<br> &lt;/TouchableOpacity&gt;<br>);<br>}</pre><h3>Loader Component:</h3><p>Create a custom loader using the Modal and ActivityIndicator component from the react-native.</p><pre>import React from &#39;react&#39;;<br>import {View, Modal, ActivityIndicator, Text, StyleSheet} from &#39;react-native&#39;;<br>import {colorCode} from &#39;../design/colorCode&#39;;<br>import {<br>widthPercentageToDP as wp,<br>heightPercentageToDP as hp,<br>} from &#39;react-native-responsive-screen&#39;;</pre><pre>export const Loader = (props) =&gt; {<br>const {loading, text} = props;</pre><pre>return (<br>&lt;Modal<br> transparent<br> animationType=&quot;none&quot;<br> visible={loading}<br>&gt;<br>&lt;View style={styles.modalBackground}&gt;<br> &lt;ActivityIndicator<br>  animating={loading}<br>  color={colorCode.light} <br>  size=&quot;large&quot;<br>/&gt;<br>  &lt;Text style={styles.text}&gt;{text}&lt;/Text&gt;<br>  &lt;/View&gt;<br> &lt;/Modal&gt;<br> );<br>};</pre><pre>const styles = StyleSheet.create({<br>modalBackground: {<br>flex: 1,<br>alignItems: &#39;center&#39;,<br>flexDirection: &#39;column&#39;,<br>justifyContent: &#39;center&#39;,<br>backgroundColor: colorCode.brand,<br>},</pre><pre>text: {<br>fontSize: hp(2),<br>color: colorCode.light,<br>fontWeight: &#39;bold&#39;,<br>paddingVertical: wp(2),<br>},<br>});</pre><h3>TextInput Component:</h3><p>This is custom any another text input, Here I am just trying to save most of the hustle at one end so that only relevant parts go into the main component.</p><pre><br>import React from &#39;react&#39;;<br>import {TextInput, Keyboard, StyleSheet} from &#39;react-native&#39;;<br>import {styles} from &#39;../styles&#39;;</pre><pre>export const TextBox = ({<br>onChangeText,<br>onBlur,<br>value,<br>placeholder,<br>max,<br>instantCount,<br>secret<br>}) =&gt; {<br>return (<br>&lt;TextInput<br> onChangeText={onChangeText}<br> onBlur={onBlur}<br> value={value}<br> onChange={instantCount}<br> style={styles.input} <br> secureTextEntry={secret}<br> placeholder={placeholder}<br> underlineColorAndroid=&quot;transparent&quot;<br> placeholderTextColor=&quot;#000&quot;<br> multiline<br> maxLength={max}<br> blurOnSubmit={true}<br> onSubmitEditing={() =&gt; {<br> Keyboard.dismiss();}}<br>/&gt;<br>);<br>};</pre><pre>const styles = StyleSheet.create({<br>input: {<br> width: wp(90),<br> borderBottomColor: &#39;#999&#39;,<br> borderBottomWidth: 0.5,<br> marginVertical: hp(2),<br> padding: wp(2),<br> fontSize: hp(2),<br>},</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a86d68c925ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Navigation 5 with Auth Screens Navigation and DarkMode Theme using Redux]]></title>
            <link>https://medium.com/swlh/react-navigation-5-with-auth-screens-navigation-and-darkmode-theme-using-redux-31866a230d5a?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/31866a230d5a</guid>
            <category><![CDATA[react-navigation-5]]></category>
            <category><![CDATA[themes]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[dark-mode]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Thu, 11 Jun 2020 04:24:30 GMT</pubDate>
            <atom:updated>2020-06-11T04:24:30.009Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re already familiar with React Native then you’ll be able to get moving with React Navigation quickly! If not, you may want to read sections 1 to 4 (inclusive) of <a href="http://reactnativeexpress.com/">React Native Express</a> first, then come back here when you’re done.</p><p>What follows within the <em>Fundamentals</em> section of this documentation is a tour of the most important aspects of React Navigation. It should cover enough for you to know how to build your typical small mobile application, and give you the background that you need to dive deeper into the more advanced parts of React Navigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T8dChXDfgxNsQwMs" /><figcaption>Photo by <a href="https://unsplash.com/@pathum_danthanarayana?utm_source=medium&amp;utm_medium=referral">Pathum Danthanarayana</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Installation</h3><p>You just need to add some of the basic navigation libraries and you are set for creating basic stack navigation in react native.</p><pre>yarn add @react-navigation/native</pre><pre>yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view</pre><pre>cd ios &amp;&amp; pod install &amp;&amp; ..</pre><h3>Initial Navigation Route file</h3><p>Create a unique file called Routes.js and add this code there. You can create your own custom components file. Here I am using some custom files which are having stack navigation and there authentication is managed by the auth token saved in Redux.</p><pre>import React from &#39;react&#39;;<br>import {NavigationContainer,DarkTheme,DefaultTheme} from &#39;@react-navigation/native&#39;;<br>import {createStackNavigator} from &#39;@react-navigation/stack&#39;;<br>import {useSelector} from &#39;react-redux&#39;;<br>import Home from &#39;../screens/common/Home&#39;;<br>import ListScreen from &#39;../screens/common/ListScreen&#39;;<br>import Login from &#39;../screens/auth/Login&#39;;<br>import SignUp from &#39;../screens/auth/SignUp&#39;;<br>import Settings from &#39;../screens/common/Settings&#39;;</pre><pre>const Stack = createStackNavigator();<br>const AuthStack = createStackNavigator();<br>const AppStack = createStackNavigator();</pre><pre>const AuthScreens = () =&gt; (<br> &lt;AuthStack.Navigator&gt;<br>  &lt;Stack.Screen<br>   name=&quot;Login&quot;<br>   component={Login}<br>   options={{headerShown: false}}<br>  /&gt;<br>  &lt;Stack.Screen<br>   name=&quot;SignUp&quot;<br>   component={SignUp}<br>   options={{headerShown: false}}<br>  /&gt;<br> &lt;/AuthStack.Navigator&gt;<br>);</pre><pre>const AppScreens = () =&gt; (<br> &lt;AppStack.Navigator&gt;<br>  &lt;Stack.Screen name=&quot;Home&quot; component={Home} options={{headerShown: false}} /&gt;<br> &lt;Stack.Screen<br>  name=&quot;ListScreen&quot;<br>  component={ListScreen}<br>  options={{headerShown: false}}<br> /&gt;<br> &lt;Stack.Screen<br>  name=&quot;Settings&quot;<br>  component={Settings}<br>  options={{headerShown: false}}<br> /&gt;<br>&lt;/AppStack.Navigator&gt;<br>);</pre><pre>const customDarkTheme = {<br>...DarkTheme,<br>colors: {<br>...DarkTheme.colors,<br>textColor: &#39;#fff&#39;,<br>bgColor: &#39;#202040&#39;,<br>danger: &#39;tomato&#39;,<br>},<br>};</pre><pre>const customDefaultTheme = {<br>...DefaultTheme,<br>colors: {<br>...DefaultTheme.colors,<br>textColor: &#39;#002856&#39;,<br>bgColor: &#39;#fff&#39;,<br>danger: &#39;tomato&#39;,<br>},<br>};</pre><pre>export const Route = () =&gt; {<br>const currentTheme = useSelector((state) =&gt; state.appData.changeTheme);<br>const token = useSelector((state) =&gt; state.appData.token);<br>return (<br>&lt;NavigationContainer theme={currentTheme ? customDarkTheme : customDefaultTheme}&gt;<br>{token ? (<br>&lt;AppScreens options={{animationEnabled: false}} /&gt;<br>) : (&lt;AuthScreens options={{animationEnabled: false}} /&gt;)}<br>&lt;/NavigationContainer&gt;<br>);<br>};</pre><h4>App.js file</h4><p>Just add the basic structure of the Redux and handle the theme here which is provided by default by the react-navigation package. I am storing the theme state via redux to manage it throughout the app and it persists until you toggle it back to normal.</p><pre>import React from &#39;react&#39;;<br>import {Route} from &#39;./src/navigation/routes&#39;;<br>import {Provider} from &#39;react-redux&#39;;<br>import {PersistGate} from &#39;redux-persist/integration/react&#39;;<br>import {Store, persistor} from &#39;./src/store&#39;;<br>import {StatusBar} from &#39;react-native&#39;;<br>import RNBootSplash from &#39;react-native-bootsplash&#39;;const App = () =&gt; {<br> RNBootSplash.hide();<br> return (<br>  &lt;Provider store={Store}&gt;<br>   &lt;PersistGate loading={null} persistor={persistor}&gt;<br>   &lt;StatusBar backgroundColor=&quot;#000&quot; barStyle=&quot;light-content&quot; /<br>    &lt;Route /&gt;<br>   &lt;/PersistGate&gt;<br>  &lt;/Provider&gt;<br>);<br>};export default App;</pre><h4>Handle Theme toggle Code:</h4><p>Here is the basic button which will toggle between icons and change the theme accordingly. You can create your own custom component and check if it works. Here is the basic code structure to toggle theme from dark to light and vice versa.</p><pre>import * as wpActions from &#39;../../store/actions&#39;;<br>import {useDispatch, useSelector} from &#39;react-redux&#39;;<br>import Icon from &#39;react-native-vector-icons/Feather&#39;;<br>import {useTheme} from &#39;@react-navigation/native&#39;;</pre><pre>const Settings = ({navigation}) =&gt; {<br>const dispatch = useDispatch();<br>const {colors} = useTheme();<br>const theme = useSelector((state) =&gt; state.appData.theme);</pre><pre>const manageDarkMode = () =&gt; {<br>dispatch(wpActions.changeTheme(!currentTheme));<br>setCurrentTheme(!currentTheme);<br>console.log(currentTheme, theme);<br>};</pre><pre>return (</pre><pre>&lt;SafeAreaView style={[styles.container, {backgroundColor: colors.bgColor}]}&gt;</pre><pre>&lt;View style={inlineStyles.list}&gt;<br>  &lt;Text style={[inlineStyles.item, {color: colors.textColor}]}&gt;<br>    Choose Theme<br>  &lt;/Text&gt;<br>  &lt;Icon name={currentTheme ? &#39;sun&#39; : &#39;moon&#39;} size={24} <br>   color={currentTheme ? &#39;yellow&#39; : &#39;blue&#39;} <br>   onPress={() =&gt; manageDarkMode()}<br>  /&gt;<br>&lt;/View&gt;</pre><pre>&lt;/SafeAreaView&gt;<br>);</pre><blockquote>Conclusion: Check out the code for React Navigation and Dark theme integration via React Native 5.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31866a230d5a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/react-navigation-5-with-auth-screens-navigation-and-darkmode-theme-using-redux-31866a230d5a">React Navigation 5 with Auth Screens Navigation and DarkMode Theme using Redux</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Redux template in React Native]]></title>
            <link>https://medium.com/swlh/using-redux-template-in-react-native-9bb70752ce74?source=rss-66abb82b5d4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bb70752ce74</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Sudhir Kumar]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 12:54:14 GMT</pubDate>
            <atom:updated>2020-06-15T15:26:58.437Z</atom:updated>
            <content:encoded><![CDATA[<p>Redux is a predictable state container for JavaScript apps.</p><p>It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UzpWQJqvr87fZ7U_" /><figcaption>Photo by <a href="https://unsplash.com/@codestorm?utm_source=medium&amp;utm_medium=referral">Safar Safarov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Installation</h3><p>In order to install the redux in react native. We will install the following packages.</p><pre>yarn add react-redux redux redux-persist redux-thunk @react-native-community/async-storage</pre><p>Once you have installed the packages. Create a folder in your app component and name it as a store. Add the following folders and file in the storage component.</p><ol><li>Actions</li><li>Reducers</li><li>index.js</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*7tipZapS18QJ2WgICut8Nw.png" /></figure><h3>Actions Folder</h3><h4>Add the following code in types.js</h4><pre>export const SAVE_TOKEN = &#39;SAVE_TOKEN&#39;;</pre><h4>Add the following code in the index.js</h4><pre>import { SAVE_TOKEN } from &#39;./types&#39;;</pre><pre>export const saveToken = (key) =&gt; ({<br>  type: SAVE_TOKEN,<br>  payload: key<br>});</pre><h3>Reducers Folder</h3><h4>Add the following code in the index.js</h4><pre>import { SAVE_TOKEN } from &#39;../actions/types&#39;;</pre><pre>const initialState = {<br> token: &#39;&#39;<br>};</pre><pre>const Reducer = (state = initialState, action) =&gt; {<br>switch (action.type) {</pre><pre>case SAVE_TOKEN:<br> return {<br>   ...state,<br>   token: action.payload,<br>};</pre><pre>default: <br> return state;<br>}<br>};</pre><pre>export default Reducer;</pre><h4>Add the following code in Index.js file of Store</h4><pre>import {applyMiddleware, combineReducers, createStore, compose} from &#39;redux&#39;;<br>import thunk from &#39;redux-thunk&#39;;<br>import {persistStore, persistReducer} from &#39;redux-persist&#39;;<br>import AsyncStorage from &#39;@react-native-community/async-storage&#39;;<br>import Reducer from &#39;./reducers&#39;;</pre><pre>// Redux Debugger<br>let composeEnhancer = compose;<br>if (__DEV__) {<br>composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;<br>}</pre><pre>const Reducers = {<br> appData: Reducer<br>};</pre><pre>const persistConfig = {<br> key: &#39;root&#39;,<br> storage: AsyncStorage,<br> blacklist: [&#39;navigation&#39;], // navigation will not be persisted<br> // stateReconciler: autoMergeLevel2,<br> // timeout: 100000,<br>};</pre><pre>const persistedReducer = persistReducer(<br> persistConfig,<br> combineReducers(Reducers),<br>);</pre><pre>export const Store = createStore( <br> persistedReducer,composeEnhancer(applyMiddleware(thunk))<br>);</pre><pre>export const persistor = persistStore(Store);</pre><h3>Final Step</h3><h4>Add the following code in App.js file</h4><pre>import React from &#39;react&#39;;<br>import {Route} from &#39;./src/navigation/routes&#39;;<br>import {Provider} from &#39;react-redux&#39;;<br>import {PersistGate} from &#39;redux-persist/integration/react&#39;;<br>import {Store, persistor} from &#39;./src/store&#39;;<br>import {StatusBar} from &#39;react-native&#39;;<br>import RNBootSplash from &#39;react-native-bootsplash&#39;;</pre><pre>const App = () =&gt; {<br> RNBootSplash.hide();<br> return (<br>  &lt;Provider store={Store}&gt;<br>   &lt;PersistGate loading={null} persistor={persistor}&gt;<br>   &lt;StatusBar backgroundColor=&quot;#000&quot; barStyle=&quot;light-content&quot; /<br>    &lt;Route /&gt;<br>   &lt;/PersistGate&gt;<br>  &lt;/Provider&gt;<br>);<br>};</pre><pre>export default App;</pre><p>Steps to retrieve and store the values in the store in a functional component</p><pre>import React, {useState, useEffect} from &#39;react&#39;;<br>import {persistor} from &#39;../store&#39;;<br>import * as wpActions from &#39;../../store/actions&#39;;<br>import {useSelector, useDispatch} from &#39;react-redux&#39;;</pre><pre>const Login = ({navigation}) =&gt; {<br> const dispatch = useDispatch();<br> const [code, setCode] = useState(&#39;&#39;);<br> const details = useSelector((state) =&gt; state.appData.details);<br> console.log(details);</pre><pre>// Comment this code if not clearing database.<br> useEffect(() =&gt; {<br>  persistor.purge;<br>  console.log(&#39;purging database&#39;);<br> }, []);<br> <br> const sendToken=()=&gt;{ <br>   dispatch(wpActions.saveToken(code))<br> }</pre><p>If you want to set up a new app with Drawer and Stack Navigation along with redux run this command</p><pre>yarn add <a href="http://twitter.com/react">@react</a>-native-community/async-storage <a href="http://twitter.com/react">@react</a>-native-community/masked-view  <a href="http://twitter.com/react">@react</a>-navigation/drawer <a href="http://twitter.com/react">@react</a>-navigation/native <a href="http://twitter.com/react">@react</a>-navigation/stack react-native-gesture-handler react-native-reanimated react-native-responsive-screen react-native-safe-area-context react-native-screens react-native-vector-icons react-redux redux redux-persist redux-thunk</pre><p>Read my article on Medium regarding Stack Navigation for More info.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bb70752ce74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/using-redux-template-in-react-native-9bb70752ce74">Using Redux template in React Native</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>