diff --git a/app/layout.tsx b/app/layout.tsx
index 0ccf9e5..364e640 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -3,16 +3,14 @@ import { Hanken_Grotesk } from 'next/font/google'
import '@/styles/globals.css'
import '@/styles/loading-ui.css'
import Script from 'next/script'
+import { title, description } from '@/constants'
const hankenGrotesk = Hanken_Grotesk({
subsets: ['latin'],
variable: '--font-hanken-grotesk'
})
-export const metadata: Metadata = {
- title: 'ASI Calculator',
- description: 'See how much ASI you get for your OCEAN, AGIX, or FET.'
-}
+export const metadata: Metadata = { title, description }
export default function RootLayout({
children
diff --git a/app/page.tsx b/app/page.tsx
index bad550e..79f0236 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -1,9 +1,7 @@
import styles from './page.module.css'
import { Swap, Buy } from '@/features/strategies'
-import { Content } from '@/components/Content'
-import { Header } from '@/components/Header'
-import { Footer } from '@/components/Footer'
import { MarketData } from '@/features/prices'
+import { Content, Footer, Header } from '@/components'
export default function Home() {
return (
diff --git a/components/Header/Header.tsx b/components/Header/Header.tsx
index 7e150b7..78c7e33 100644
--- a/components/Header/Header.tsx
+++ b/components/Header/Header.tsx
@@ -1,11 +1,11 @@
-import { metadata } from '@/app/layout'
+import { title, description } from '@/constants'
import styles from './Header.module.css'
export function Header() {
return (
)
}
diff --git a/features/strategies/components/FormAmount/Inputs/InputAmount.module.css b/components/Input/Input.module.css
similarity index 100%
rename from features/strategies/components/FormAmount/Inputs/InputAmount.module.css
rename to components/Input/Input.module.css
diff --git a/components/Input/Input.tsx b/components/Input/Input.tsx
new file mode 100644
index 0000000..90969ad
--- /dev/null
+++ b/components/Input/Input.tsx
@@ -0,0 +1,8 @@
+import { InputHTMLAttributes } from 'react'
+import styles from './Input.module.css'
+
+type Props = InputHTMLAttributes
+
+export function Input(props: Props) {
+ return
+}
diff --git a/components/Input/index.tsx b/components/Input/index.tsx
new file mode 100644
index 0000000..54e51f6
--- /dev/null
+++ b/components/Input/index.tsx
@@ -0,0 +1 @@
+export * from './Input'
diff --git a/components/index.tsx b/components/index.tsx
new file mode 100644
index 0000000..caafba3
--- /dev/null
+++ b/components/index.tsx
@@ -0,0 +1,7 @@
+export * from './Content'
+export * from './Footer'
+export * from './Header'
+export * from './Input'
+export * from './Label'
+export * from './Select'
+export * from './TokenLogo'
diff --git a/constants.ts b/constants.ts
index 9705db9..a384df9 100644
--- a/constants.ts
+++ b/constants.ts
@@ -1,5 +1,9 @@
import { Token } from '@/types'
+export const title = 'ASI Calculator'
+export const description =
+ 'See how much ASI you get for your OCEAN, AGIX, or FET.'
+
export const ratioOceanToAsi = 0.433226
export const ratioAgixToAsi = 0.43335
export const ratioFetToAsi = 1
diff --git a/features/prices/components/MarketData/MarketData.tsx b/features/prices/components/MarketData/MarketData.tsx
index d2364a6..c388866 100644
--- a/features/prices/components/MarketData/MarketData.tsx
+++ b/features/prices/components/MarketData/MarketData.tsx
@@ -2,8 +2,8 @@
import { ratioOceanToAsi, ratioAgixToAsi, ratioFetToAsi } from '@/constants'
import styles from './MarketData.module.css'
-import { usePrices } from '@/features/prices/hooks'
-import { Label } from '@/components/Label'
+import { usePrices } from '@/features/prices'
+import { Label } from '@/components'
export function MarketData() {
const { prices, isValidating, isLoading } = usePrices()
diff --git a/features/prices/hooks/index.ts b/features/prices/hooks/index.tsx
similarity index 100%
rename from features/prices/hooks/index.ts
rename to features/prices/hooks/index.tsx
diff --git a/features/prices/hooks/use-prices.tsx b/features/prices/hooks/use-prices.tsx
index 9a3e743..7bea155 100644
--- a/features/prices/hooks/use-prices.tsx
+++ b/features/prices/hooks/use-prices.tsx
@@ -1,3 +1,5 @@
+'use client'
+
import { tokens } from '@/constants'
import { fetcher, getTokenAddressBySymbol } from '@/lib/utils'
import useSWR from 'swr'
diff --git a/features/strategies/components/FormAmount/FormAmount.tsx b/features/strategies/components/FormAmount/FormAmount.tsx
index 02ae5d0..a8b8e09 100644
--- a/features/strategies/components/FormAmount/FormAmount.tsx
+++ b/features/strategies/components/FormAmount/FormAmount.tsx
@@ -1,8 +1,7 @@
-import { InputAmount } from './Inputs/InputAmount'
import styles from './FormAmount.module.css'
import { Dispatch, SetStateAction } from 'react'
import { TokenSymbol } from '@/types'
-import { Select } from '@/components/Select'
+import { Select, Input } from '@/components'
export function FormAmount({
amount,
@@ -17,6 +16,16 @@ export function FormAmount({
setToken?: Dispatch>
isFiat?: boolean
}) {
+ function handleAmountChange(e: React.ChangeEvent) {
+ const { value } = e.target
+
+ if (value === '') {
+ setAmount(0)
+ } else {
+ setAmount(Number(value))
+ }
+ }
+
function handleTokenChange(e: React.ChangeEvent) {
if (!setToken) return
setToken(e.target.value as TokenSymbol)
@@ -32,7 +41,16 @@ export function FormAmount({
return (