diff --git a/migrations/0010_lean_gamma_corps.sql b/migrations/0010_lean_gamma_corps.sql new file mode 100644 index 00000000..81eb4e1e --- /dev/null +++ b/migrations/0010_lean_gamma_corps.sql @@ -0,0 +1 @@ +ALTER TABLE "user" ADD COLUMN "icon" text; \ No newline at end of file diff --git a/migrations/meta/0010_snapshot.json b/migrations/meta/0010_snapshot.json new file mode 100644 index 00000000..a5a5fdd4 --- /dev/null +++ b/migrations/meta/0010_snapshot.json @@ -0,0 +1,207 @@ +{ + "id": "d6cd08c8-9dc8-42df-aab9-0f5800602864", + "prevId": "1d83805d-6ee2-4dae-87a6-5af6f2d5add3", + "version": "5", + "dialect": "pg", + "tables": { + "featuredAdventures": { + "name": "featuredAdventures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_user_id_fk": { + "name": "session_user_id_user_id_fk", + "tableFrom": "session", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "sharedAdventures": { + "name": "sharedAdventures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "data": { + "name": "data", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "first_name": { + "name": "first_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "last_name": { + "name": "last_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hashed_password": { + "name": "hashed_password", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "userVisitedAdventures": { + "name": "userVisitedAdventures", + "schema": "", + "columns": { + "adventure_id": { + "name": "adventure_id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adventure_name": { + "name": "adventure_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "visited_date": { + "name": "visited_date", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "userVisitedAdventures_user_id_user_id_fk": { + "name": "userVisitedAdventures_user_id_user_id_fk", + "tableFrom": "userVisitedAdventures", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": {}, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json index 226286d5..3f770a8d 100644 --- a/migrations/meta/_journal.json +++ b/migrations/meta/_journal.json @@ -71,6 +71,13 @@ "when": 1712407140727, "tag": "0009_spotty_madame_web", "breakpoints": true + }, + { + "idx": 10, + "version": "5", + "when": 1712842196443, + "tag": "0010_lean_gamma_corps", + "breakpoints": true } ] } \ No newline at end of file diff --git a/package.json b/package.json index 6b54d1a3..4e319ad1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adventurelog", - "version": "0.0.1", + "version": "0.1.0", "description": "Embark, Explore, Remember. 🌍", "private": true, "scripts": { diff --git a/src/lib/components/UserAvatar.svelte b/src/lib/components/UserAvatar.svelte index 0df60ef3..133562b4 100644 --- a/src/lib/components/UserAvatar.svelte +++ b/src/lib/components/UserAvatar.svelte @@ -2,7 +2,14 @@ import { enhance } from "$app/forms"; import { goto } from "$app/navigation"; export let user: any; - let firstLetter = user.first_name.charAt(0); + + let icon: string = ""; + + if (user.icon != null && user.icon != "") { + icon = user.icon; + } else { + icon = user.username.charAt(0); + } async function navToSettings() { goto("/settings"); @@ -15,7 +22,7 @@
Hi, {user.first_name} {user.last_name}
+ {#if quote != ""} + "{quote}" + {/if} + ++