diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 5faa7488..7b2c5029 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -5,6 +5,7 @@ import HomeLayout from './components/Layout/Home' import HomePage from './pages/Home' import LaunchPage from './pages/Launch' import ManagePage from './pages/Manage' +import ScreenPage from './pages/Screen' const router = createBrowserRouter([ { @@ -31,6 +32,14 @@ const router = createBrowserRouter([ ), }, + { + path: '/screen', + element: ( + + + + ), + }, ]) export default function App() { diff --git a/frontend/src/components/NavBar/index.tsx b/frontend/src/components/NavBar/index.tsx index 98474371..b1de9723 100644 --- a/frontend/src/components/NavBar/index.tsx +++ b/frontend/src/components/NavBar/index.tsx @@ -16,6 +16,10 @@ export const links = [ name: 'Manage', path: '/manage', }, + { + name: 'Screen', + path: '/screen', + }, ] export default function NavBar() { diff --git a/frontend/src/pages/Screen/index.tsx b/frontend/src/pages/Screen/index.tsx new file mode 100644 index 00000000..5ad15041 --- /dev/null +++ b/frontend/src/pages/Screen/index.tsx @@ -0,0 +1,120 @@ +import { useCallback, useState } from 'react' +import { SecondaryButton } from 'src/components/Button' +import Box from 'src/theme/components/Box' +import { Column, Row } from 'src/theme/components/Flex' +import * as Text from 'src/theme/components/Text' + +import * as styles from './style.css' + +// ... existing code ... + +export default function ScreenPage() { + const [tokenAddress, setTokenAddress] = useState('') + const [checkResult, setCheckResult] = useState(null) + const [liquidityLockDuration, setLiquidityLockDuration] = useState(null) + const [maxHolders, setMaxHolders] = useState(null) + const [maxTransactionAmount, setMaxTransactionAmount] = useState(null) + const [hiddenMintFunctions, setHiddenMintFunctions] = useState(null) + const [permissionsAndLimitations, setPermissionsAndLimitations] = useState(null) + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + const checkSafety = useCallback(() => { + if (!tokenAddress) { + setError('Please enter a token address') + return + } + setError(null) // reset the error + setIsLoading(true) + setIsLoading(true) + setCheckResult(null) // reset the result + // reset other results + setLiquidityLockDuration(null) + setMaxHolders(null) + setMaxTransactionAmount(null) + setHiddenMintFunctions(null) + setPermissionsAndLimitations(null) + + setTimeout(() => { + // simulate a check operation + // for now, we'll just check if the token address is not empty + const result = tokenAddress ? 'Success' : 'Fail' + setCheckResult(result) + + // simulate other checks + setLiquidityLockDuration(365) // replace with actual calculation + setMaxHolders(1000) // replace with actual calculation + setMaxTransactionAmount(1000000) // replace with actual calculation + setHiddenMintFunctions(false) // replace with actual check + setPermissionsAndLimitations('None') // replace with actual calculation + setIsLoading(false) + }, 2500) + }, [tokenAddress]) + + return ( + + + + + + Token Address: + setTokenAddress(e.target.value)} + /> + + + Check Safety + {isLoading && ( +
+

via GIPHY

+ `, + }} + /> + )} + {error && {error}} + {checkResult && Check Result: {checkResult}} + {checkResult === 'Fail' && ( +
+

via GIPHY

+ `, + }} + /> + )} + {liquidityLockDuration !== null && ( + + Liquidity Lock Duration: + {liquidityLockDuration} days + + )} + {maxHolders !== null && Maximum Number of Holders: {maxHolders}} + {maxTransactionAmount !== null && ( + + Maximum Transaction Amount: + {maxTransactionAmount} + + )} + {hiddenMintFunctions !== null && ( + + Hidden Mint Functions: + {hiddenMintFunctions ? 'Yes' : '❌No'} + + )} + {permissionsAndLimitations !== null && ( + + Permissions and Limitations: + {permissionsAndLimitations} + + )} + + + + + ) +} diff --git a/frontend/src/pages/Screen/style.css.ts b/frontend/src/pages/Screen/style.css.ts new file mode 100644 index 00000000..2e96aac0 --- /dev/null +++ b/frontend/src/pages/Screen/style.css.ts @@ -0,0 +1,80 @@ +import { style } from '@vanilla-extract/css' +import { sprinkles } from 'src/theme/css/sprinkles.css' + +export const wrapper = style([ + { + padding: '68px 0px', + }, + sprinkles({ + width: 'full', + justifyContent: 'center', + }), +]) + +export const container = style([ + { + padding: '16px 12px 12px', + }, + sprinkles({ + maxWidth: '480', + width: 'full', + background: 'bg2', + borderRadius: '10', + }), +]) + +export const deployButton = style([ + { + ':disabled': { + opacity: '0.5', + }, + }, + sprinkles({ + fontSize: '24', + fontWeight: 'bold', + }), +]) + +export const inputLabel = sprinkles({ + marginLeft: '8', + fontWeight: 'medium', +}) + +export const errorContainer = sprinkles({ + paddingX: '8', + paddingTop: '4', + color: 'error', +}) + +export const inputContainer = sprinkles({ + display: 'flex', + alignItems: 'center', + borderRadius: '10', + borderWidth: '1px', + borderStyle: 'solid', + overflow: 'hidden', + padding: '12', + fontSize: '16', + color: 'white', + borderColor: { + default: 'border1', + hover: 'accent', + }, + gap: '8', + transitionDuration: '125', + backgroundColor: 'bg1', +}) + +export const input = sprinkles({ + fontSize: '16', + position: 'relative', + whiteSpace: 'nowrap', + outline: 'none', + color: { + default: 'text1', + placeholder: 'text2', + }, + background: 'none', + border: 'none', + width: 'full', +})