Table Stuff

This commit is contained in:
2024-09-15 06:37:59 -04:00
parent 062a9adf04
commit 3794e30158
12 changed files with 128 additions and 152 deletions

View File

@@ -28,7 +28,6 @@
"cors": "^2.8.5", "cors": "^2.8.5",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.21.0", "express": "^4.21.0",
"localtunnel": "^2.0.2",
"mongoose": "^8.6.2", "mongoose": "^8.6.2",
"ms": "^2.1.3", "ms": "^2.1.3",
"ollama": "^0.5.9", "ollama": "^0.5.9",

108
pnpm-lock.yaml generated
View File

@@ -29,9 +29,6 @@ importers:
express: express:
specifier: ^4.21.0 specifier: ^4.21.0
version: 4.21.0 version: 4.21.0
localtunnel:
specifier: ^2.0.2
version: 2.0.2
mongoose: mongoose:
specifier: ^8.6.2 specifier: ^8.6.2
version: 8.6.2 version: 8.6.2
@@ -554,9 +551,6 @@ packages:
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
axios@0.21.4:
resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==}
axios@1.7.7: axios@1.7.7:
resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==}
@@ -621,9 +615,6 @@ packages:
resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
cliui@7.0.4:
resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==}
code-red@1.0.4: code-red@1.0.4:
resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==}
@@ -701,15 +692,6 @@ packages:
supports-color: supports-color:
optional: true optional: true
debug@4.3.2:
resolution: {integrity: sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
debug@4.3.7: debug@4.3.7:
resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
engines: {node: '>=6.0'} engines: {node: '>=6.0'}
@@ -794,10 +776,6 @@ packages:
engines: {node: '>=12'} engines: {node: '>=12'}
hasBin: true hasBin: true
escalade@3.2.0:
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
engines: {node: '>=6'}
escape-html@1.0.3: escape-html@1.0.3:
resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
@@ -888,10 +866,6 @@ packages:
functions-have-names@1.2.3: functions-have-names@1.2.3:
resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
get-caller-file@2.0.5:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*}
get-intrinsic@1.2.4: get-intrinsic@1.2.4:
resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
@@ -1111,11 +1085,6 @@ packages:
resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==}
engines: {node: '>=6'} engines: {node: '>=6'}
localtunnel@2.0.2:
resolution: {integrity: sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==}
engines: {node: '>=8.3.0'}
hasBin: true
locate-character@3.0.0: locate-character@3.0.0:
resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==}
@@ -1227,9 +1196,6 @@ packages:
ms@2.0.0: ms@2.0.0:
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
ms@2.1.2:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
ms@2.1.3: ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@@ -1290,9 +1256,6 @@ packages:
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
openurl@1.1.1:
resolution: {integrity: sha512-d/gTkTb1i1GKz5k3XE3XFV/PxQ1k45zDqGP2OA7YhgsaLoqm6qRvARAZOFer1fcXritWlGBRCu/UgeS4HAnXAA==}
package-json-from-dist@1.0.0: package-json-from-dist@1.0.0:
resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==}
@@ -1376,10 +1339,6 @@ packages:
resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
require-directory@2.1.1:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
resolve@1.22.8: resolve@1.22.8:
resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==}
hasBin: true hasBin: true
@@ -1699,18 +1658,6 @@ packages:
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
engines: {node: '>=0.4'} engines: {node: '>=0.4'}
y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
yargs-parser@20.2.9:
resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
engines: {node: '>=10'}
yargs@17.1.1:
resolution: {integrity: sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==}
engines: {node: '>=12'}
snapshots: snapshots:
'@ampproject/remapping@2.3.0': '@ampproject/remapping@2.3.0':
@@ -2110,15 +2057,9 @@ snapshots:
dependencies: dependencies:
possible-typed-array-names: 1.0.0 possible-typed-array-names: 1.0.0
axios@0.21.4(debug@4.3.2):
dependencies:
follow-redirects: 1.15.9(debug@4.3.2)
transitivePeerDependencies:
- debug
axios@1.7.7: axios@1.7.7:
dependencies: dependencies:
follow-redirects: 1.15.9(debug@4.3.2) follow-redirects: 1.15.9
form-data: 4.0.0 form-data: 4.0.0
proxy-from-env: 1.1.0 proxy-from-env: 1.1.0
transitivePeerDependencies: transitivePeerDependencies:
@@ -2200,12 +2141,6 @@ snapshots:
ci-info@3.9.0: {} ci-info@3.9.0: {}
cliui@7.0.4:
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
code-red@1.0.4: code-red@1.0.4:
dependencies: dependencies:
'@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/sourcemap-codec': 1.5.0
@@ -2280,10 +2215,6 @@ snapshots:
dependencies: dependencies:
ms: 2.0.0 ms: 2.0.0
debug@4.3.2:
dependencies:
ms: 2.1.2
debug@4.3.7: debug@4.3.7:
dependencies: dependencies:
ms: 2.1.3 ms: 2.1.3
@@ -2391,8 +2322,6 @@ snapshots:
'@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-ia32': 0.21.5
'@esbuild/win32-x64': 0.21.5 '@esbuild/win32-x64': 0.21.5
escalade@3.2.0: {}
escape-html@1.0.3: {} escape-html@1.0.3: {}
escape-string-regexp@1.0.5: {} escape-string-regexp@1.0.5: {}
@@ -2471,9 +2400,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
follow-redirects@1.15.9(debug@4.3.2): follow-redirects@1.15.9: {}
optionalDependencies:
debug: 4.3.2
for-each@0.3.3: for-each@0.3.3:
dependencies: dependencies:
@@ -2503,8 +2430,6 @@ snapshots:
functions-have-names@1.2.3: {} functions-have-names@1.2.3: {}
get-caller-file@2.0.5: {}
get-intrinsic@1.2.4: get-intrinsic@1.2.4:
dependencies: dependencies:
es-errors: 1.3.0 es-errors: 1.3.0
@@ -2728,15 +2653,6 @@ snapshots:
kleur@4.1.5: {} kleur@4.1.5: {}
localtunnel@2.0.2:
dependencies:
axios: 0.21.4(debug@4.3.2)
debug: 4.3.2
openurl: 1.1.1
yargs: 17.1.1
transitivePeerDependencies:
- supports-color
locate-character@3.0.0: {} locate-character@3.0.0: {}
lru-cache@10.4.3: {} lru-cache@10.4.3: {}
@@ -2824,8 +2740,6 @@ snapshots:
ms@2.0.0: {} ms@2.0.0: {}
ms@2.1.2: {}
ms@2.1.3: {} ms@2.1.3: {}
multer@1.4.5-lts.1: multer@1.4.5-lts.1:
@@ -2878,8 +2792,6 @@ snapshots:
dependencies: dependencies:
ee-first: 1.1.1 ee-first: 1.1.1
openurl@1.1.1: {}
package-json-from-dist@1.0.0: {} package-json-from-dist@1.0.0: {}
parseurl@1.3.3: {} parseurl@1.3.3: {}
@@ -2966,8 +2878,6 @@ snapshots:
es-errors: 1.3.0 es-errors: 1.3.0
set-function-name: 2.0.2 set-function-name: 2.0.2
require-directory@2.1.1: {}
resolve@1.22.8: resolve@1.22.8:
dependencies: dependencies:
is-core-module: 2.15.1 is-core-module: 2.15.1
@@ -3324,17 +3234,3 @@ snapshots:
ws@7.5.10: {} ws@7.5.10: {}
xtend@4.0.2: {} xtend@4.0.2: {}
y18n@5.0.8: {}
yargs-parser@20.2.9: {}
yargs@17.1.1:
dependencies:
cliui: 7.0.4
escalade: 3.2.0
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
yargs-parser: 20.2.9

