<?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 Omer Duraker on Medium]]></title>
        <description><![CDATA[Stories by Omer Duraker on Medium]]></description>
        <link>https://medium.com/@omerduraker?source=rss-dc2a2102985------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*b-BZvpMXuwuzGHZNQOC4Iw@2x.jpeg</url>
            <title>Stories by Omer Duraker on Medium</title>
            <link>https://medium.com/@omerduraker?source=rss-dc2a2102985------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:34:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omerduraker/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[Dark and Light Mode — Using React & Tailwind CSS]]></title>
            <link>https://omerduraker.medium.com/dark-and-light-mode-using-react-tailwind-css-58bb8f988080?source=rss-dc2a2102985------2</link>
            <guid isPermaLink="false">https://medium.com/p/58bb8f988080</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[light-mode]]></category>
            <category><![CDATA[dark-mode]]></category>
            <dc:creator><![CDATA[Omer Duraker]]></dc:creator>
            <pubDate>Sun, 20 Feb 2022 23:06:10 GMT</pubDate>
            <atom:updated>2022-02-21T08:15:40.902Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dark and Light Mode — Using React &amp; Tailwind CSS</h3><p>You can add the Dark and Light Mode feature to your application if your users choose to walk on the dark side<strong> 🌚</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k76o4utdOQO0MSB9Mm73Sg.png" /></figure><p>Let’s speak a bit about what dark mode is at first.</p><p>The dark mode is an effective experience solution created to increase the user experience. <strong>Dark Mode</strong> also known as a <strong>Night Mode</strong> is a popular feature that alters the colour scheme of a user interface (UI).</p><p>Many studies show that it is being preferred by users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yC6UmZsLNdr710TABdqpHA.png" /><figcaption>Dark Mode Poll Results</figcaption></figure><p>A <a href="https://www.androidauthority.com/dark-mode-poll-results-1090716/">survey</a> figured out that out of 2,514 total votes, an overwhelming 81.9% of <em>Android Authority</em> readers use dark mode on their phones, in apps, and wherever else it’s available. 9.9% said they’re somewhere in between dark and light mode, meaning 91.8% of voters use some form of a dark mode on their smartphones. Just 8.2% said they don’t use dark mode at all as you can see below chart.</p><p>We can clearly see the curiosity of users about dark mode support for popular applications, especially Snapchat, Chrome, Facebook, Youtube and Safari.</p><p>In addition, we can clearly see the curiosity of users about dark mode support against popular applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fThP4irEWyppBMqoBc8MEg.png" /><figcaption>Dark Mode Monthly Search Trend by Google Trends</figcaption></figure><p>Let’s talk about the advantages and disadvantages of the dark mode feature in terms of users and devices.</p><h4>👍 Advantages</h4><ul><li>It’s better for low-light settings</li><li>There will be less ‘blue light’ emitted from your phone</li><li>It can use less energy so your phone battery will last longer</li><li>It can help people with light sensitivity or visual impairment</li><li>Most colours tend to get washed out when in contrast with white, but with a dark theme applied or by using dark mode colours pop out more and are more vivid</li><li>It’s reported by a majority to be aesthetically more pleasing to the eye.</li></ul><p>Personal tastes and preferences vary, but users report that they prefer dark-themed software over light-themed one not only because of the above advantages but also it looks more simplistic and sophisticated and generally looks more “cool”.</p><h4>👎 Disadvantages:</h4><ul><li>It can be challenging to read long pieces of content or text in dark mode</li><li>If you have a phone with an older LCD screen, dark mode won’t really save your battery. It saves energy if the device uses an OLED or AMOLED screen</li></ul><h3>Let’s code 👨‍💻</h3><p>First, let’s install the packages required for our project.</p><h4>1. Add Tailwind CSS to the React Project</h4><p><a href="https://tailwindcss.com/docs/guides/create-react-app">Install Tailwind CSS with Create React App - Tailwind CSS</a></p><p>Thanks to the Dark Mode support provided by Tailwind CSS, we can use this support in our application by simply adding the <strong>dark</strong>: prefix to the CSS classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zjQoYXVezLIBlSEDbkfHHQ.png" /></figure><p>To learn more and review examples 👇</p><p><a href="https://tailwindcss.com/docs/dark-mode">Dark mode - Core concepts</a></p><h4>2. Let’s include a nice icon animation package developed for dark/light mode transition with React.</h4><p><a href="https://www.npmjs.com/package/react-toggle-dark-mode">react-toggle-dark-mode</a></p><p>All we need is;</p><ol><li>A hook to catch changes in theme</li><li>An event that will trigger this hook</li><li>UI component where this event will run</li></ol><p>We need a UI component such as a switch, checkbox, button or radio to enable the user to switch to Dark/Light mode. The switch component was my choice for this case. Because why not?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*au03wsuI2R-8G3jx3z9FpQ.png" /><figcaption>App.js</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvFz1CBzKBagK1qS7CV9Bg.png" /><figcaption>Switcher.js (Switch UI component)</figcaption></figure><p><strong>Bonus feature:</strong> The last preferred mode of the user is saved in the browser (on localStorage) and when the user refreshes the page, he/she can continue with his/her last preferred mode. You can also see this feature by clicking the live demo link below and experiencing the last mode you prefer when you refresh your page by default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ygiwu5ey3i5luN-JIHaYw.png" /><figcaption>useDarkSide.js (Hook)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OCxTbRvGtbzZZAVGGd5ZdA.png" /><figcaption>Switcher.js (Blog card template)</figcaption></figure><h3>Result</h3><p>Congrats, now you can skip to the dark side! 🥳</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*mCvIxXl2PsVUyLUDNaRL9Q.gif" /></figure><p>The live demo link below👇</p><p><a href="https://tailwind-darkmode-demo.netlify.app/">https://tailwind-darkmode-demo.netlify.app</a></p><p><a href="https://tailwind-darkmode-demo.netlify.app/">Dark and Light Mode - Using React &amp; Tailwind CSS</a></p><p>Please feel free to comment and put your thought into this post. If you like what you read, don’t forget to clap 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58bb8f988080" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Reusable & Customizable Elements for Components Using React JS⚡]]></title>
            <link>https://omerduraker.medium.com/building-reusable-customizable-elements-for-components-using-react-js-3bd7e6a1610d?source=rss-dc2a2102985------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bd7e6a1610d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Omer Duraker]]></dc:creator>
            <pubDate>Sun, 15 Dec 2019 13:40:16 GMT</pubDate>
            <atom:updated>2022-02-20T21:28:21.768Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building Reusable &amp; Customizable Components by Using React JS⚡</h3><h4><strong>React JS</strong> is one of the today’s most popular <strong>JavaScript Library</strong>. We can build modern, fast, qualified, scaled and easy-to-manage applications with React.</h4><p>In this article, we will develop an UI element for you to add your UI kit to use almost your every project. You can save time, build more systematic project and eliminate code difference on a project by building these elements, while starting an app development.</p><h4><strong>Using a Shared &amp; Generic Components</strong></h4><p>Constructing the elements inspiration comes from atomic design concept, in a variable structure.</p><blockquote><em>“ Atomic design is a methodology composed of five distinct stages working together to create interface design systems in a more deliberate and hierarchical manner. ”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*M5wthtqZvRTPoeLb6jZtAw.jpeg" /><figcaption>Atomic design concept</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wziFMxc4E2LBlXVr4LUCA.png" /><figcaption>This is the a visual demonstration of what strategy we have set</figcaption></figure><p>Let’s create a button which are the smallest part of design like atoms in matter. In this way, we can retrieve the buttons we created wherever we need it.</p><p>The button can be customized and categorized in the application according to usage areas.</p><p>For example, we have 2 different grouped buttons for 2 different operations</p><ul><li>Type 1 button is linked to <strong>blog page </strong>and <strong>green </strong>colored</li><li>Type 2 button open a <strong>pop-up</strong> and is <strong>blue </strong>colored etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrpTDmfQDmbLQ-eiFkW1vg.png" /></figure><p>The button pattern we created contains 3 different props.</p><p>Click event, classname and text.</p><p>Let’s create a default onClick event for our button with handleClick() function and observe this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j8xm3lt1PupgLoJ4HrBeaA.png" /></figure><p>As a first step, let’s start by giving our button a default classname. Note that this style is a default prop for the button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o4T6ZHZMf9vjZEqHhQ0Hzg.png" /></figure><p>And let’s take a look again at the final state of our shared button component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5PFPBsP5WHM4s2X6-N3fA.png" /></figure><p>After the button component we created, let’s write a default style to our button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmOoI4IIKBWye_1tvvQaZw.png" /></figure><p>After creating a default button style, let’s create buttons of different styles from the same component by adding custom styles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oi4C7cSY6TbsfzN-wiHw9w.png" /></figure><p>You may have noticed that our custom classname has received a name and property in addition to our default classname.</p><p>Now, we have custom buttons that we create on a single component. Let’s write the text we want to the text props and call these buttons to examine the latest situation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGUN5vUWJRsfCLEZvavGxA.png" /></figure><p>Let’s take a look at what kind of output we can use by using 3 different buttons in different parts of a paragraph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oyLgBnIPfBpp9PFAr0qKPg.png" /></figure><p>Now we can create many atomic parts like buttons. Then we can combine these parts and create larger reusable &amp; customizable components.</p><p>For live demo👇</p><p><a href="https://codesandbox.io/embed/reusable-and-generic-component-zer8i?fontsize=14&amp;hidenavigation=1&amp;theme=dark">reusable-and-generic-component - CodeSandbox</a></p><p>Please feel free to comment and put your thought on this post. If you like what you read, don’t forget to clap!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bd7e6a1610d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>