-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from elwood-software/feature/new-www
fancy new www
- Loading branch information
Showing
14 changed files
with
219 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
'use client'; | ||
|
||
import {useEffect, useState} from 'react'; | ||
import {createMemoryRouter} from 'react-router-dom'; | ||
import { | ||
Router, | ||
ElwoodProvider, | ||
MainLayout, | ||
dashboardRoutes, | ||
} from '@elwood/react'; | ||
import {Spinner} from '@elwood/ui'; | ||
import {type ElwoodClient, createClient, type User} from '@elwood/js'; | ||
|
||
export function Demo() { | ||
const [router] = useState(createMemoryRouter(dashboardRoutes)); | ||
const [client, setClient] = useState<ElwoodClient | null>(null); | ||
const [_user, setUser] = useState<User | null>(null); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
if (client) { | ||
return; | ||
} | ||
|
||
setLoading(true); | ||
const localClient = createClient( | ||
process.env.NEXT_PUBLIC_SUPABASE_URL!, | ||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, | ||
); | ||
|
||
localClient.auth | ||
.signInWithPassword({ | ||
email: process.env.NEXT_PUBLIC_DEMO_USER_EMAIL!, | ||
password: process.env.NEXT_PUBLIC_DEMO_USER_PW!, | ||
}) | ||
.then(response => { | ||
setUser(response.data?.user ?? null); | ||
}) | ||
.catch(error => { | ||
console.log(error.message); | ||
}) | ||
.finally(() => { | ||
setClient(localClient); | ||
setLoading(false); | ||
}); | ||
|
||
return function unload() { | ||
localClient.auth.signOut(); | ||
}; | ||
}, []); | ||
|
||
const workspaceName = 'Dunder Mifflin'; | ||
|
||
if (!client || loading) { | ||
return ( | ||
<MainLayout title={workspaceName} sidebarFooter={<></>} sidebar={<></>}> | ||
<Spinner className="stroke-muted-foreground m-3" /> | ||
</MainLayout> | ||
); | ||
} | ||
|
||
return ( | ||
<ElwoodProvider workspaceName={workspaceName} client={client}> | ||
<Router router={router} /> | ||
</ElwoodProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export async function GET() { | ||
const response = await fetch( | ||
'https://api.github.com/repos/elwood-software/desktop/releases', | ||
{ | ||
method: 'GET', | ||
headers: { | ||
Authorization: `Bearer ${process.env.GH_RELEASES_TOKEN}`, | ||
Accept: 'application/vnd.github+json', | ||
'X-GitHub-Api-Version': '2022-11-28', | ||
}, | ||
}, | ||
); | ||
|
||
console.log(await response.text()); | ||
|
||
return Response.redirect( | ||
'https://github.com/elwood-software/desktop/releases/download/v0.0.1/Elwood-0.0.1.dmg', | ||
302, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
:root { | ||
--splash-shadow: 0px 0px 121px 34px rgba(79, 72, 122, 0.5); | ||
} | ||
|
||
.dark { | ||
--splash-shadow: 0px 0px 121px 34px rgba(79, 72, 122, 0.2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use client'; | ||
|
||
import {PropsWithChildren} from 'react'; | ||
import {useMedia} from 'react-use'; | ||
|
||
export function NotMobile(props: PropsWithChildren) { | ||
const isWide = useMedia('(min-width: 960px)', false); | ||
return isWide ? props.children : null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,78 @@ | ||
import {Logo, Button} from '@elwood/ui'; | ||
import Link from 'next/link'; | ||
|
||
import {Logo, Button, StarIcon, FileIcon, ExternalLinkIcon} from '@elwood/ui'; | ||
|
||
import {NotMobile} from './not-mobile'; | ||
import {Demo} from './demo'; | ||
|
||
export default function Page() { | ||
return ( | ||
<div className="w-screen h-screen flex flex-col items-center justify-center"> | ||
<h1 className="size-1/4"> | ||
<Logo className="size-full fill-current" /> | ||
<span className="sr-only">Elwood</span> | ||
</h1> | ||
|
||
<h2 className="mt-12 font-bold text-2xl"> | ||
Open source Dropbox alternative | ||
</h2> | ||
<div className="m-auto container min-h-screen flex flex-col"> | ||
<main className="flex-grow"> | ||
<header className="flex flex-col items-center justify-center"> | ||
<h1 className="size-24 mt-24"> | ||
<Link href="/"> | ||
<Logo className="size-full fill-brand dark:fill-current" /> | ||
<span className="sr-only">Elwood</span> | ||
</Link> | ||
</h1> | ||
<h2 className="mt-6 font-medium text-2xl text-center"> | ||
The open source Dropbox alternative | ||
</h2> | ||
<h3 className="text-sm text-muted-foreground mt-1 max-w-2xl text-center"> | ||
<strong>Elwood</strong> has lighting fast, resumable uploads. | ||
Real-time, multi-user collaboration. Powerful role-based sharing. AI | ||
powered assistant (to the) file manager. And much more to come. | ||
</h3> | ||
<div className="flex flex-col md:flex-row items-center justify-center space-y-3 md:space-y-0 md:space-x-3 mt-12 w-full"> | ||
<Button | ||
variant="default" | ||
size="lg" | ||
href="/desktop/download" | ||
className="w-full md:w-auto"> | ||
Download for Desktop | ||
</Button> | ||
<Button | ||
variant="outline" | ||
href="/docs" | ||
className="w-full md:w-auto" | ||
icon={<FileIcon className="size-[1em]" />}> | ||
Docs | ||
</Button> | ||
<Button | ||
variant="outline" | ||
className="w-full md:w-auto" | ||
href="https://github.com/elwood-software/elwood" | ||
icon={<StarIcon className="size-[1em]" />}> | ||
Github | ||
</Button> | ||
</div> | ||
</header> | ||
|
||
<div className="flex items-center space-x-3 mt-6"> | ||
<Button variant="outline" href="/docs"> | ||
Docs | ||
</Button> | ||
<Button variant="outline" href="https://github.elwood.software"> | ||
Github | ||
</Button> | ||
<Button variant="outline" href="https://discord.elwood.software"> | ||
Discord | ||
</Button> | ||
</div> | ||
<div className="hidden md:block border rounded-md mt-10 shadow-splash transition-all scale-[.99] hover:scale-100 relative top-2 hover:top-0 duration-300"> | ||
<header className="border-b rounded-t-md px-3 py-3 flex justify-between"> | ||
<div className="space-x-1.5 flex"> | ||
<div className="size-2.5 bg-foreground/20 rounded-full" /> | ||
<div className="size-2.5 bg-foreground/20 rounded-full" /> | ||
<div className="size-2.5 bg-foreground/20 rounded-full" /> | ||
</div> | ||
<Link | ||
className="opacity-20 flex items-center hover:opacity-100 transition-opacity text-xs" | ||
href="https://demo.elwood.software"> | ||
Open the full demo{' '} | ||
<ExternalLinkIcon className="size-[1em] inline ml-1" /> | ||
</Link> | ||
</header> | ||
<div className="h-[50vh] w-full flex flex-row overflow-hidden relative"> | ||
<NotMobile> | ||
<Demo /> | ||
</NotMobile> | ||
</div> | ||
</div> | ||
</main> | ||
<footer className="text-center text-muted-foreground text-xs py-2"> | ||
© The Elwood Technology Company | ||
</footer> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.