diff --git a/Makefile b/Makefile index e0bd7d8..c977d58 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,5 @@ +token: + yarn remove crypto-token-icon && yarn add crypto-token-icon + push: npm version patch && npm publish \ No newline at end of file diff --git a/README.md b/README.md index 9f468c4..1248c6c 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,12 @@ ```bash yarn add @auxo-dev/frontend-common ``` + +## Add image in public folder + +``` +/images/default_banner.png +/images/default_avatar.png +/images/bgheader1.png +/images/LOGO_ICON_2D.png +``` diff --git a/lib/components/Avatar/Avatar.tsx b/lib/components/Avatar/Avatar.tsx new file mode 100644 index 0000000..42dc61d --- /dev/null +++ b/lib/components/Avatar/Avatar.tsx @@ -0,0 +1,62 @@ +import { Box, Typography } from '@mui/material'; +import { AddAPhotoRounded } from '@mui/icons-material'; + +export type TAvatarProps = { + src?: string; + alt?: string; + size: number; + onChange?: (file: FileList | null) => void; +}; +export function Avatar({ alt = 'user avatar', src, size, onChange }: TAvatarProps) { + function changeInput(file: FileList | null) { + onChange + ? onChange(file) + : () => { + return; + }; + } + return ( + + {alt} + + + + Change Avatar + + + changeInput(e.target.files)} + type="file" + style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', borderRadius: '50%', cursor: 'pointer', opacity: 0 }} + /> + + ); +} diff --git a/lib/components/Avatar/index.ts b/lib/components/Avatar/index.ts new file mode 100644 index 0000000..27700fe --- /dev/null +++ b/lib/components/Avatar/index.ts @@ -0,0 +1 @@ +export * from './Avatar'; diff --git a/lib/components/BoxPrivateData/BoxPrivateData.tsx b/lib/components/BoxPrivateData/BoxPrivateData.tsx new file mode 100644 index 0000000..9104069 --- /dev/null +++ b/lib/components/BoxPrivateData/BoxPrivateData.tsx @@ -0,0 +1,32 @@ +import { Box, SxProps, Typography } from '@mui/material'; +import { IconSpinLoading } from '../../icons'; +import { ReactNode } from 'react'; +import { useAccount } from 'wagmi'; +import { ButtonConnectWallet } from '../ButtonConnectWallet'; + +export function BoxPrivateData({ children, iconLoadingProps }: { children?: ReactNode; iconLoadingProps?: SxProps }) { + const { address: userAddress, isConnecting } = useAccount(); + + if (isConnecting) { + return ( + + + + ); + } + return ( + + {userAddress ? ( + children + ) : ( + + logo auxo + + Connect wallet to continute! + + + + )} + + ); +} diff --git a/lib/components/BoxPrivateData/index.ts b/lib/components/BoxPrivateData/index.ts new file mode 100644 index 0000000..14d5a82 --- /dev/null +++ b/lib/components/BoxPrivateData/index.ts @@ -0,0 +1 @@ +export * from './BoxPrivateData'; diff --git a/lib/components/ButtonConnectWallet/ButtonConnectWallet.tsx b/lib/components/ButtonConnectWallet/ButtonConnectWallet.tsx index d5db276..a4f4514 100644 --- a/lib/components/ButtonConnectWallet/ButtonConnectWallet.tsx +++ b/lib/components/ButtonConnectWallet/ButtonConnectWallet.tsx @@ -19,12 +19,8 @@ function NotconnectedButton() { const { openModal } = useModalFunction(); return ( <> - ); diff --git a/lib/components/ButtonLoading/ButtonLoading.tsx b/lib/components/ButtonLoading/ButtonLoading.tsx new file mode 100644 index 0000000..62f3d62 --- /dev/null +++ b/lib/components/ButtonLoading/ButtonLoading.tsx @@ -0,0 +1,18 @@ +import { Button, ButtonProps } from '@mui/material'; +import { IconSpinLoading } from '../../icons'; +import { ReactNode } from 'react'; + +type Props = { muiProps: ButtonProps; isLoading?: boolean; textLoading?: string; children: ReactNode }; +export function ButtonLoading({ muiProps, isLoading, textLoading, children }: Props) { + return ( + + ); +} diff --git a/lib/components/ButtonLoading/index.ts b/lib/components/ButtonLoading/index.ts new file mode 100644 index 0000000..977a89b --- /dev/null +++ b/lib/components/ButtonLoading/index.ts @@ -0,0 +1 @@ +export * from './ButtonLoading'; diff --git a/lib/components/ButtonSelectChain/ButtonSelectChain.tsx b/lib/components/ButtonSelectChain/ButtonSelectChain.tsx index f10d13f..19bdeb6 100644 --- a/lib/components/ButtonSelectChain/ButtonSelectChain.tsx +++ b/lib/components/ButtonSelectChain/ButtonSelectChain.tsx @@ -45,7 +45,7 @@ export function ButtonSelectChain() { ) : ( -