Skip to content

Commit d835f26

Browse files
authored
Merge pull request #13 from HellBus1/bug-fix-nan-input
bugfix : nan input
2 parents fd18f81 + 521f959 commit d835f26

File tree

8 files changed

+380
-105
lines changed

8 files changed

+380
-105
lines changed

package-lock.json

Lines changed: 72 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "investcount",
33
"private": false,
4-
"version": "1.1.2",
4+
"version": "1.1.3",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -24,6 +24,7 @@
2424
},
2525
"pre-commit": "lint-staged",
2626
"dependencies": {
27+
"motion": "^12.6.2",
2728
"react": "^18.3.1",
2829
"react-dom": "^18.3.1",
2930
"react-router-dom": "^6.26.2",

src/components/DepositRateComparisonSection/DepositRateComparisonSection.tsx

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { motion } from 'framer-motion' // Import Framer Motion
12
import React, { useState, useEffect, useCallback, useMemo } from 'react'
23
import {
34
BarChart,
@@ -153,15 +154,42 @@ const DepositRateComparisonSection = () => {
153154
}, [])
154155

155156
return (
156-
<div className='py-10 bg-base-200 min-h-screen w-full'>
157-
<h1 className='text-center text-2xl md:text-3xl font-bold text-charter-blue-600 mt-8 mb-4'>
157+
<motion.div
158+
className='py-10 bg-base-200 min-h-screen w-full'
159+
initial='hidden'
160+
whileInView='visible'
161+
viewport={{ once: true, amount: 0.2 }}
162+
variants={{
163+
hidden: { opacity: 0, y: 20 },
164+
visible: { opacity: 1, y: 0, transition: { duration: 0.8, staggerChildren: 0.2 } }
165+
}}
166+
>
167+
<motion.h1
168+
className='text-center text-2xl md:text-3xl font-bold text-charter-blue-600 mt-8 mb-4'
169+
variants={{
170+
hidden: { opacity: 0, y: 20 },
171+
visible: { opacity: 1, y: 0, transition: { duration: 0.6 } }
172+
}}
173+
>
158174
Deposit Rate Comparison
159-
</h1>
160-
<p className='text-center text-charter-blue text-lg md:text-xl mx-4 md:mx-20 lg:mx-36 mb-16'>
175+
</motion.h1>
176+
<motion.p
177+
className='text-center text-charter-blue text-lg md:text-xl mx-4 md:mx-20 lg:mx-36 mb-16'
178+
variants={{
179+
hidden: { opacity: 0, y: 20 },
180+
visible: { opacity: 1, y: 0, transition: { duration: 0.6 } }
181+
}}
182+
>
161183
Compare the deposit rates of different Indonesian banks based on the selected tenure and
162184
minimum balance. Select a tenure and minimum balance to see the corresponding rates.
163-
</p>
164-
<div className='mb-8 flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4 justify-center items-center'>
185+
</motion.p>
186+
<motion.div
187+
className='mb-8 flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4 justify-center items-center'
188+
variants={{
189+
hidden: { opacity: 0, y: 20 },
190+
visible: { opacity: 1, y: 0, transition: { duration: 0.6 } }
191+
}}
192+
>
165193
<div>
166194
<label
167195
htmlFor='tenure'
@@ -222,12 +250,26 @@ const DepositRateComparisonSection = () => {
222250
<option value='rate'>Rate</option>
223251
</select>
224252
</div>
225-
</div>
253+
</motion.div>
226254
{loading ? (
227-
<p className='text-charter-blue'>Loading...</p>
255+
<motion.p
256+
className='text-charter-blue'
257+
variants={{
258+
hidden: { opacity: 0 },
259+
visible: { opacity: 1, transition: { duration: 0.6 } }
260+
}}
261+
>
262+
Loading...
263+
</motion.p>
228264
) : (
229-
<div className='mx-4 md:mx-20 lg:mx-36 mb-10'>
230-
<ResponsiveContainer width='100%' height={600} className={''}>
265+
<motion.div
266+
className='mx-4 md:mx-20 lg:mx-36 mb-10'
267+
variants={{
268+
hidden: { opacity: 0, y: 20 },
269+
visible: { opacity: 1, y: 0, transition: { duration: 0.8 } }
270+
}}
271+
>
272+
<ResponsiveContainer width='100%' height={600}>
231273
<BarChart
232274
data={data}
233275
layout='vertical'
@@ -236,7 +278,7 @@ const DepositRateComparisonSection = () => {
236278
<XAxis
237279
type='number'
238280
label={{ value: EMPTY_STRING }}
239-
tick={{ fontSize: 14, fontWeight: 'bold', fill: CHARTER_BLUE, dy: 5 }}
281+
tick={{ fontSize: 14, fontWeight: 'bold', fill: CHARTER_BLUE, dy: 6 }}
240282
/>
241283
<YAxis type='category' dataKey='bank' tick={renderCustomYAxisTick} width={125} />
242284
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
@@ -253,9 +295,9 @@ const DepositRateComparisonSection = () => {
253295
</Bar>
254296
</BarChart>
255297
</ResponsiveContainer>
256-
</div>
298+
</motion.div>
257299
)}
258-
</div>
300+
</motion.div>
259301
)
260302
}
261303

0 commit comments

Comments
 (0)