Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0381597
wip: credits dashboard
gmolki Aug 25, 2025
13c274e
wip: detail menu button
gmolki Aug 25, 2025
0a084e6
wip: submenu table fix
gmolki Sep 1, 2025
2874527
feat: toggle dashboard states
gmolki Sep 1, 2025
c5fef15
wip: checkout summary
gmolki Sep 2, 2025
3c174f7
use staging
gmolki Sep 2, 2025
092a9d3
fix: composite title
gmolki Sep 3, 2025
900a3f4
feat: instance page only use credit
gmolki Sep 3, 2025
ec28752
Merge branch 'main' into feat/credits-ui
gmolki Sep 9, 2025
7f8f4fc
fix: insufficient aleph to credits
gmolki Sep 9, 2025
c42deb8
feat: gpu instance credits
gmolki Sep 9, 2025
7406087
function with credits
gmolki Sep 9, 2025
21569fb
checkout button
gmolki Sep 10, 2025
fbf14d0
credit for entities
gmolki Sep 18, 2025
734c289
redirect to legacy console
gmolki Sep 30, 2025
caf8f54
fix credit entities
gmolki Sep 30, 2025
11f08b8
fix: build
gmolki Oct 1, 2025
8701ea3
deps: update core & message
gmolki Oct 1, 2025
c3befa4
refactor: constants urls
gmolki Oct 1, 2025
fcd8ad5
fix: show credits in account picker
gmolki Oct 1, 2025
66dc5eb
fix: comment purchases table
gmolki Oct 1, 2025
3298590
feat: remove vouchers
gmolki Oct 2, 2025
5e54b6e
disabled non-credit instances list
gmolki Oct 2, 2025
60225ca
disable non-credit enities list
gmolki Oct 2, 2025
3cff83a
disable functions
gmolki Oct 2, 2025
d49a0fa
fix: round credits
gmolki Oct 6, 2025
3596fe9
fix: disable top up on account picker
gmolki Oct 6, 2025
518d1dd
fix: executable actions
gmolki Oct 6, 2025
f2ed463
feat: ipv4 & ipv6 tab
gmolki Oct 6, 2025
0199143
fix: remove 150000 fallback
gmolki Oct 6, 2025
066995d
disable nav items
gmolki Oct 6, 2025
3413c3f
fix: remove checkout margin
gmolki Oct 6, 2025
36529ff
fix: port forwarding tooltip postitio
gmolki Oct 6, 2025
27a9f3a
update copies
gmolki Oct 7, 2025
be391b3
remove unused const
gmolki Oct 7, 2025
070fedb
use price cmp
gmolki Oct 7, 2025
de8b777
price estimation loading stte
gmolki Oct 7, 2025
fef0a91
remove console logs
gmolki Oct 7, 2025
ca95d0e
filter nodes by version
gmolki Oct 8, 2025
a750008
feat: handle cannot start due insufficient credits
gmolki Oct 8, 2025
1b8d96f
refactor: show stopped on cannot start
gmolki Oct 10, 2025
4da16b2
production variables
gmolki Oct 10, 2025
3613c6e
Merge branch 'main' into feat/credits-ui
gmolki Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"lint:fix": "next lint --fix"
},
"dependencies": {
"@aleph-front/core": "^1.29.1",
"@aleph-front/core": "^1.30.2",
"@aleph-sdk/account": "^1.2.0",
"@aleph-sdk/avalanche": "^1.5.0",
"@aleph-sdk/client": "^1.4.5",
"@aleph-sdk/core": "^1.6.2",
"@aleph-sdk/ethereum": "^1.5.0",
"@aleph-sdk/evm": "^1.6.2",
"@aleph-sdk/message": "^1.6.2",
"@aleph-sdk/message": "^1.6.3",
"@aleph-sdk/solana": "^1.6.2",
"@aleph-sdk/superfluid": "^1.4.5",
"@fortawesome/fontawesome-svg-core": "^6.3.0",
Expand Down
3 changes: 3 additions & 0 deletions src/components/common/BorderBox/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const BorderBox = styled.div<{
backdrop-filter: blur(50px);
color: ${theme.color.text}b3;

background: linear-gradient(90deg, ${g0}1a 0%, ${g1}1a 100%);

&::before {
content: '';
position: absolute;
Expand All @@ -33,6 +35,7 @@ export const BorderBox = styled.div<{
-webkit-mask-composite: exclude;
mask-composite: exclude;
-webkit-mask-composite: xor;

background-image: linear-gradient(90deg, ${g0} 0%, ${g1} 100%);
}
`
Expand Down
26 changes: 24 additions & 2 deletions src/components/common/ButtonLink/cmp.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { memo } from 'react'
import { memo, useEffect, useRef, useState } from 'react'
import Link from 'next/link'
import { Button } from '@aleph-front/core'
import { ButtonLinkProps } from './types'
import ResponsiveTooltip from '../ResponsiveTooltip'

/**
* A wrapper for the nextjs links that are styled as buttons
Expand All @@ -14,9 +15,19 @@ export const ButtonLink = ({
kind = 'default',
size = 'md',
disabled,
disabledMessage,
tooltipPosition,
children,
...rest
}: ButtonLinkProps) => {
const targetRef = useRef<HTMLButtonElement>(null)

// Wait until after client-side hydration to show tooltip
const [renderTooltip, setRenderTooltip] = useState(false)
useEffect(() => {
setRenderTooltip(true)
}, [])

const buttonNode = (
<Button
{...{
Expand All @@ -26,6 +37,7 @@ export const ButtonLink = ({
kind,
size,
disabled,
ref: targetRef,
...rest,
}}
>
Expand All @@ -38,7 +50,17 @@ export const ButtonLink = ({
{buttonNode}
</Link>
) : (
buttonNode
<span>
{buttonNode}
{renderTooltip && disabledMessage && (
<ResponsiveTooltip
my={tooltipPosition?.my || 'bottom-center'}
at={tooltipPosition?.at || 'top-right'}
targetRef={targetRef}
content={disabledMessage}
/>
)}
</span>
)
}
ButtonLink.displayName = 'ButtonLink'
Expand Down
5 changes: 4 additions & 1 deletion src/components/common/ButtonLink/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { ButtonProps } from '@aleph-front/core'
import { ButtonProps, TooltipProps } from '@aleph-front/core'
import { AnchorHTMLAttributes, ReactNode } from 'react'

export type ButtonLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &
Omit<ButtonProps, 'variant' | 'color' | 'kind' | 'size'> &
Partial<Pick<ButtonProps, 'variant' | 'color' | 'kind' | 'size'>> & {
href: string
children: ReactNode
} & {
disabledMessage?: ReactNode
tooltipPosition?: Pick<TooltipProps, 'my' | 'at'>
}
21 changes: 16 additions & 5 deletions src/components/common/CompositeTitle/cmp.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import { memo } from 'react'
import { CompositeTitle, CompositeTitleProps } from '@aleph-front/core'
import { ReactNode } from 'react'
import {
CompositeTitle,
CompositeTitleProps,
TextGradient,
} from '@aleph-front/core'

export const SectionTitle = (props: CompositeTitleProps) => {
export const CompositeSectionTitle = (props: CompositeTitleProps) => {
return (
<CompositeTitle
{...{ as: 'h2', color: 'main0', numberColor: 'main0', ...props }}
/>
)
}
SectionTitle.displayName = 'SectionTitle'
CompositeSectionTitle.displayName = 'CompositeSectionTitle'

export default memo(SectionTitle) as typeof SectionTitle
export const SectionTitle = ({ children }: { children: ReactNode }) => {
return (
<TextGradient as="h2" color="main0" type="h5">
{children}
</TextGradient>
)
}
SectionTitle.displayName = 'SectionTitle'
2 changes: 1 addition & 1 deletion src/components/common/CompositeTitle/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, default as SectionTitle } from './cmp'
export { SectionTitle, CompositeSectionTitle } from './cmp'
93 changes: 93 additions & 0 deletions src/components/common/DetailsMenuButton/cmp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import {
memo,
RefObject,
useCallback,
useEffect,
useRef,
useState,
} from 'react'
import { Button, Icon, Tooltip } from '@aleph-front/core'
import Link from 'next/link'

type MenuItem = {
label: string
href: string
}

type DetailsMenuButtonProps = {
menuItems: MenuItem[]
}

export const DetailsMenuButton = ({ menuItems }: DetailsMenuButtonProps) => {
const [open, setOpen] = useState(false)
const tooltipRef: RefObject<HTMLButtonElement> = useRef(null)

const handleClick = useCallback(() => setOpen(!open), [open, setOpen])
const handleClose = useCallback(() => setOpen(false), [setOpen])

// Handle click outside of the tooltip to close it
useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
if (
open &&
tooltipRef.current &&
!tooltipRef.current.contains(event.target as Node)
) {
setOpen(false)
}
}

if (open) {
document.addEventListener('mousedown', handleClickOutside)
}

return () => {
document.removeEventListener('mousedown', handleClickOutside)
}
}, [open])

return (
<>
<Tooltip
open={open}
targetRef={tooltipRef}
onCloseClick={handleClose}
onClose={handleClose}
variant={2}
content={
<div tw="flex flex-col min-w-[9.25rem]">
{menuItems.map((item) => (
<Link
key={item.label}
href={item.href}
tw="py-2 px-3"
// tw="block px-4 py-2 text-sm text-base2 hover:bg-base1"
>
{item.label}
</Link>
))}
</div>
}
my="top-right"
at="bottom-right"
margin={{ x: 0, y: 2 }}
/>
<Button
kind="functional"
variant="textOnly"
onClick={handleClick}
ref={tooltipRef}
>
<div
className="bg-base0"
tw="h-10 w-12 flex items-center justify-center"
>
<Icon name="ellipsis" size="lg" />
</div>
</Button>
</>
)
}
DetailsMenuButton.displayName = 'DetailsMenuButton'

export default memo(DetailsMenuButton) as typeof DetailsMenuButton
2 changes: 2 additions & 0 deletions src/components/common/DetailsMenuButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './cmp'
export type { ButtonLinkProps } from './types'
9 changes: 9 additions & 0 deletions src/components/common/DetailsMenuButton/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ButtonProps } from '@aleph-front/core'
import { AnchorHTMLAttributes, ReactNode } from 'react'

export type ButtonLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &
Omit<ButtonProps, 'variant' | 'color' | 'kind' | 'size'> &
Partial<Pick<ButtonProps, 'variant' | 'color' | 'kind' | 'size'>> & {
href: string
children: ReactNode
}
6 changes: 6 additions & 0 deletions src/components/common/EntityCard/cmp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export const EntityCard = ({
dashboardPath = '#',
createPath = '#',
createTarget = '_self',
createDisabled = false,
createDisabledMessage,
introductionButtonText,
subItems = [],
information,
Expand Down Expand Up @@ -159,6 +161,8 @@ export const EntityCard = ({
size="sm"
href={createPath}
target={createTarget}
disabled={createDisabled}
disabledMessage={createDisabledMessage}
>
<Icon name="plus-circle" /> {introductionButtonText}
</ButtonLink>
Expand All @@ -168,6 +172,8 @@ export const EntityCard = ({
}, [
createPath,
createTarget,
createDisabled,
createDisabledMessage,
dashboardPath,
information,
introductionButtonText,
Expand Down
2 changes: 2 additions & 0 deletions src/components/common/EntityCard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export type EntityCardProps = {
dashboardPath?: string
createPath?: string
createTarget?: HTMLAttributeAnchorTarget
createDisabled?: boolean
createDisabledMessage?: ReactNode
introductionButtonText?: string
information: InformationProps
storage?: number
Expand Down
4 changes: 3 additions & 1 deletion src/components/common/ExternalLink/cmp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const ExternalLink = ({
color,
typo,
underline,
disabled = false,
...props
}: ExternalLinkProps) => {
return (
Expand All @@ -19,10 +20,11 @@ export const ExternalLink = ({
$color={color}
$typo={typo}
$underline={underline}
$disabled={disabled}
{...props}
>
{text ? text : href}
<Icon name="square-up-right" tw="ml-2.5" />
<Icon name="square-up-right" tw="ml-1" />
</StyledExternalLink>
</>
)
Expand Down
10 changes: 9 additions & 1 deletion src/components/common/ExternalLink/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ export type StyledExternalLinkProps = {
$color?: keyof CoreTheme['color']
$typo?: keyof CoreTheme['typo']
$underline?: boolean
$disabled: boolean
}

export const StyledExternalLink = styled.a<StyledExternalLinkProps>`
${({ theme, $color = 'white', $typo, $underline = false }) => css`
${({ theme, $color = 'white', $typo, $underline = false, $disabled }) => css`
color: ${theme.color[$color]};
text-decoration: ${$underline ? 'underline' : 'none'};
${$typo ? getTypoCss($typo) : ''}

${$disabled &&
css`
// pointer-events: none;
cursor: not-allowed;
color: ${theme.color.disabled};
`};
`}
`
1 change: 1 addition & 0 deletions src/components/common/ExternalLink/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export type ExternalLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
color?: keyof CoreTheme['color']
typo?: keyof CoreTheme['typo']
underline?: boolean
disabled?: boolean
}
Loading