<?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 Rishabh Rathod on Medium]]></title>
        <description><![CDATA[Stories by Rishabh Rathod on Medium]]></description>
        <link>https://medium.com/@rishabhrathod01?source=rss-824a15e3ba33------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VaexDsXrYS6USbtYSORFxA.jpeg</url>
            <title>Stories by Rishabh Rathod on Medium</title>
            <link>https://medium.com/@rishabhrathod01?source=rss-824a15e3ba33------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:55:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rishabhrathod01/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[Implementing MIUI’s Wave Animation  Using React Native Reanimated v2]]></title>
            <link>https://medium.com/@rishabhrathod01/implementing-miuis-wave-animation-using-react-native-reanimated-v2-12b9d14163ac?source=rss-824a15e3ba33------2</link>
            <guid isPermaLink="false">https://medium.com/p/12b9d14163ac</guid>
            <category><![CDATA[svg-animation]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Rishabh Rathod]]></dc:creator>
            <pubDate>Mon, 20 Sep 2021 02:42:41 GMT</pubDate>
            <atom:updated>2021-09-20T02:42:41.882Z</atom:updated>
            <content:encoded><![CDATA[<p>After the MIUI 12 upgrade, I just loved playing the new smooth animations 😍 and as a developer, was excited to know how to implement it 🤔.</p><p>The first thing I did was google Wave Animation Can it be done in react-native? 😬 and got a close result to what I was looking for but as I wanted to play with the wave. That wasn’t enough and hence I tried further on my own.</p><p>Here are all my learnings compiled as an article.</p><h4>1. Make A Smooth Curve</h4><p>To draw a curve, we will use SVG Path which supports the cubic bezier curve.</p><p>A <strong>cubic bezier curve</strong> is a curve line formed using 4 points, a starting point, an ending point, and control points ( c1 &amp; c2 ).</p><p><strong>If you are familiar with making curves using SVG, you can jump 🏃🏻‍♂️ to point 2.</strong></p><h4>1.1 Let’s Move To The Start Point 🎯</h4><p>To move to a particular point in SVG, we use the Move to command i.e., M x y.</p><p>M 0 0.5</p><figure><img alt="Screenshot" src="https://cdn-images-1.medium.com/max/363/0*WcQqL8Q3WgM-BKr5.png" /></figure><h4>1.2 Make The 🧊 Cubic Curve</h4><figure><img alt="Screenshot" src="https://cdn-images-1.medium.com/max/382/0*RUtA1x_BALT7HcVR.png" /></figure><p>In the above example, we plot a curve that starts at (0, 0.5) and ends at (1, 0.5) with control points at (0.5, 0) and (0.5, 1).</p><p>🔴 Red dots are curve endpoints and 🟢 green dots are the control points.</p><h4>1.3 Form A Closed Figure To Fill Color</h4><p>To form a closed figure, we will draw lines connecting curve endpoints to (1, 1) and (0, 1).</p><figure><img alt="Screenshot" src="https://cdn-images-1.medium.com/max/379/0*U3dubCZ8wEo7OF3Q.png" /></figure><p>Hence, the complete path command is ⬇️</p><p>M 0 0.5 C 0.5 0 0.5 1 1 0.5 L 1 1 L 0 1 Z</p><pre>const curveDimension = {  start: { x: 0, y: 0.5 },  c1: { x: 0.5, y: 0 },  c2: { x: 0.5, y: 1 },  end: { x: 1, y: 0.5 },};</pre><p>React Native code to make curve using SVG ⬇️ .</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsnack.expo.dev%2Fembedded%2F%40rishabhrathod2012%2Fsvg-wave-%28bezier-curve-demo%29&amp;display_name=Expo+Snack&amp;url=https%3A%2F%2Fsnack.expo.dev%2F%40rishabhrathod2012%2Fsvg-wave-%28bezier-curve-demo%29&amp;image=https%3A%2F%2Fs3.amazonaws.com%2Fexp-brand-assets%2FSnackIcon_200.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=expo" width="700" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/145a1ec9e5e65f6126f685c274b1c2df/href">https://medium.com/media/145a1ec9e5e65f6126f685c274b1c2df/href</a></iframe><blockquote>To understand how the bezier curve works check out <a href="https://vimeo.com/106757336">this</a> video. To learn more about SVG path format read <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths">this</a>.</blockquote><h4>2. Get Device Orientation Values 📱</h4><p>We will use <a href="https://docs.expo.io/versions/latest/sdk/accelerometer/">expo-sensors&#39;s</a> accelerometer to get the values.</p><p>Let’s get the accelerometer (x,y,z) values and store them in the state variable orientation.</p><pre>import { Accelerometer } from &#39;expo-sensors&#39;;const Wave = () =&gt; { const [orientation, setOrientation] = useState({    x: 0,    y: 0,    z: 0,  }); useEffect(() =&gt; {    subscription.current = Accelerometer.addListener(({ x, y, z }) =&gt; {      setOrientation(() =&gt; ({        x: x,        y: y,        z: z,      }));    });    return () =&gt; subscription.current.remove();  }, []);}return &lt;View&gt;&lt;Text&gt;{orientation.x}Text&gt;View&gt;}</pre><figure><img alt="Phone" src="https://cdn-images-1.medium.com/max/240/0*mNpmQ7NcRvxztEnR.gif" /></figure><blockquote>Note: On tilting the phone left, the orientation.x value becomes positive and vice versa when tilting right.</blockquote><h4>3. Moving the Curve on Phone Tilt</h4><p>When a phone is tilted from the extreme left to the extreme right, the orientation.x value moves from a positive maximum to a negative maximum.</p><p>Accordingly, curve points coordinate move as shown below</p><figure><img alt="Screenshot" src="https://cdn-images-1.medium.com/max/1024/0*CN0YF0CQiWKNEq24.png" /></figure><p>When you go through the above 5 steps, you can notice</p><ol><li>The start point will move from (0,0) to (0,1).</li><li>The end point will move from (1,1) to (1,0).</li><li>Control points c1 moves from (0.25, 0.25) to (0.25, 0.75) and c2 from (0.75,0.75) to (0.75, 0.25).</li></ol><p><strong>X coordinates for all the curve points are kept constant.</strong></p><p>Let’s find the relation of the Y coordinates of the curve points and the orientation.x value.</p><h4>3.1 Start Point</h4><p>We will find the relation between orientation.x and the start point. For that, we need to remember the below points.</p><ul><li>When the phone is not tilted, the starting point stays at 0.5.</li><li>When titled right (negative orientation.x value) start point increases from 0.5 till 1 and similarly 0.5 to 0 when titled left (positive orientation.x value). Hence, we negate the orientation.x value.</li><li>Initial position of the start point is 0.5 when the orientation.x value is 0, so we will need to add 0.5 to the orientation.x value.</li></ul><p>const adjustAxis = (value) =&gt; 0.5 + (-value / 1.5);</p><p><strong>adjustAxis</strong> is a helper function to map orientation.x to the starting point&#39;s y value.</p><p>Hence, start.y = adjustAxis(orientation.x)</p><h4>3.2 End Point</h4><p>Since the end point is always opposite to the start point.</p><p>end.y = 1 - start.y</p><h4>3.3 Start Control Point c1</h4><p>After scratching the brain for a long 🤯, I came up with a linear equation that works fine for control points.</p><p>c1 = (start.y / 2) + 0.25</p><h4>3.4 Ending Control Point c2</h4><p>c2 = 1 - c1</p><h4><strong>🤫</strong> Enough Talking, Let’s Code It Down.</h4><pre>// startconst startY = adjustAxis(orientation.x);// initial control point c1 const startControlPointY = (adjustAxis(orientation.x) / 2) + 0.25;// curvePointsconst curveDimension = {  start: { x: 0, y: startY},   c1: { x: 0.4, y: startControlPointY},   c2: { x: 0.6, y: 1 - startControlPointY},   end: { x: 1, y: 1 - startY},};</pre><h4>4. Let’s Get Ready To Animate 🏋🏻‍♀️</h4><p>As our curve points are derived from the startY and startControlPointY.We will make startY and startControlPointY as<strong> </strong><a href="https://docs.swmansion.com/react-native-reanimated/docs/shared-values/"><strong>shared values</strong></a><strong> </strong>and curve point as <strong>derived value </strong>.</p><ul><li>Shared values can be understood as a replacement of Animated.Value with more benefits.</li><li>Derived values are similar to shared values whose value is derived from other shared values.</li></ul><pre>const startY = useSharedValue(0); const startControlPointY = useSharedValue(0);</pre><p><a href="https://docs.swmansion.com/react-native-reanimated/docs/api/useSharedValue/">useSharedValue</a> returns a reference to shared value initialized with the provided data. A reference is an object with .value property, that can be accessed and modified from worklets, but also updated directly from the main JS thread.</p><pre>const curveDimension = useDerivedValue(() =&gt; {    return {      start: { x: 0, y: startY.value },      c1: { x: 0.4, y: startControlPointY.value },      c2: { x: 0.6, y: 1 - startControlPointY.value },      end: { x: 1, y: 1 - startY.value },    };  });</pre><p><a href="https://docs.swmansion.com/react-native-reanimated/docs/api/useDerivedValue">useDerivedValue</a> allows for creating shared value reference that can change in response to updating of one or more other shared values.</p><h4>Create AnimatedPath</h4><p>As we will animate values supplied in the SVGpath, let’s first create an Component and replace it with .</p><pre>const AnimatedPath = Animated.createAnimatedComponent(Path);</pre><p>animatedProps returns an object with key d and value as SVG path.</p><pre>+ const animatedProps = useAnimatedProps(() =&gt; {+   const { start, c1, c2, end } = curveDimension.value;+   return {+      d: `M ${start.x} ${start.y} C ${c1.x} ${c1.y} ${c2.x} ${c2.y} ${end.x} ${end.y} L 1 1 L 0 + 1 Z`,+   };+ });- const staticPath = `M ${curveDimension.start.x} ${curveDimension.start.y} - C ${curveDimension.c1.x} ${curveDimension.c1.y} - ${curveDimension.c2.x} ${curveDimension.c2.y} - ${curveDimension.end.x} ${curveDimension.end.y} - L 1 1 L 0 1 Z`;</pre><p>Supply animatedProps instead of the d.</p><pre>- +       fill={&#39;#0099ff&#39;}-    d={d}+     animatedProps={animatedProps} /&gt;</pre><h4>5. Add Spring Animation</h4><p>We are using <a href="https://reactnative.dev/docs/animated#spring">spring animation</a> because it gives control over velocity, stiffness, friction which can be used to give a fluid property to the curve.</p><pre>startY.value = withSpring(adjustAxis(orientation.x), {    damping: 80,    mass: 1,    stiffness: 10,    restDisplacementThreshold: 0.0001,    restSpeedThreshold: 0.001,  });  const value = (adjustAxis(orientation.x) / 2) + 0.25;  startControlPointY.value = withSpring(value, {    easing: Easing.out(Easing.bounce),  });</pre><p><a href="https://docs.swmansion.com/react-native-reanimated/docs/api/withSpring">withSpring</a> is a reanimated hook to implement string physics-based animation.</p><p>And finally, we are done. 🥳 🎊</p><h4>This is how it looks ⬇️ .</h4><figure><img alt="Final" src="https://cdn-images-1.medium.com/max/400/0*8CIrkBfKp2lzVVvK.gif" /></figure><p>To play with it in the expo app <a href="https://expo.io/@rishabhrathod2012/projects/miui-wave-animation">click here</a> and if you are interested in improving it, check out the <a href="https://github.com/Rishabh-Rathod/Animation">complete code.</a></p><p>Hope you enjoyed this article and learned something new. 🙇‍♂️</p><p>Also, check out William Candillon’s Wave Animation <a href="https://www.youtube.com/watch?v=OU43e7TwlEY">Video</a> if you haven’t.</p><h4>Thank you for reading and would love to hear your suggestions to make it better. You can connect with me on <a href="https://twitter.com/Rathodris">Twitter</a>.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12b9d14163ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an admin panel using low code tools — Appsmith]]></title>
            <link>https://medium.com/@rishabhrathod01/building-an-admin-panel-using-low-code-tools-appsmith-c317650a8f2b?source=rss-824a15e3ba33------2</link>
            <guid isPermaLink="false">https://medium.com/p/c317650a8f2b</guid>
            <category><![CDATA[appsmith]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[internal-tools]]></category>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[store]]></category>
            <dc:creator><![CDATA[Rishabh Rathod]]></dc:creator>
            <pubDate>Mon, 16 Aug 2021 12:52:18 GMT</pubDate>
            <atom:updated>2021-08-16T14:13:43.271Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a store admin dashboard using Appsmith 🚀</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-TicWLXyVhsnh8ckw5T-Zw.png" /></figure><p>In the article, we will be building an admin dashboard that will help us manage the product data of a balloon’s store website.</p><figure><img alt="products.png" src="https://cdn-images-1.medium.com/max/1024/0*XNFB9v6AMJnZrfRo.png" /></figure><p>The above image is a website’s product page that fetches data from a google sheet acting as a database. Our admin dashboard will use google sheets APIs to modify data.</p><h4>Admin dashboard basic features:-</h4><ol><li>Create a new product. ( Insert a row )</li><li>Modify existing product details. (modify a row)</li><li>Remove product. (delete a row )</li></ol><figure><img alt="image.png" src="https://cdn-images-1.medium.com/max/1024/0*vXHU5zKt5ptDSeny.png" /></figure><p>We will use appsmith’s platform to build this dashboard.</p><h4>🤔 What is Appsmith?</h4><p>Appsmith is an open-source framework to build admin panels, CRUD apps, and workflows. Build everything you need, 10x faster.</p><p>sounds cool? Let’s build and see.</p><h4>1. Create a datasource 💽</h4><p>In this case, datasource is a google sheet so let&#39;s create a new sheet.</p><figure><img alt="Screenshot 2021-06-15 at 12.19.32 PM.png" src="https://cdn-images-1.medium.com/max/1024/0*Y0xvN-cm1HtGjx86.png" /></figure><p>here we created a sheet for products with the column as</p><pre>&quot;product_id&quot; ,  // unique id <br>&quot;category_type&quot;, // product categories type like &quot;BALLOON&quot; or &quot;FIREWORKS&quot; or some other<br>&quot;product_name&quot;, // name of the product<br>&quot;product_desp&quot; , // about the product<br>&quot;product_cost&quot; , // cost of the product<br>&quot;product_stock&quot;, // stock quantity of product <br>&quot;product_img_link&quot; // image url</pre><h4>2. Integrate datasource to appsmith app</h4><p>when you create a new appsmith app, you will find yourself here.</p><figure><img alt="image.png" src="https://cdn-images-1.medium.com/max/1024/0*h-kiE6pVmUuojjzV.png" /></figure><p>Click on Import APIs -&gt; Choose Google Sheet -&gt; Fill in the details. It will add google sheet as a datasource and route to create a new API.</p><blockquote>Refer <a href="https://docs.appsmith.com/datasource-reference/querying-google-sheets">Appsmith’s docs</a> to know more about google sheet integration.</blockquote><h4>3. Fetch data and generate widget to show UI</h4><p>To get all the rows of the products sheet fill in the details as following</p><ul><li>methods: fetch sheet rows</li><li>spreadsheet URL: paste your google sheet URL</li><li>sheet name: products</li></ul><figure><img alt="Untitled design.png" src="https://cdn-images-1.medium.com/max/1024/0*kvGfLmaNvJy_JsuN.png" /></figure><p>After a successful response from the API, click on Generate Widget to create a table rendering response data in a table.</p><h4>4. Modify data using Form 🔨</h4><p>To create or update data in a row we will create a Form widget with an input field for each row of data respective to its type.</p><figure><img alt="image.png" src="https://cdn-images-1.medium.com/max/1024/0*TKzNJDobiYUAlqN6.png" /></figure><p>here I have created a Form called Modify Product with input field as follows -</p><pre>// widget_name `&lt;WidgetType&gt;` = null<br>- Product Image `&lt;Image&gt;`  =  `null`<br>- ImageURLInput  `&lt;Text&gt;` = `null`<br>- product_name_input `&lt;Text&gt;` = `null`<br>- product_category_input `&lt;Select&gt;` = `null`<br>- product_desc_input `&lt;Text&gt;` = `null`<br>- product_stock_input `&lt;Text&gt;` = `null`<br>- product_cost_input `&lt;Text&gt;` = `null`<br>- product_row_index `&lt;Text&gt;` = `null`</pre><p>Refer to the <a href="https://docs.appsmith.com/widget-reference/table">docs</a> if you aren’t familiar with `read` value syntax like productTable.selectedRow.column_name mentioned above.</p><p>appsmith.store.uploaded_image_link is used to read a value from the appsmith store.</p><p>Check more about the appsmith store <a href="https://docs.appsmith.com/framework-reference/store-value">here</a>.</p><h4>Create a new row</h4><p>When a table row is not selected, we would assume that the user will fill Form to create a new product i.e., a new row. In that case, we will need to create an API to insert a new row in google sheets.</p><ul><li>createProduct API</li></ul><figure><img alt="image.png" src="https://cdn-images-1.medium.com/max/746/0*l4xgA9nunC0o92g5.png" /></figure><h4>Update an existing row</h4><ul><li>updateProduct API</li></ul><figure><img alt="image.png" src="https://cdn-images-1.medium.com/max/736/0*Y_N8SCOHMPtwZVwC.png" /></figure><p>After both the APIs are created successfully. Now on click of the Submit button in Form, we would call these APIs according to the task.</p><p>Submit Button&#39;s onClick actions :-</p><pre>onClick = {{<br>Number(product_row_index.text) &lt;= productTable.tableData.length - 1 ? <br>updateProduct.run(<br>    // After successful  <br>	() =&gt; getProducts.run(<br>    // clear<br>	   () =&gt; storeValue(&quot;uploaded_image_link&quot;,&quot;&quot;)  <br>), () =&gt; {})<br>: createProduct.run(<br>	() =&gt; getProducts.run(<br>		() =&gt; storeValue(&quot;uploaded_image_link&quot;,&quot;&quot;) <br>), () =&gt; {})<br>}}</pre><h4>To Delete an existing row</h4><p>Create a delete button inside the table as a new column and on click of which call deleteProductAPI</p><ul><li>deleteProduct API</li></ul><figure><img alt="Screenshot 2021-06-20 at 12.16.40 PM.png" src="https://cdn-images-1.medium.com/max/1024/0*2YhhQ1jqx6_ygy5u.png" /></figure><h4>5. Upload Image using Cloudinary 🌩</h4><p>To upload an image to appsmith, we will use the Filepicker widget as shown below.</p><figure><img alt="Screenshot 2021-06-17 at 12.19.38 AM.png" src="https://cdn-images-1.medium.com/max/1024/0*D7S4n2a8QeNhDWwo.png" /></figure><p>After this, I preferred adding an upload button separately on click of which we will upload selected image to cloudinary.</p><p>Now let’s create an account in cloudinary and get your cloud_name and upload_preset which can be used to upload images using appsmith.</p><figure><img alt="Screenshot 2021-06-17 at 12.26.27 AM.png" src="https://cdn-images-1.medium.com/max/1024/0*mLyopS3nJ_f5MiFv.png" /></figure><p>Now let’s create an API to upload the image.</p><ul><li>uploadImageAPI</li></ul><p>Fill in the details as shown below. FilePicker1 is a reference to the FilePicker widget.</p><figure><img alt="Screenshot 2021-06-17 at 12.18.00 AM.png" src="https://cdn-images-1.medium.com/max/1024/0*2yZA4G_myr3iUlCx.png" /></figure><p>Now, we can run uploadImageAPI when the upload Image button is clicked.</p><pre>onClick = {{ <br>  uploadImageAPI.run(<br>    (response) =&gt; {<br>      /* onSuccess */<br>      storeValue(&quot;uploaded_image_link&quot;,response.url);<br>      // here, we store the value which is then read using {{appsmith.store.uploaded_image_link}}<br>    },<br>    (response) =&gt; {<br>      /* onError */<br>    },<br>  )<br>}}</pre><p>And it’s done. 🎉🥳</p><figure><img alt="Screenshot 2021-06-20 at 12.25.22 PM.png" src="https://cdn-images-1.medium.com/max/1024/0*vGLqr_4cJEH1ryP0.png" /></figure><p>That’s how it looks. 🧐🤩</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c317650a8f2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>