Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YongZL committed Jan 19, 2024
1 parent bb4839c commit d898d02
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
17 changes: 14 additions & 3 deletions app/blob-TX/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const BlobTX = () => {

const onSendTx = async () => {
if (!walletClient || !transData) return
setLoading({ loading: true })
const blobs = [transData.text, transData.img]
const { commitments, proofs, versionHashs, encodeBlobs } = await getConvertOfZkg(blobs)
const [account] = await walletClient.getAddresses()
Expand Down Expand Up @@ -205,6 +206,7 @@ const BlobTX = () => {
})
.then((r) => r.json())
.catch((e) => console.error(e))
setLoading({ loading: false, success: true })
}

const onSwitchTo = () => {
Expand Down Expand Up @@ -232,7 +234,10 @@ const BlobTX = () => {
<div className='rounded-lg border-[#FC7823] md:text-sm border h-[42px] items-center flex text-[#FC7823] px-[15px]'>
{address?.replace('••••', '.....')}
</div>
<div className='flex mr-10 mo:mr-0 gap-[13px] items-center'>
<div
onClick={() => window.open('https://blobscan-devnet.ethda.io/blobs', '_blank')}
className=' cursor-pointer flex mr-10 mo:mr-0 gap-[13px] items-center'
>
<img className='ml-5 mo:h-[32px]' src='deal.svg' />
<span className='text-[#FC7823] font-normal text-base'>History</span>
</div>
Expand All @@ -253,6 +258,7 @@ const BlobTX = () => {
<input
placeholder='Please Enter ...'
maxLength={40}
value={inputText}
onChange={(e) => setInputText(e.target.value)}
className=' mt-2 input-Text mo:w-full w-[425px] md:w-[380px] h-[55px] '
/>
Expand Down Expand Up @@ -313,7 +319,7 @@ const BlobTX = () => {
</div>

<ContentBox className='overflow-y-auto h-[442px] p-5 break-all whitespace-normal '>
{transData && <>{JSON.stringify(ub8a2numa(selectedBlob ? transData.text : transData.img))}</>}
{transData && transData.text && <>{JSON.stringify(ub8a2numa(selectedBlob ? transData.text : transData.img))}</>}
</ContentBox>
<div className='mt-5 mo:mt-[37px] flex justify-center mb-5 '>
<button
Expand Down Expand Up @@ -385,9 +391,14 @@ const BlobTX = () => {
{loading.loading && <LoadingFull />}
{loading.success && (
<SuccessFull
onLeftButton={() => {}}
onLeftButton={() => {
window.open('')
}}
onRightButton={() => {
setLoading({ success: false })
setInputText('')
setFile(null)
setTransData({ text: '', img: '', imgType: '' } as any)
}}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion components/ALoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const ALoading: FC<{ className: any }> = ({ className, ...other }) => {
<div {...other} className={classNames('text-black w-full h-full flex items-center justify-center', className)}>
<div className=' w-[400px] bg-white flex justify-center h-[340px]'>
<div className=' flex flex-col items-center w-full justify-center bg-[#FFFAF6] mx-[10px] my-[10px] border-dashed border rounded-xl border-[#FC7823]'>
<img src='loading.svg' />
<img src='loading.svg' className='animate-spin' />
<div className=' mt-5 font-medium text-xl text-[#FC7823] '>Sending</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Banner = () => {
<div className={'text-[70px] mo:text-[38px]'}>Availability Layer2</div>
<div className='mo:flex justify-center'>
<Link
href={'./docs/lightpaper.pdf'}
href={'https://docs.ethda.io/'}
target={'_blank'}
className={
'flex items-center justify-center w-[200px] h-[58px] border border-white rounded-[12px] font-semibold text-[20px] mo:text-2xl mt-8'
Expand Down
6 changes: 3 additions & 3 deletions components/FullModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const FullModal: FC<FullModalProps> = ({ menus, keys = 'text', onChooseItem, cho
if (item.onClick) {
item.onClick()
}
if (!item.to.startsWith('/')) {
if (item.to.startsWith('http')) {
window.open(item.to, '_blank')
return
}
Expand Down Expand Up @@ -64,14 +64,14 @@ const FullModal: FC<FullModalProps> = ({ menus, keys = 'text', onChooseItem, cho
<div className=' text-[22px] inline-block font-medium border-b border-[#D9D9D9] border-solid pb-5 w-full mo:flex mo:w-full items-center mo:justify-between'>
<span
className={classNames({
'text-[#FC7823]': item.to.startsWith('/') && pathname === item.to.split('/')[1],
'text-[#FC7823]': !item.to.startsWith('http') && pathname === item.to.split('/')[1],
})}
>
{item[keys]}
</span>
<RiArrowRightUpLine
className={classNames({
'text-[#FC7823]': pathname === item.to.split('/')[1],
'text-[#FC7823]': !item.to.startsWith('http') && pathname === item.to.split('/')[1],
})}
size={22}
/>
Expand Down
4 changes: 3 additions & 1 deletion components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export const Header: FC<HeaderType> = ({
]

const onSwitchTo = (address: string) => {
if (!address.startsWith('/')) {
console.log('addraddressess', address)

if (address.startsWith('http')) {
window.open(address, '_blank')
return
}
Expand Down

0 comments on commit d898d02

Please sign in to comment.