@@ -300,4 +338,18 @@ font-family: monospace; color: #eaffeb; } + .titleContainer { + display: flex; + align-items: center; + justify-content: space-between; + margin: -0.5rem 0 1rem; + } + .title-fav { + font-size: 2rem; + background: rgba(0, 0, 0, 0.4); + border-radius: 50%; + padding: 0.25rem; + box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.7); + color: red; + } diff --git a/src/routes/space/[id]/edit/+page.svelte b/src/routes/space/[id]/edit/+page.svelte index a1d0253..067053d 100644 --- a/src/routes/space/[id]/edit/+page.svelte +++ b/src/routes/space/[id]/edit/+page.svelte @@ -658,34 +658,4 @@ background-color: #eaffeb; border-radius: 5rem; } - .opening-times { - display: flex; - flex-direction: column; - gap: 0.5rem; - } - - .opening-time-item { - display: flex; - align-items: center; - gap: 0.5rem; - } - - .opening-time-item label { - margin-top: 0; - width: 6rem; - } - - .opening-time-item input[type="time"] { - padding: 0.5rem; - height: 2.5rem; - border-radius: 0.5rem; - border: 2px solid #eaffeb; - background: none; - color: #eaffeb; - } - - .opening-time-item span { - margin: 0 0.5rem; - color: #eaffeb; - } diff --git a/supabase/migrations/20250612104310_users-admin.sql b/supabase/migrations/20250612104310_users-admin.sql index 1db2a4b..b44a698 100644 --- a/supabase/migrations/20250612104310_users-admin.sql +++ b/supabase/migrations/20250612104310_users-admin.sql @@ -26,3 +26,16 @@ $$; CREATE TRIGGER users_handle_new_user AFTER INSERT ON auth.users FOR EACH ROW EXECUTE FUNCTION handle_new_user(); + +-- Table to store users' favourite study spaces +CREATE TABLE favourite_study_spaces ( + user_id uuid REFERENCES users(id) ON DELETE CASCADE, + study_space_id uuid REFERENCES study_spaces(id) ON DELETE CASCADE, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + PRIMARY KEY (user_id, study_space_id) +); + +CREATE TRIGGER favourite_study_spaces_updated_at +AFTER UPDATE ON favourite_study_spaces +FOR EACH ROW EXECUTE FUNCTION handle_updated_at(); diff --git a/supabase/schemas/0001_users.sql b/supabase/schemas/0001_users.sql index e94c8c1..6931379 100644 --- a/supabase/schemas/0001_users.sql +++ b/supabase/schemas/0001_users.sql @@ -26,3 +26,16 @@ $$; CREATE TRIGGER users_handle_new_user AFTER INSERT ON auth.users FOR EACH ROW EXECUTE FUNCTION handle_new_user(); + +-- Table to store users' favourite study spaces +CREATE TABLE favourite_study_spaces ( + user_id uuid REFERENCES users(id) ON DELETE CASCADE, + study_space_id uuid REFERENCES study_spaces(id) ON DELETE CASCADE, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + PRIMARY KEY (user_id, study_space_id) +); + +CREATE TRIGGER favourite_study_spaces_updated_at +AFTER UPDATE ON favourite_study_spaces +FOR EACH ROW EXECUTE FUNCTION handle_updated_at();