Skip to content

Commit

Permalink
Merge pull request #3 from web3-storage/fix/setup
Browse files Browse the repository at this point in the history
fix: assorted remaining setup tasks
  • Loading branch information
travis authored Oct 9, 2023
2 parents 9e02d95 + bfa55ca commit 9a2575c
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
env:
NEXT_PUBLIC_SERVICE_DID: 'did:web:staging.web3.storage'
NEXT_PUBLIC_SERVICE_URL: 'https://staging.up.web3.storage'
NEXT_PUBLIC_W3UP_PROVIDER: 'did:web:staging.web3.storage'
- name: Deploy preview build to Cloudflare Pages
uses: mathiasvr/[email protected]
id: cloudflare
Expand Down Expand Up @@ -85,6 +86,7 @@ jobs:
env:
NEXT_PUBLIC_SERVICE_DID: 'did:web:web3.storage'
NEXT_PUBLIC_SERVICE_URL: 'https://up.web3.storage'
NEXT_PUBLIC_W3UP_PROVIDER: 'did:web:web3.storage'
- name: Deploy preview build to Cloudflare Pages
uses: mathiasvr/[email protected]
id: cloudflare
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@
"dependencies": {
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"@ipld/dag-ucan": "^3.4.0",
"@ucanto/client": "^9.0.0",
"@ucanto/interface": "^9.0.0",
"@ucanto/transport": "^9.0.0",
"@w3ui/react-keyring": "^6.0.1",
"@w3ui/react-uploader": "^5.0.1",
"@w3ui/react-uploads-list": "^4.0.1",
"@web3-storage/access": "^15.2.1",
"blueimp-md5": "^2.19.0",
"next": "latest",
"react": "latest",
"react-dom": "latest"
},
"devDependencies": {
"@cloudflare/next-on-pages": "^1.6.3",
"@types/blueimp-md5": "^2.18.0",
"@types/node": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
43 changes: 43 additions & 0 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function RootLayout ({
}) {
return (
<html lang="en">
<body className='bg-gray-900 min-height-full'>
<body className='bg-gray-900 min-h-screen'>
<SidebarLayout>
{children}
</SidebarLayout>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Authenticator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function AuthenticationEnsurer ({
if (agent) {
return <AuthenticationForm />
}
return <Loader className='w-12 h-12' />
return <Loader className='w-12 h-12 w-full mt-12' />
}


3 changes: 2 additions & 1 deletion src/components/SpaceCreator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useState } from 'react'
import { useKeyring } from '@w3ui/react-keyring'
import { ArrowPathIcon } from '@heroicons/react/20/solid'
import Loader from '../components/Loader'
import { DID } from '@ucanto/interface'

export function SpaceCreatorCreating (): JSX.Element {
return (
Expand Down Expand Up @@ -35,7 +36,7 @@ export function SpaceCreatorForm ({
setSubmitted(true)
try {
await createSpace(name)
await registerSpace(account, { provider: import.meta.env.VITE_W3UP_PROVIDER })
await registerSpace(account, { provider: (process.env.NEXT_PUBLIC_W3UP_PROVIDER || 'did:web:web3.storage') as DID<'web'> })
} catch (error) {
/* eslint-disable no-console */
console.error(error)
Expand Down
3 changes: 2 additions & 1 deletion src/components/SpaceRegistrar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from 'react';
import { useKeyring } from '@w3ui/react-keyring';
import Loader from './Loader';
import { DID } from '@ucanto/interface';

export function SpaceRegistrar (): JSX.Element {
const [{ account }, { registerSpace }] = useKeyring();
Expand All @@ -10,7 +11,7 @@ export function SpaceRegistrar (): JSX.Element {
if (account) {
setSubmitted(true);
try {
await registerSpace(account, { provider: import.meta.env.VITE_W3UP_PROVIDER });
await registerSpace(account, { provider: (process.env.NEXT_PUBLIC_W3UP_PROVIDER || 'did:web:web3.storage') as DID<'web'> });
} catch (err) {
console.log(err);
throw new Error('failed to register', { cause: err });
Expand Down
3 changes: 2 additions & 1 deletion src/components/SpaceSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { Uploader } from './Uploader';
import { UploadsList } from './UploadsList';
import { SpaceRegistrar } from './SpaceRegistrar';
import { DidIcon } from './DidIcon';
import { DIDKey } from '@ucanto/interface';

interface SpaceSectionProps {
viewSpace: (did: string) => void;
viewSpace: (did: DIDKey) => void;
setShare: (share: boolean) => void;
share: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const servicePrincipal = DID.parse(
export const serviceConnection = connect<Service>({
id: servicePrincipal,
codec: CAR.outbound,
channel: HTTP.open<Record<string, any>>({
channel: HTTP.open<any>({
url: serviceURL,
method: 'POST',
}),
Expand Down

0 comments on commit 9a2575c

Please sign in to comment.