Binary file not shown.

View File

@@ -8,6 +8,7 @@ export default class RecipeAPI extends APIRoute {
constructor() { constructor() {
super('/recipes'); super('/recipes');
this.addSubRoute('/bulk', 'get', this.bulk);
this.addSubRoute('/create', 'post', this.createRecipe); this.addSubRoute('/create', 'post', this.createRecipe);
this.addSubRoute('/:id', 'get', this.get); this.addSubRoute('/:id', 'get', this.get);
this.addSubRoute('/:id/rate', 'post', this.rate); this.addSubRoute('/:id/rate', 'post', this.rate);
@@ -21,6 +22,15 @@ export default class RecipeAPI extends APIRoute {
res.send(result); res.send(result);
} }
async bulk(req, res) {
let userID = req.query.userID;
let db = req.app.get('mongo').recipes;
let result = await db.getAll({ userID: userID });
res.send(result);
}
async createRecipe(req, res) { async createRecipe(req, res) {
let recipe = req.body; let recipe = req.body;

View File

@@ -46,7 +46,7 @@ export default class Recipes {
mealType: recipe.mealType, mealType: recipe.mealType,
instructions: recipe.instructions, instructions: recipe.instructions,
ratingCount: 0, ratingCount: 0,
rating: 0 rating: 0,
}, this.upsert); }, this.upsert);
return await this.get(Id); return await this.get(Id);
} }
@@ -56,8 +56,7 @@ export default class Recipes {
} }
async getAll(query) { async getAll(query) {
let data = await this.model.find(query); return await this.model.find(query);
return data
} }
async update(Id, data) { async update(Id, data) {
@@ -66,13 +65,6 @@ export default class Recipes {
return await this.get(Id); return await this.get(Id);
} }
async increment(Id, field, amount) {
let result = await this.get(Id);
if(!result) return null;
return await this.get(Id);
}
async delete(Id) { async delete(Id) {
let result = await this.get(Id); let result = await this.get(Id);
if(!result) return false; if(!result) return false;

BIN
src.zip Normal file

Binary file not shown.

View File

@@ -15,7 +15,7 @@
{ #if $page.data.authInfo } { #if $page.data.authInfo }
<a class="btn btn-primary shadow" role="button" href="https://auth.fooddecisive.co/account" style="background: rgb(55, 99, 244);">Dashboard</a> <a class="btn btn-primary shadow" role="button" href="https://auth.fooddecisive.co/account" style="background: rgb(55, 99, 244);">Dashboard</a>
{ :else } { :else }
<a class="btn btn-primary shadow" role="button" href="https://auth.fooddecisive.co/" style="background: rgb(55, 99, 244);">Sign up</a> <a class="btn btn-primary shadow" role="button" href="https://auth.fooddecisive.co/" style="background: rgb(55, 99, 244);">Sign In</a>
{ /if } { /if }
</div> </div>
</div> </div>

View File

@@ -8,10 +8,12 @@
import SignIn from './SignIn.svelte'; import SignIn from './SignIn.svelte';
console.log($page.data.authInfo);
let formData = writable({ let formData = writable({
answers: [], answers: [],
currentQuestion: 1, currentQuestion: 1,
userID: $page.data.authInfo ? $page.data.authInfo.id : null, userID: $page.data.authInfo.user.userId || null,
}); });
export let numQuestion = 0; export let numQuestion = 0;
@@ -91,7 +93,7 @@
} }
function signIn() { function signIn() {
goto("https://auth.fooddecisive.co/"); location.href = 'https://auth.fooddecisive.co/';
} }

View File

@@ -0,0 +1,53 @@
<script>
// @ts-nocheck
import { onMount } from 'svelte';
import RecipleEntry from './RecipleEntry.svelte';
import { page } from '$app/stores';
let recipes;
onMount(async() => {
recipes = await (await fetch(`/api/recipes/bulk?userID=${$page.data.authInfo.user.userId}`)).json();
console.log(recipes);
});
</script>
<table class="table my-0" id="dataTable">
<thead>
<tr>
<th>Name</th>
<th>Ingredients</th>
<th>Instructions</th>
<th>Rating</th>
<th></th>
</tr>
</thead>
<tbody>
{#if recipes}
{#each recipes as recipe}
<RecipleEntry data={recipe} />
{/each}
{/if}
</tbody>
</table>
<style>
table {
width: 90%;
margin: auto;
background-color: var(--bs-dark-rgb);
border-radius: 10px;
}
th {
color: white;
text-align: left;
padding: 10px;
height: auto;
}
tr:nth-child(odd) {
background-color: var(--bs-dark-rgb);
}
</style>

View File

@@ -0,0 +1,30 @@
<script>
// @ts-nocheck
import { goto } from "$app/navigation";
export let data;
function openRecipe() {
goto(`/food/${data.id}`, { replaceState: false });
}
</script>
<tr>
<td>{data.name}</td>
<td>{data.ingredients.length || 0}</td>
<td>{data.instructions.length || 0}</td>
<td>{Math.round(data.rating/((data.ratingCount == 0 ) ? data.ratingCount++ : data.ratingCount))} / 5</td>
<td>
<button on:click={openRecipe} class="btn btn-primary">Open</button>
</td>
</tr>
<style>
td {
color: white;
text-align: left;
padding: 10px;
height: auto;
}
</style>

View File

@@ -1,20 +1,14 @@
// import {createClient} from "@propelauth/javascript"; import {createClient} from "@propelauth/javascript";
// const authClient = createClient({ const authClient = createClient({
// authUrl: "https://auth.fooddecisive.co/", authUrl: "https://auth.fooddecisive.co/",
// enableBackgroundTokenRefresh: true, enableBackgroundTokenRefresh: true,
// }); });
// export async function load() { export async function load() {
// const authInfo = await authClient.getAuthenticationInfoOrNull(); const authInfo = await authClient.getAuthenticationInfoOrNull();
// console.log("authInfo", authInfo) console.log("authInfo", authInfo)
// if (authInfo) { return {
// console.log("User is logged in as", authInfo.user.email) authInfo: authInfo ? authInfo : null
// } else { };
// console.log("User is not logged in") }
// }
// return {
// authInfo: authInfo ? authInfo : null
// };
// }

View File

@@ -1,3 +1,8 @@
<script>
import { page } from '$app/stores';
import RecipeTable from '$lib/components/recipes/RecipeTable.svelte';
</script>
<header class="bg-dark"> <header class="bg-dark">
<div class="container pt-4 pt-xl-5"> <div class="container pt-4 pt-xl-5">
@@ -77,20 +82,15 @@
<div class="container py-5" style="padding: 48px 12px;padding-top: 48px;"> <div class="container py-5" style="padding: 48px 12px;padding-top: 48px;">
<div class="row mb-5" style="height: 200px;"> <div class="row mb-5" style="height: 200px;">
<div class="col-md-8 col-xl-6 text-center mx-auto" style="height: 200px;"> <div class="col-md-8 col-xl-6 text-center mx-auto" style="height: 200px;">
<h2 class="fw-bold" style="font-size: 60px;"><a href="/survey"><strong>Get Started</strong></a></h2> { #if $page.data.authInfo }
<p class="text-muted" style="font-size: 32px;color: var(--bs-emphasis-color);">Decide Your Next Bite!</p> <h2 class="fw-bold" style="font-size: 60px;"><a href="/survey"><strong>Decide Your Next Bite!</strong></a></h2>
<RecipeTable />
{ :else }
<h2 class="fw-bold" style="font-size: 60px;"><a href="/survey"><strong>Get Started</strong></a></h2>
<p class="text-muted" style="font-size: 32px;color: var(--bs-emphasis-color);">Decide Your Next Bite!</p>
{ /if }
</div> </div>
</div> </div>
<p style=" margin: auto; text-align:center; font-size: 1.6rem;">Submitted for VTHacks-12</p>
</div> </div>
</section> </section>
<section class="py-5">
<section class="py-5">
<div class="container text-center py-5">
<p class="mb-4" style="font-size: 1.6rem;">Submitted for VTHacks-12</p>
</div>
</section>
</section>
<style>
</style>