Skip to content

Commit

Permalink
Fix/improve domains & websites
Browse files Browse the repository at this point in the history
  • Loading branch information
philogicae committed May 13, 2024
1 parent 696136f commit 2941d4b
Show file tree
Hide file tree
Showing 21 changed files with 19,632 additions and 8,124 deletions.
27,159 changes: 19,188 additions & 7,971 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"@aleph-front/core": "^1.16.5",
"@aleph-sdk/account": "^1.0.3",
"@aleph-sdk/avalanche": "^1.0.3",
"@aleph-sdk/client": "^1.0.3",
"@aleph-sdk/client": "^1.0.4",
"@aleph-sdk/core": "^1.0.3",
"@aleph-sdk/ethereum": "^1.0.3",
"@aleph-sdk/evm": "^1.0.3",
"@aleph-sdk/message": "^1.0.3",
"@aleph-sdk/solana": "^1.0.3",
"@aleph-sdk/superfluid": "^1.0.3",
"@aleph-sdk/superfluid": "^1.0.4",
"@fortawesome/fontawesome-svg-core": "^6.3.0",
"@hookform/resolvers": "^3.1.1",
"@superfluid-finance/sdk-core": "^0.6.12",
Expand All @@ -32,6 +32,7 @@
"eslint-config-next": "13.2.1",
"ethers": "^5.7.2",
"jszip": "^3.10.1",
"multiformats": "^13.1.0",
"next": "^13.3.0",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/components/pages/configure/NewDomainPage/cmp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function NewDomain() {
errors,
handleSubmit,
setTarget,
setRef,
} = useNewDomainPage()

const [tabId, setTabId] = useState('website')
Expand All @@ -35,6 +36,7 @@ export default function NewDomain() {
: 'function'

const onTabChange = (tabId: string) => {
setRef('')
setTabId(tabId)
if (['website', 'ipfs'].includes(tabId)) {
setTarget(EntityDomainType.IPFS)
Expand Down
15 changes: 13 additions & 2 deletions src/components/pages/dashboard/AllTabContent/cmp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,25 @@ export const AllTabContent = React.memo(({ data }: AllTabContentProps) => {
label: 'Name',
width: '100%',
sortable: true,
render: (row) => row.name,
render: (row) => row.name || row.id,
},
{
label: 'Size',
align: 'right',
sortable: true,
render: (row) =>
humanReadableSize(row.size || row.volume?.size, 'MiB'),
row.type !== EntityType.Website ? (
humanReadableSize(row.size, 'MiB')
) : (
<ButtonLink
kind="functional"
variant="none"
size="sm"
href={row.url ?? ''}
>
<Icon name="square-up-right" size="lg" />
</ButtonLink>
),
},
{
label: 'Date',
Expand Down
42 changes: 32 additions & 10 deletions src/components/pages/dashboard/ManageDomain/cmp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import IconText from '@/components/common/IconText'
import { Label, NoisyContainer } from '@aleph-front/core'
import { EntityTypeName, EntityDomainType } from '@/helpers/constants'
import {
EntityType,
EntityTypeName,
EntityDomainType,
EntityDomainTypeName,
} from '@/helpers/constants'
import { BulletItem, Button, Icon, Tag, TextGradient } from '@aleph-front/core'
import { useManageDomain } from '@/hooks/pages/solutions/manage/useManageDomain'
import { ellipseAddress, ellipseText, toPascalCase } from '@/helpers/utils'
Expand Down Expand Up @@ -235,12 +240,11 @@ export default function ManageDomain() {
</>
)}

{refEntity && (
{refEntity ? (
<>
<Separator />

<TextGradient type="h7" as="h2" color="main0">
Linked {domain.target}
Linked {EntityDomainTypeName[domain.target]}
</TextGradient>

<div tw="my-5">
Expand All @@ -253,28 +257,46 @@ export default function ManageDomain() {
<div tw="my-5">
<div className="tp-info text-main0">NAME</div>
<div>
<Text>
{(refEntity?.metadata?.name as string) || refEntity.id}
</Text>
<Text>{refEntity.id}</Text>
</div>
</div>

<div tw="my-5">
<div className="tp-info text-main0">EXPLORER</div>
<div>
<a
className="tp-body1 fs-16"
href={refEntity.url}
href={
refEntity.type !== EntityType.Website
? refEntity.url
: refEntity.volume?.url
}
target="_blank"
referrerPolicy="no-referrer"
>
<IconText iconName="square-up-right">
<Text>{ellipseText(refEntity.url, 80)}</Text>
<Text>
{ellipseText(
refEntity.type !== EntityType.Website
? refEntity.url
: refEntity.volume?.url || '',
80,
)}
</Text>
</IconText>
</a>
</div>
</div>
</>
) : (
<>
<Separator />
<TextGradient type="h7" as="h2" color="main0">
Linked Resource
</TextGradient>
<Text>
The target resource is missing or has been deleted.{' '}
</Text>
</>
)}
</NoisyContainer>

Expand Down
6 changes: 3 additions & 3 deletions src/components/pages/dashboard/ManageFunction/cmp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { RotatingLines } from 'react-loader-spinner'
import { useTheme } from 'styled-components'

export default function ManageFunction() {
const { func, handleCopyHash, handleDelete, copyAndNotify } =
const { func, handleCopyHash, handleDelete, handleDownload, copyAndNotify } =
useManageFunction()

const theme = useTheme()
Expand Down Expand Up @@ -57,7 +57,7 @@ export default function ManageFunction() {
</Label>
</div>
<div>
{/* <Button
<Button
size="md"
variant="tertiary"
color="main0"
Expand All @@ -67,7 +67,7 @@ export default function ManageFunction() {
onClick={handleDownload}
>
Download
</Button> */}
</Button>
<Button
kind="functional"
variant="warning"
Expand Down
Loading

0 comments on commit 2941d4b

Please sign in to comment.