Skip to content

Commit

Permalink
fix invocation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
a-type committed Nov 30, 2024
1 parent 6ee1766 commit 6587370
Show file tree
Hide file tree
Showing 15 changed files with 111 additions and 115 deletions.
2 changes: 1 addition & 1 deletion apps/gnocchi/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1",
"@verdant-web/store": "4.1.0-alpha.5",
"cuid": "^2.1.8",
"stopword": "^2.0.8"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/gnocchi/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@use-gesture/react": "^10.2.24",
"@vercel/analytics": "^0.1.6",
"@verdant-web/react-router": "0.6.5",
"@verdant-web/store": "4.1.0-alpha.1",
"@verdant-web/store": "4.1.0-alpha.5",
"@zip.js/zip.js": "^2.7.6",
"classnames": "^2.3.2",
"convert-units": "^3.0.0-beta.4",
Expand Down
62 changes: 29 additions & 33 deletions apps/gnocchi/web/src/components/recipes/editor/RecipeUrlField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ export function RecipeUrlField({ recipe }: RecipeUrlFieldProps) {
const { url } = hooks.useWatch(recipe);
const [initialUrl] = useState(() => recipe.get('url'));
const [scanning, setScanning] = useState(false);
const isLoggedIn = useIsLoggedIn();
const [isLoggedIn] = useIsLoggedIn();
const updateRecipeFromUrl = hooks.useUpdateRecipeFromUrl();

const hasUrlChanged = url !== initialUrl;
const showScan = hasUrlChanged || !url;

const scan = async () => {
if (url) {
try {
Expand All @@ -40,35 +37,34 @@ export function RecipeUrlField({ recipe }: RecipeUrlFieldProps) {
className="flex-1"
autoSelect
/>
{showScan &&
(isLoggedIn ? (
<Button color="primary" onClick={scan} disabled={!url || scanning}>
<Icon name="scan" style={{ width: 15, height: 15 }} />
<span className="ml-2">Scan</span>
</Button>
) : (
<Dialog>
<Dialog.Trigger asChild>
<Button color="primary">
<Icon name="scan" style={{ width: 15, height: 15 }} />
<span className="ml-2">Scan</span>
</Button>
</Dialog.Trigger>
<Dialog.Content>
<Dialog.Title>Sign up to scan</Dialog.Title>
<Dialog.Description>
Get a free account to begin scanning web recipes. Free users get
5 recipes per month.
</Dialog.Description>
<Dialog.Actions>
<Dialog.Close>Cancel</Dialog.Close>
<LoginButton color="primary" asChild returnTo="/">
Get started
</LoginButton>
</Dialog.Actions>
</Dialog.Content>
</Dialog>
))}
{isLoggedIn ? (
<Button color="primary" onClick={scan} disabled={!url || scanning}>
<Icon name="scan" style={{ width: 15, height: 15 }} />
<span className="ml-2">Scan</span>
</Button>
) : (
<Dialog>
<Dialog.Trigger asChild>
<Button color="primary">
<Icon name="scan" style={{ width: 15, height: 15 }} />
<span className="ml-2">Scan</span>
</Button>
</Dialog.Trigger>
<Dialog.Content>
<Dialog.Title>Sign up to scan web recipes</Dialog.Title>
<Dialog.Description>
Get a free account to begin scanning web recipes. Free users get 5
recipes per month.
</Dialog.Description>
<Dialog.Actions>
<Dialog.Close>Cancel</Dialog.Close>
<LoginButton color="primary" asChild returnTo="/">
Get started
</LoginButton>
</Dialog.Actions>
</Dialog.Content>
</Dialog>
)}
</div>
);
}
2 changes: 1 addition & 1 deletion apps/humding/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1"
"@verdant-web/store": "4.1.0-alpha.5"
}
}
2 changes: 1 addition & 1 deletion apps/marginalia/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1",
"@verdant-web/store": "4.1.0-alpha.5",
"cuid": "^2.1.8"
}
}
2 changes: 1 addition & 1 deletion apps/names/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1"
"@verdant-web/store": "4.1.0-alpha.5"
}
}
2 changes: 1 addition & 1 deletion apps/palette/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1"
"@verdant-web/store": "4.1.0-alpha.5"
}
}
2 changes: 1 addition & 1 deletion apps/star-chart/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1"
"@verdant-web/store": "4.1.0-alpha.5"
}
}
2 changes: 1 addition & 1 deletion apps/trip-tick/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1",
"@verdant-web/store": "4.1.0-alpha.5",
"cuid": "^2.1.8"
}
}
2 changes: 1 addition & 1 deletion apps/trip-tick/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@unocss/transformer-variant-group": "^0.54.1",
"@verdant-web/react": "39.0.0",
"@verdant-web/react-router": "0.6.5",
"@verdant-web/store": "4.1.0-alpha.1",
"@verdant-web/store": "4.1.0-alpha.5",
"classnames": "^2.3.2",
"date-fns": "^2.30.0",
"downshift": "^7.0.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/wish-wash/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@verdant-web/cli": "4.7.1-alpha.0",
"@verdant-web/common": "2.6.0",
"@verdant-web/react": "39.0.0",
"@verdant-web/store": "4.1.0-alpha.1"
"@verdant-web/store": "4.1.0-alpha.5"
},
"volta": {
"node": "20.17.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@a-type/ui": "^0.6.17",
"@react-spring/web": "^9",
"@verdant-web/react-router": "^0.6.0",
"@verdant-web/store": "^3.2.2",
"@verdant-web/store": "4.1.0-alpha.5",
"react": "18.3.1",
"valtio": "^1.13.2",
"vite-plugin-pwa": "0.19.2"
Expand All @@ -77,7 +77,7 @@
"@types/react": "18.3.3",
"@unocss/transformer-variant-group": "^0.58.0",
"@verdant-web/react-router": "0.6.5",
"@verdant-web/store": "4.1.0-alpha.1",
"@verdant-web/store": "4.1.0-alpha.5",
"react": "18.3.1",
"typescript": "5.5.3",
"unocss": "^0.58.0",
Expand Down
Loading

0 comments on commit 6587370

Please sign in to comment.