Skip to content

Commit

Permalink
Merge branch 'main' of github.com:aleph-im/front-aleph-cloud-page
Browse files Browse the repository at this point in the history
  • Loading branch information
amalcaraz committed Jun 4, 2024
2 parents b3ab5f2 + 5afe534 commit a47ab36
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 46 deletions.
63 changes: 30 additions & 33 deletions src/domain/website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,49 @@ npm run build`,
},
],
},
/* [WebsiteFrameworkId.react]: {
[WebsiteFrameworkId.react]: {
id: WebsiteFrameworkId.react,
name: 'React + CRA',
name: 'React',
docs: [
{
type: 'text',
value: 'Install create-react-app and create the project',
value: 'Create a React project',
},
{
type: 'code',
value: `npx create-react-app my-app
cd my-app`,
value: `npx create-react-app@latest my-react-app
cd my-react-app`,
},
{ type: 'text', value: 'Build the static files and zip them' },
{ type: 'text', value: 'Build the static website' },
{
type: 'code',
value: `npm run build
(cd build; zip -r ../website.zip .)`,
value: `npm install
npm run build`,
},
],
},
[WebsiteFrameworkId.vue]: {
id: WebsiteFrameworkId.vue,
name: 'Vue.js',
docs: [
{
type: 'text',
value: 'Create a Vue.js project',
},
{
type: 'code',
value: `npm create vue@latest
cd vue-project`,
},
{ type: 'text', value: 'Build the static website' },
{
type: 'code',
value: `npm install
npm run build`,
},
],
},
[WebsiteFrameworkId.gatsby]: {
/* [WebsiteFrameworkId.gatsby]: {
id: WebsiteFrameworkId.gatsby,
name: 'React + Gatsby',
docs: [
Expand Down Expand Up @@ -188,30 +209,6 @@ export const prerender = true;`,
},
],
},
[WebsiteFrameworkId.vue]: {
id: WebsiteFrameworkId.vue,
name: 'Vue',
docs: [
{
type: 'text',
value: 'Install Vue and create the project',
},
{
type: 'code',
height: '8rem',
value: `npm create vue@latest
cd vue-project
npm install
`,
},
{ type: 'text', value: 'Build the static files and zip them' },
{
type: 'code',
value: `npm run build
(cd dist; zip -r ../website.zip .)`,
},
],
},
[WebsiteFrameworkId.nuxt]: {
id: WebsiteFrameworkId.nuxt,
name: 'Vue + Nuxt',
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ export const superToken = '0x1290248E01ED2F9f863A9752A8aAD396ef3a1B00'
export enum WebsiteFrameworkId {
none = 'none',
nextjs = 'nextjs',
/* react = 'react',
gatsby = 'gatsby',
svelte = 'svelte',
react = 'react',
vue = 'vue',
/* gatsby = 'gatsby',
svelte = 'svelte',
nuxt = 'nuxt',
angular = 'angular' */
}
6 changes: 3 additions & 3 deletions src/helpers/schemas/website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import {
export const websiteFrameworkSchema = z.enum([
WebsiteFrameworkId.none,
WebsiteFrameworkId.nextjs,
/* WebsiteFrameworkId.react,
WebsiteFrameworkId.gatsby,
WebsiteFrameworkId.svelte,
WebsiteFrameworkId.react,
WebsiteFrameworkId.vue,
/* WebsiteFrameworkId.gatsby,
WebsiteFrameworkId.svelte,
WebsiteFrameworkId.nuxt,
WebsiteFrameworkId.angular */
])
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/common/useENSLookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { EnsNameLookup, EnsAddressLookup } from '@/domain/ens'
export const useEnsNameLookup = (address?: string) => {
const [ensName, setEnsName] = useState('')
useEffect(() => {
EnsNameLookup(address).then((name) => name && setEnsName(name))
EnsNameLookup(address).then((name) => setEnsName(name ?? ''))
}, [address])
return ensName
}

export const useEnsAddressLookup = (ens?: string) => {
const [ensAddress, setEnsAddress] = useState('')
useEffect(() => {
EnsAddressLookup(ens).then((address) => address && setEnsAddress(address))
EnsAddressLookup(ens).then((address) => setEnsAddress(address ?? ''))
}, [ens])
return ensAddress
}
2 changes: 1 addition & 1 deletion src/hooks/pages/computing/useNewFunctionPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function useNewFunctionPage(): UseNewFunctionPage {
})

const canAfford =
accountBalance > (cost?.totalCost || Number.MAX_SAFE_INTEGER)
accountBalance >= (cost?.totalCost || Number.MAX_SAFE_INTEGER)
let isCreateButtonDisabled = !canAfford
if (process.env.NEXT_PUBLIC_OVERRIDE_ALEPH_BALANCE === 'true') {
isCreateButtonDisabled = false
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/pages/computing/useNewInstancePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export function useNewInstancePage(): UseNewInstancePage {
}, [cost, setValue, values])

const canAfford =
accountBalance > (cost?.totalCost || Number.MAX_SAFE_INTEGER)
accountBalance >= (cost?.totalCost || Number.MAX_SAFE_INTEGER)
let isCreateButtonDisabled = !canAfford
if (process.env.NEXT_PUBLIC_OVERRIDE_ALEPH_BALANCE === 'true') {
isCreateButtonDisabled = false
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/pages/hosting/useNewWebsitePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function useNewWebsitePage(): UseNewWebsitePagePageReturn {
})

const canAfford =
accountBalance > (cost?.totalCost || Number.MAX_SAFE_INTEGER)
accountBalance >= (cost?.totalCost || Number.MAX_SAFE_INTEGER)
let isCreateButtonDisabled = !canAfford || !values.framework || !values.name
if (process.env.NEXT_PUBLIC_OVERRIDE_ALEPH_BALANCE === 'true') {
isCreateButtonDisabled = false
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/pages/storage/useNewVolumePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function useNewVolumePage(): UseNewVolumePageReturn {
})

const canAfford =
accountBalance > (cost?.totalCost || Number.MAX_SAFE_INTEGER)
accountBalance >= (cost?.totalCost || Number.MAX_SAFE_INTEGER)
let isCreateButtonDisabled = !canAfford
if (process.env.NEXT_PUBLIC_OVERRIDE_ALEPH_BALANCE === 'true') {
isCreateButtonDisabled = false
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/pages/tools/useNewIndexerPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function useNewIndexerPage(): UseNewIndexerPage {
})

const canAfford =
accountBalance > (cost?.totalCost || Number.MAX_SAFE_INTEGER)
accountBalance >= (cost?.totalCost || Number.MAX_SAFE_INTEGER)
let isCreateButtonDisabled = !canAfford
if (process.env.NEXT_PUBLIC_OVERRIDE_ALEPH_BALANCE === 'true') {
isCreateButtonDisabled = false
Expand Down

0 comments on commit a47ab36

Please sign in to comment.