From d7ad8ce8473a68c8a7a202561a5ae0ac4274ab96 Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Tue, 24 May 2022 12:34:17 -0700 Subject: [PATCH 1/6] blog link + style tweaks --- apps/landing/src/components/AppEmbed.tsx | 2 +- apps/landing/src/components/NavBar.tsx | 4 ++-- apps/landing/src/components/NewBanner.tsx | 16 +++++++++------- apps/landing/src/pages/index.tsx | 2 +- apps/landing/src/style.scss | 2 +- packages/ui/src/Button.tsx | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/landing/src/components/AppEmbed.tsx b/apps/landing/src/components/AppEmbed.tsx index 05f65583e..4309f9441 100644 --- a/apps/landing/src/components/AppEmbed.tsx +++ b/apps/landing/src/components/AppEmbed.tsx @@ -88,7 +88,7 @@ export default function AppEmbed() { /> )} - {renderImage &&
} + {renderImage &&
}
diff --git a/apps/landing/src/components/NavBar.tsx b/apps/landing/src/components/NavBar.tsx index fff918418..d8e3f4eaf 100644 --- a/apps/landing/src/components/NavBar.tsx +++ b/apps/landing/src/components/NavBar.tsx @@ -61,10 +61,10 @@ export default function NavBar() { Roadmap FAQ Team - Blog + Blog {/* Changelog Privacy */} - Sponsor us + Jobs - Spacedrive raises $1.9M lead by OSS Capital -
- - Read post → - -
+ +
+ Spacedrive raises $1.9M lead by OSS Capital +
+ + Read post → + +
+
); } diff --git a/apps/landing/src/pages/index.tsx b/apps/landing/src/pages/index.tsx index a48ee9671..81d6a3280 100644 --- a/apps/landing/src/pages/index.tsx +++ b/apps/landing/src/pages/index.tsx @@ -45,7 +45,7 @@ function Section(props: SectionProps = { orientation: 'left' }) { function Page() { return ( <> -
+

if (hasHref(props)) return ( - + <> {props.icon} {props.children} From 4fe8e262661a64e40349049f17a1717cce2d9857 Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Tue, 24 May 2022 13:46:00 -0700 Subject: [PATCH 2/6] waitlist ui --- apps/landing/src/pages/index.tsx | 85 ++++++++++++++----- core/src/lib.rs | 2 +- .../src/components/primitive/index.tsx | 1 - packages/interface/src/screens/Overview.tsx | 2 +- .../screens/settings/ExperimentalSettings.tsx | 1 - .../src/screens/settings/GeneralSettings.tsx | 2 +- .../components/primitive => ui/src}/Input.tsx | 0 packages/ui/src/index.ts | 1 + 8 files changed, 68 insertions(+), 26 deletions(-) rename packages/{interface/src/components/primitive => ui/src}/Input.tsx (100%) diff --git a/apps/landing/src/pages/index.tsx b/apps/landing/src/pages/index.tsx index 81d6a3280..b470463d4 100644 --- a/apps/landing/src/pages/index.tsx +++ b/apps/landing/src/pages/index.tsx @@ -1,5 +1,5 @@ import { Apple, Github, Linux, Windows } from '@icons-pack/react-simple-icons'; -import { Button } from '@sd/ui'; +import { Button, Input } from '@sd/ui'; import clsx from 'clsx'; import React, { useEffect } from 'react'; import { useState } from 'react'; @@ -43,6 +43,8 @@ function Section(props: SectionProps = { orientation: 'left' }) { } function Page() { + const [showWaitlistInput, setShowWaitlistInput] = useState(false); + const [waitlistEmail, setWaitlistEmail] = useState(''); return ( <>
@@ -62,28 +64,69 @@ function Page() {

- - + {!showWaitlistInput ? ( + <> + + + + ) : ( +
{ + e.preventDefault(); + // TODO: MAKE POST REQUEST HERE OSCAR :D + console.log({ waitlistEmail }); + }} + > +
+ setWaitlistEmail(e.target.value)} + placeholder="Enter your email" + className="rounded-r-none" + /> + +
+
+ )}

- Coming soon on macOS, Windows and Linux. -
- Shortly after to iOS & Android. + {showWaitlistInput ? ( + <> + We'll keep your place in the queue for early access. +
+
+ + ) : ( + <> + Coming soon on macOS, Windows and Linux. +
+ Shortly after to iOS & Android. + + )}

diff --git a/core/src/lib.rs b/core/src/lib.rs index a27bddd9c..63e971808 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -258,7 +258,7 @@ impl Node { // CRUD for locations ClientCommand::LocCreate { path } => { let loc = sys::locations::new_location_and_scan(&ctx, &path).await?; - ctx.queue_job(Box::new(FileIdentifierJob)); + // ctx.queue_job(Box::new(FileIdentifierJob)); CoreResponse::LocCreate(loc) } ClientCommand::LocUpdate { id: _, name: _ } => todo!(), diff --git a/packages/interface/src/components/primitive/index.tsx b/packages/interface/src/components/primitive/index.tsx index e7df43cc8..7aaab1d76 100644 --- a/packages/interface/src/components/primitive/index.tsx +++ b/packages/interface/src/components/primitive/index.tsx @@ -1,2 +1 @@ -export * from './Input'; export * from './Toggle'; diff --git a/packages/interface/src/screens/Overview.tsx b/packages/interface/src/screens/Overview.tsx index 36c50832c..7f87df9c0 100644 --- a/packages/interface/src/screens/Overview.tsx +++ b/packages/interface/src/screens/Overview.tsx @@ -2,6 +2,7 @@ import { MenuIcon, PlusIcon } from '@heroicons/react/solid'; import { useBridgeQuery } from '@sd/client'; import { Statistics } from '@sd/core'; import { Button } from '@sd/ui'; +import { Input } from '@sd/ui'; import byteSize from 'byte-size'; import React, { useContext, useEffect, useState } from 'react'; import { useCountUp } from 'react-countup'; @@ -9,7 +10,6 @@ import { useCountUp } from 'react-countup'; import { AppPropsContext } from '../App'; import { Device } from '../components/device/Device'; import Dialog from '../components/layout/Dialog'; -import { Input } from '../components/primitive'; interface StatItemProps { name: string; diff --git a/packages/interface/src/screens/settings/ExperimentalSettings.tsx b/packages/interface/src/screens/settings/ExperimentalSettings.tsx index f148adacf..fdf8c4e79 100644 --- a/packages/interface/src/screens/settings/ExperimentalSettings.tsx +++ b/packages/interface/src/screens/settings/ExperimentalSettings.tsx @@ -1,4 +1,3 @@ -import { Button } from '@sd/ui'; import React from 'react'; import { useStore } from '../../components/device/Stores'; diff --git a/packages/interface/src/screens/settings/GeneralSettings.tsx b/packages/interface/src/screens/settings/GeneralSettings.tsx index 50e11fadc..5dc9d6394 100644 --- a/packages/interface/src/screens/settings/GeneralSettings.tsx +++ b/packages/interface/src/screens/settings/GeneralSettings.tsx @@ -1,8 +1,8 @@ import { useBridgeCommand, useBridgeQuery } from '@sd/client'; import { Button } from '@sd/ui'; +import { Input } from '@sd/ui'; import React, { useState } from 'react'; -import { Input } from '../../components/primitive'; import { InputContainer } from '../../components/primitive/InputContainer'; import Listbox from '../../components/primitive/Listbox'; import Slider from '../../components/primitive/Slider'; diff --git a/packages/interface/src/components/primitive/Input.tsx b/packages/ui/src/Input.tsx similarity index 100% rename from packages/interface/src/components/primitive/Input.tsx rename to packages/ui/src/Input.tsx diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 1992f2cee..3667aa690 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -1,2 +1,3 @@ export * from './Button'; export * from './Dropdown'; +export * from './Input'; From c98b5da352e4547093b2f70d225771edc0d93720 Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Wed, 25 May 2022 06:14:44 +0800 Subject: [PATCH 3/6] added backend to waitlist form --- apps/landing/src/pages/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/landing/src/pages/index.tsx b/apps/landing/src/pages/index.tsx index b470463d4..51e2c98e0 100644 --- a/apps/landing/src/pages/index.tsx +++ b/apps/landing/src/pages/index.tsx @@ -87,8 +87,15 @@ function Page() {
{ e.preventDefault(); - // TODO: MAKE POST REQUEST HERE OSCAR :D - console.log({ waitlistEmail }); + fetch('https://waitlist-api.spacedrive.com/api/expression-of-interest', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + email: waitlistEmail + }) + }); }} >
From d7541ee4b1703442fb064a51e2e52d957fb518ef Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Tue, 24 May 2022 15:51:56 -0700 Subject: [PATCH 4/6] tweaks to email waitlist --- apps/landing/src/components/HomeCTA.tsx | 81 +++++++++++++++++++ apps/landing/src/components/NavBar.tsx | 2 +- apps/landing/src/components/NewBanner.tsx | 2 +- apps/landing/src/pages/index.tsx | 70 +--------------- .../src/components/file/Inspector.tsx | 2 +- 5 files changed, 86 insertions(+), 71 deletions(-) create mode 100644 apps/landing/src/components/HomeCTA.tsx diff --git a/apps/landing/src/components/HomeCTA.tsx b/apps/landing/src/components/HomeCTA.tsx new file mode 100644 index 000000000..2f8686f3e --- /dev/null +++ b/apps/landing/src/components/HomeCTA.tsx @@ -0,0 +1,81 @@ +import { Apple, Github, Linux, Windows } from '@icons-pack/react-simple-icons'; +import { Button, Input } from '@sd/ui'; +import clsx from 'clsx'; +import React, { useEffect } from 'react'; +import { useState } from 'react'; + +export function HomeCTA() { + const [showWaitlistInput, setShowWaitlistInput] = useState(false); + const [waitlistEmail, setWaitlistEmail] = useState(''); + return ( + <> +
+ {!showWaitlistInput ? ( + <> + + + + ) : ( + { + e.preventDefault(); + // TODO: MAKE POST REQUEST HERE OSCAR :D + console.log({ waitlistEmail }); + }} + > +
+ setWaitlistEmail(e.target.value)} + placeholder="Enter your email" + className="rounded-r-none" + /> + +
+ + )} +
+

+ {showWaitlistInput ? ( + <> + We'll keep your place in the queue for early access. +
+
+ + ) : ( + <> + Coming soon on macOS, Windows and Linux. +
+ Shortly after to iOS & Android. + + )} +

+ + ); +} + +export default HomeCTA; diff --git a/apps/landing/src/components/NavBar.tsx b/apps/landing/src/components/NavBar.tsx index d8e3f4eaf..33ed16eab 100644 --- a/apps/landing/src/components/NavBar.tsx +++ b/apps/landing/src/components/NavBar.tsx @@ -61,7 +61,7 @@ export default function NavBar() { Roadmap FAQ Team - Blog + Blog {/* Changelog Privacy */} Jobs diff --git a/apps/landing/src/components/NewBanner.tsx b/apps/landing/src/components/NewBanner.tsx index c3c8725a7..b36eebd85 100644 --- a/apps/landing/src/components/NewBanner.tsx +++ b/apps/landing/src/components/NewBanner.tsx @@ -2,7 +2,7 @@ import React from 'react'; export default function NewBanner() { return ( -
+
Spacedrive raises $1.9M lead by OSS Capital
diff --git a/apps/landing/src/pages/index.tsx b/apps/landing/src/pages/index.tsx index b470463d4..db11ecd07 100644 --- a/apps/landing/src/pages/index.tsx +++ b/apps/landing/src/pages/index.tsx @@ -7,6 +7,7 @@ import { useState } from 'react'; import AppEmbed from '../components/AppEmbed'; import { Bubbles } from '../components/Bubbles'; import { Footer } from '../components/Footer'; +import HomeCTA from '../components/HomeCTA'; import NavBar from '../components/NavBar'; import NewBanner from '../components/NewBanner'; @@ -43,8 +44,6 @@ function Section(props: SectionProps = { orientation: 'left' }) { } function Page() { - const [showWaitlistInput, setShowWaitlistInput] = useState(false); - const [waitlistEmail, setWaitlistEmail] = useState(''); return ( <>
@@ -63,72 +62,7 @@ function Page() { Designed for creators, hoarders and the painfully disorganized.

-
- {!showWaitlistInput ? ( - <> - - - - ) : ( -
{ - e.preventDefault(); - // TODO: MAKE POST REQUEST HERE OSCAR :D - console.log({ waitlistEmail }); - }} - > -
- setWaitlistEmail(e.target.value)} - placeholder="Enter your email" - className="rounded-r-none" - /> - -
-
- )} -
-

- {showWaitlistInput ? ( - <> - We'll keep your place in the queue for early access. -
-
- - ) : ( - <> - Coming soon on macOS, Windows and Linux. -
- Shortly after to iOS & Android. - - )} -

- +
Date: Tue, 24 May 2022 20:24:03 -0700 Subject: [PATCH 5/6] dropdown attempt --- packages/ui/src/Dropdown.tsx | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/packages/ui/src/Dropdown.tsx b/packages/ui/src/Dropdown.tsx index 03c9d053b..2fe78930d 100644 --- a/packages/ui/src/Dropdown.tsx +++ b/packages/ui/src/Dropdown.tsx @@ -15,7 +15,8 @@ type Section = { export interface DropdownProps { items: Section[]; buttonText?: string; - buttonProps: React.ComponentProps; + buttonProps?: React.ComponentProps; + buttonComponent?: React.ReactNode; buttonIcon?: any; className?: string; itemsClassName?: string; @@ -26,24 +27,28 @@ export const Dropdown: React.FC = (props) => {
- + {props.buttonComponent ? ( + props.buttonComponent + ) : ( + + )} From 48056c5eec778e076d4961f9e1b503fd368f262a Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Tue, 24 May 2022 20:24:18 -0700 Subject: [PATCH 6/6] part two --- core/src/encode/thumb.rs | 5 +++- .../src/components/layout/TopBar.tsx | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/core/src/encode/thumb.rs b/core/src/encode/thumb.rs index b8ebd1110..aaf949609 100644 --- a/core/src/encode/thumb.rs +++ b/core/src/encode/thumb.rs @@ -70,7 +70,10 @@ impl Job for ThumbnailJob { let cas_id = match image_file.file() { Ok(i) => i.unwrap().cas_id.clone(), - Err(_) => todo!(), + Err(_) => { + println!("Error getting cas_id {:?}", image_file.materialized_path); + continue; + } }; // Define and write the WebP-encoded file to a given path diff --git a/packages/interface/src/components/layout/TopBar.tsx b/packages/interface/src/components/layout/TopBar.tsx index daa8477d8..52b1c1d36 100644 --- a/packages/interface/src/components/layout/TopBar.tsx +++ b/packages/interface/src/components/layout/TopBar.tsx @@ -1,5 +1,6 @@ import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/outline'; import { useBridgeCommand } from '@sd/client'; +import { Dropdown } from '@sd/ui'; import clsx from 'clsx'; import { ArrowsClockwise, @@ -7,6 +8,7 @@ import { FolderPlus, IconProps, Key, + List, Tag, TerminalWindow } from 'phosphor-react'; @@ -54,6 +56,9 @@ export const TopBar: React.FC = (props) => { console.log('GenerateThumbsForLocation', data); } }); + + const { mutate: identifyUniqueFiles } = useBridgeCommand('IdentifyUniqueFiles', {}); + let navigate = useNavigate(); return ( <> @@ -102,6 +107,26 @@ export const TopBar: React.FC = (props) => { src="/images/spacedrive_logo.png" className="w-8 h-8 mt-[1px] mr-2 pointer-events-none" /> */} +
+ generateThumbsForLocation({ id: locationId, path: '' }) + }, + { + name: 'Identify Unique', + icon: ArrowsClockwise, + onPress: () => identifyUniqueFiles({}) + } + ] + ]} + buttonComponent={} + /> +
{/* {*/} {/* setSettingsOpen(!settingsOpen);*/} {/*}} className="mr-[8px]" icon={CogIcon} />*/}