From 8d098d9cb2720d936dbc99328fb7b160eb6f28e4 Mon Sep 17 00:00:00 2001 From: Justin Xue <67207128+jxmoose@users.noreply.github.com> Date: Wed, 22 May 2024 11:17:54 -0700 Subject: [PATCH] Justin exhibit redo (#67) * added database and page * fixed lint errors lol... * style changes * prettier * added database and page * fixed lint errors lol... * update package-lock * small style * added exhibit component * adding comp * finished? * added to nav bar * removed cateogry for now * prettier changes * feat: disabling github actions until MPH / post-MPH * chore: prettier * chore: disabled only the tsc compiler for now * adding comp * finished? * prettier changes * removed category from table and small fixes * added linking from map * added database and page * fixed lint errors lol... * style changes * prettier * added database and page * fixed lint errors lol... * update package-lock * small style * added exhibit component * adding comp * finished? * added to nav bar * removed cateogry for now * prettier changes * feat: disabling github actions until MPH / post-MPH * chore: prettier * chore: disabled only the tsc compiler for now * adding comp * finished? * prettier changes * removed category from table and small fixes * added linking from map * design changes + adding active state to buttons * big database edits to make fun facts possible on map * supabase function change * documentation changes + tailwind changes * small styling changes * some wbe changes * maybe will make components equal heightsl ater if have time i cant figure it out lol fml * web resize changes * edit nav bar * added database and page * fixed lint errors lol... * style changes * prettier * added database and page * fixed lint errors lol... * update package-lock * small style * added exhibit component * adding comp * finished? * added to nav bar * removed cateogry for now * prettier changes * feat: disabling github actions until MPH / post-MPH * chore: prettier * chore: disabled only the tsc compiler for now * adding comp * finished? * prettier changes * removed category from table and small fixes * added linking from map * added database and page * fixed lint errors lol... * style changes * prettier * fixed lint errors lol... * update package-lock * small style * added exhibit component * adding comp * finished? * added to nav bar * removed cateogry for now * prettier changes * adding comp * finished? * prettier changes * removed category from table and small fixes * added linking from map * design changes + adding active state to buttons * big database edits to make fun facts possible on map * supabase function change * documentation changes + tailwind changes * small styling changes * some wbe changes * maybe will make components equal heightsl ater if have time i cant figure it out lol fml * web resize changes * edit nav bar * small post rebase fixes --------- Co-authored-by: Andrei Tan <73627326+andreisito@users.noreply.github.com> Co-authored-by: sarahhpeng <137237272+sarahhpeng@users.noreply.github.com> --- .github/workflows/lint.yml | 65 ++ src/app/exhibitsPage/page.tsx | 142 ++++ src/app/layout.tsx | 1 - .../userComponents/Exhibit/Exhibit.tsx | 65 ++ .../ExhibitDisplay/ExhibitDisplay.module.css | 124 --- .../SiteMap/DisplayPreviewCard.tsx | 1 - .../SiteMap/ExhibitPreviewCard.tsx | 2 +- .../userComponents/navBar/navBar.tsx | 6 + src/supabase/category/queries.tsx | 16 +- src/supabase/exhibits/queries.tsx | 2 +- src/supabase/tour_displays/queries.tsx | 5 +- src/types/supabase.ts | 767 +++++++++--------- tailwind.config.ts | 3 + 13 files changed, 682 insertions(+), 517 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 src/app/exhibitsPage/page.tsx create mode 100644 src/components/userComponents/Exhibit/Exhibit.tsx delete mode 100644 src/components/userComponents/ExhibitDisplay/ExhibitDisplay.module.css diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..4235a8f7 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,65 @@ +--- +name: Lint + +############################# +# Start the job on push # +############################# +on: + push: + branches-ignore: [main] + pull_request: + branches: [main] + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Run ESLint, Prettier, and TypeScript compiler + # Set the agent to run on + runs-on: ubuntu-latest + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper + # list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Install packages # + ################################ + - name: Install packages + run: npm ci + ################################ + # Lint codebase # + ################################ + - name: Run ESLint + run: npx lint-staged + ################################ + # Check Prettier on codebase # + ################################ + - name: Run Prettier + run: npx prettier --check . + ################################ + # Check for TypeScript errors # + # TODO: Add this back once outstanding issues are resolved by all devs. + ################################ + # - name: Run TypeScript compiler (tsc) on staged files + # run: | + # # Get list of staged TypeScript files + # files=$(git diff --cached --name-only --diff-filter=d | grep '\.tsx\?$') + + # # Run tsc on each file + # for file in $files + # do + # npx tsc --noEmit $file || exit 1 + # done diff --git a/src/app/exhibitsPage/page.tsx b/src/app/exhibitsPage/page.tsx new file mode 100644 index 00000000..ab4de68d --- /dev/null +++ b/src/app/exhibitsPage/page.tsx @@ -0,0 +1,142 @@ +'use client'; + +import React, { useEffect, useState } from 'react'; +import Link from 'next/link'; +import NavBar from '../../components/userComponents/navBar/navBar'; +import { CategoryRow } from '../../types/types'; +import { fetchAllCategories } from '../../supabase/category/queries'; +import Exhibit from '../../components/userComponents/Exhibit/Exhibit'; +import BackButton from '../../components/userComponents/BackButton/page'; +import { useWebDeviceDetection } from '../../context/WindowWidthContext/WindowWidthContext'; + +/** + * @returns exhibit page + */ +function App() { + const isWebDevice = useWebDeviceDetection(); + const [exhibits, setExhibits] = useState([]); + // fetches all the exhibits to display on the page + useEffect(() => { + // Get exhibits + const getExhibits = async () => { + const fetchedExhibits: CategoryRow[] = await fetchAllCategories(); + setExhibits(fetchedExhibits); + }; + getExhibits(); + // Detect the hash in URL and scroll to the element with the corresponding ID + }, [exhibits]); + + // activates whenever the page opens. + // checks if there's a "hash" which is an id of one of the exhibits to scroll to. + // scrolls down to corresponding exhibit with slight offset + useEffect(() => { + const { hash } = window.location; + if (hash) { + setTimeout(() => { + const element = document.querySelector(hash); + const yOffset = -200; + if (element) { + const y = + element.getBoundingClientRect().top + window.scrollY + yOffset; + // check on this offset later + window.scrollTo({ top: y, behavior: 'instant' }); + } + }, 1000); + } + }, []); + return ( +
+ {!isWebDevice && ( +
+ +
+ +
+

+ Our Exhibits{' '} +

+

+ The Bay Area is home to a wide variety of plant and animal life. + As you explore the exhibits, you will learn about threatened and + endangered species that are under careful monitoring by + biologists. Protective conservation efforts are in place for + these vulnerable plants and animals. We welcome you to learn + more about these important species throughout the exhibits. Scan + the QR codes on display for more information. +

+
+ +
+

+ Go to Map +

+
+ +
    + {exhibits.map(exhibit => ( + + ))} +
+
+
+ )} + {isWebDevice && ( +
+ +
+

+ {' '} + + {' '} + Home{' '} + {' '} + / Our Exhibits{' '} +

+
+

+ Our Exhibits{' '} +

+

+ The Bay Area is home to a wide variety of plant and animal life. + As you explore the exhibits, you will learn about threatened and + endangered species that are under careful monitoring by + biologists. Protective conservation efforts are in place for + these vulnerable plants and animals. We welcome you to learn + more about these important species throughout the exhibits. Scan + the QR codes on display for more information. +

+
+ +
+

+ Go to Map +

+
+ +
+ {exhibits.map(exhibit => ( + + ))} +
+
+
+ )} +
+ ); +} + +export default App; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e041b26a..26910912 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -12,7 +12,6 @@ export const metadata: Metadata = { title: 'Create Next App', description: 'Generated by create next app', }; - /** * @param root0 - Destructured object containing the properties. * @param root0.children - The child elements to be rendered within the RootLayout component. diff --git a/src/components/userComponents/Exhibit/Exhibit.tsx b/src/components/userComponents/Exhibit/Exhibit.tsx new file mode 100644 index 00000000..8a099efc --- /dev/null +++ b/src/components/userComponents/Exhibit/Exhibit.tsx @@ -0,0 +1,65 @@ +import React from 'react'; +import Image from 'next/image'; +import { useWebDeviceDetection } from '../../../context/WindowWidthContext/WindowWidthContext'; + +/** + * + * @param root0 passed in + * @param root0.title title of exhibit + * @param root0.description description of exhibit + * @param root0.image image + * @param root0.id id of exhibit + * @param root0.web + * @returns exhibit component + */ +export default function Exhibit({ + title, + description, + image, + id, +}: { + title: string; + description: string; + image: string; + id: number; +}) { + const isWebDevice = useWebDeviceDetection(); + return ( +
+ {!isWebDevice && ( +
  • +
    +
    +
    +

    + {title} +

    +
    +

    + {description} +

    + Exhibit +
    +
    +
  • + )} + {isWebDevice && ( +
    +
    +
    +

    + {' '} + {title} +

    +
    +

    + {description} +

    +
    + Exhibit +
    +
    + )} +
    + ); +} diff --git a/src/components/userComponents/ExhibitDisplay/ExhibitDisplay.module.css b/src/components/userComponents/ExhibitDisplay/ExhibitDisplay.module.css deleted file mode 100644 index 72391c8d..00000000 --- a/src/components/userComponents/ExhibitDisplay/ExhibitDisplay.module.css +++ /dev/null @@ -1,124 +0,0 @@ -.outercontainer { - background-color: white; - width: 100%; - height: 100%; -} - -.logobox { - background-color: darkgray; - width: 100%; - height: 93px; - padding: 21px; - flex-shrink: 0; -} - -.logo { - background-color: white; - width: 141px; - height: 52px; - flex-shrink: 0; -} - -.imagebox { - width: 100%; - height: 224px; - flex-shrink: 0; - justify-content: center; -} - -.bottombox { - background-color: white; - width: 100%; - height: 1073px; - padding: 18px; -} - -.namebox { - width: 390x; - height: 77px; - padding-top: 37px; - padding-bottom: 11px; - justify-content: flex-start; -} - -.nametext { - color: #0d0b0b; - font-family: Inter; - font-size: 24px; - font-style: normal; - font-weight: 700; - line-height: normal; - letter-spacing: -0.5px; -} - -.locationtext { - color: #0d0b0b; - font-family: Inter; - font-size: 14px; - font-style: italic; - font-weight: 400; - line-height: 20px; /* 142.857% */ - letter-spacing: -0.5px; -} - -.informationbox { - width: 390x; - height: 62px; - padding-top: 27px; - padding-bottom: 11px; - justify-content: flex-start; -} - -.informationtext { - color: #0d0b0b; - font-family: Inter; - font-size: 20px; - font-style: normal; - font-weight: 500; - line-height: normal; - letter-spacing: -0.5px; -} - -.descriptiontext { - color: #0d0b0b; - font-family: Inter; - font-size: 16px; - font-style: normal; - font-weight: 400; - line-height: 20px; /* 125% */ - letter-spacing: -0.5px; - padding-bottom: 16px; -} - -.relatednewsbox { - width: 390x; - height: 78px; - padding-top: 32px; - padding-bottom: 22px; - justify-content: flex-start; -} - -.relatedtext { - color: #0d0b0b; - font-family: Inter; - font-size: 20px; - font-style: normal; - font-weight: 500; - line-height: normal; - letter-spacing: -0.5px; -} - -.newsbox { - width: 100%; - height: 120px; - display: flex; - flex-direction: row; /* Make the items stack vertically */ - justify-content: space-between; /* Distribute space between items vertically */ - align-items: center; - gap: 19px; -} - -.moretextbox { - width: 208px; - height: 120px; -} diff --git a/src/components/userComponents/SiteMap/DisplayPreviewCard.tsx b/src/components/userComponents/SiteMap/DisplayPreviewCard.tsx index eb2e6c49..8b0459af 100644 --- a/src/components/userComponents/SiteMap/DisplayPreviewCard.tsx +++ b/src/components/userComponents/SiteMap/DisplayPreviewCard.tsx @@ -62,7 +62,6 @@ function DisplayPreviewCard({ // const imageObj = await fetchExhibitImage(tour.id); // if (imageObj) { imageUrl = tour.image; - console.log(tour); // } displayName = tour.category; } diff --git a/src/components/userComponents/SiteMap/ExhibitPreviewCard.tsx b/src/components/userComponents/SiteMap/ExhibitPreviewCard.tsx index 2a79e647..f359e9d5 100644 --- a/src/components/userComponents/SiteMap/ExhibitPreviewCard.tsx +++ b/src/components/userComponents/SiteMap/ExhibitPreviewCard.tsx @@ -121,7 +121,7 @@ function ExhibitPreviewCard({ />
    - +

    {name1}

    diff --git a/src/components/userComponents/navBar/navBar.tsx b/src/components/userComponents/navBar/navBar.tsx index c2803076..46cbb9e9 100644 --- a/src/components/userComponents/navBar/navBar.tsx +++ b/src/components/userComponents/navBar/navBar.tsx @@ -74,6 +74,12 @@ export default function NavBar() { > Site Maps + + Exhibits +

    LEARN & EXPLORE diff --git a/src/supabase/category/queries.tsx b/src/supabase/category/queries.tsx index 16e83ac5..1624ba41 100644 --- a/src/supabase/category/queries.tsx +++ b/src/supabase/category/queries.tsx @@ -1,6 +1,6 @@ 'use client'; -import { DisplayRow } from '../../types/types'; +import { CategoryRow } from '../../types/types'; import supabase from '../client'; // eslint-disable-next-line jsdoc/require-returns @@ -22,6 +22,8 @@ import supabase from '../client'; // Assume this function is in `supabase/category/queries.js` /** * + * @param category which category to get color from + * @returns color of category */ // eslint-disable-next-line import/prefer-default-export export async function getCategoryColor1(category: string) { @@ -46,3 +48,15 @@ export async function getCategoryColor1(category: string) { return null; } } + +/** + * Fetches all categories from the database. + * @returns A promise that resolves to an array of ExhibitRow objects. + */ +export async function fetchAllCategories(): Promise { + const { data, error } = await supabase.from('categories').select('*'); + if (error) { + throw new Error(error.message); + } + return data; +} diff --git a/src/supabase/exhibits/queries.tsx b/src/supabase/exhibits/queries.tsx index 958b620a..a72d9566 100644 --- a/src/supabase/exhibits/queries.tsx +++ b/src/supabase/exhibits/queries.tsx @@ -40,7 +40,7 @@ export async function fetchExhibitImage( exhibitId: string, ): Promise<{ image: string }> { const { data, error } = await supabase - .from('exhibits') + .from('categories') .select('image') .eq('id', exhibitId) .single(); diff --git a/src/supabase/tour_displays/queries.tsx b/src/supabase/tour_displays/queries.tsx index 66f5522f..2dd16c73 100644 --- a/src/supabase/tour_displays/queries.tsx +++ b/src/supabase/tour_displays/queries.tsx @@ -41,9 +41,8 @@ export async function fetchMatchingTourDisplayIdsfromSpotlight(tourId: string) { * @returns given a spotlight ID, get all the displays */ export async function fetchDisplayfromSpotlight(spotlightId: string) { - const displayIds: string[] = await fetchMatchingTourDisplayIdsfromSpotlight( - spotlightId, - ); + const displayIds: string[] = + await fetchMatchingTourDisplayIdsfromSpotlight(spotlightId); const displays: DisplayRow[] = await fetchDisplaysfromIds(displayIds); return displays; } diff --git a/src/types/supabase.ts b/src/types/supabase.ts index 1b8b1f7f..d2ed141d 100644 --- a/src/types/supabase.ts +++ b/src/types/supabase.ts @@ -4,524 +4,521 @@ export type Json = | boolean | null | { [key: string]: Json | undefined } - | Json[]; + | Json[] export type Database = { public: { Tables: { categories: { Row: { - category: string | null; - color_hex: string; - created_at: string; - description: string | null; - id: number; - image: string | null; - }; + category: string | null + color_hex: string + created_at: string + description: string + id: number + image: string + } Insert: { - category?: string | null; - color_hex: string; - created_at?: string; - description?: string | null; - id?: number; - image?: string | null; - }; + category?: string | null + color_hex: string + created_at?: string + description: string + id?: number + image: string + } Update: { - category?: string | null; - color_hex?: string; - created_at?: string; - description?: string | null; - id?: number; - image?: string | null; - }; - Relationships: []; - }; + category?: string | null + color_hex?: string + created_at?: string + description?: string + id?: number + image?: string + } + Relationships: [] + } display_media: { Row: { - display_id: string; - media_id: string; - media_placement: string | null; - }; + display_id: string + media_id: string + media_placement: string | null + } Insert: { - display_id: string; - media_id: string; - media_placement?: string | null; - }; + display_id: string + media_id: string + media_placement?: string | null + } Update: { - display_id?: string; - media_id?: string; - media_placement?: string | null; - }; + display_id?: string + media_id?: string + media_placement?: string | null + } Relationships: [ { - foreignKeyName: 'display_media_display_id_fkey'; - columns: ['display_id']; - isOneToOne: false; - referencedRelation: 'displays'; - referencedColumns: ['id']; + foreignKeyName: "display_media_display_id_fkey" + columns: ["display_id"] + isOneToOne: false + referencedRelation: "displays" + referencedColumns: ["id"] }, { - foreignKeyName: 'display_media_media_id_fkey'; - columns: ['media_id']; - isOneToOne: false; - referencedRelation: 'media'; - referencedColumns: ['id']; + foreignKeyName: "display_media_media_id_fkey" + columns: ["media_id"] + isOneToOne: false + referencedRelation: "media" + referencedColumns: ["id"] }, - ]; - }; + ] + } displays: { Row: { - coordinates: Json | null; - created_at: string; - description: string; - id: string; - title: string; - updated_at: string | null; - }; + coordinates: Json | null + created_at: string + description: string + id: string + title: string + updated_at: string | null + } Insert: { - coordinates?: Json | null; - created_at?: string; - description?: string; - id?: string; - title?: string; - updated_at?: string | null; - }; + coordinates?: Json | null + created_at?: string + description?: string + id?: string + title?: string + updated_at?: string | null + } Update: { - coordinates?: Json | null; - created_at?: string; - description?: string; - id?: string; - title?: string; - updated_at?: string | null; - }; - Relationships: []; - }; + coordinates?: Json | null + created_at?: string + description?: string + id?: string + title?: string + updated_at?: string | null + } + Relationships: [] + } emails: { Row: { - emails: string | null; - first_name: string | null; - id: number; - }; + emails: string | null + id: number + } Insert: { - emails?: string | null; - first_name?: string | null; - id?: number; - }; + emails?: string | null + id?: number + } Update: { - emails?: string | null; - first_name?: string | null; - id?: number; - }; - Relationships: []; - }; + emails?: string | null + id?: number + } + Relationships: [] + } exhibits: { Row: { - category_id: number; - coordinates: Json | null; - id: string; - title: string; - }; + category_id: number + coordinates: Json | null + id: string + title: string + } Insert: { - category_id: number; - coordinates?: Json | null; - id?: string; - title: string; - }; + category_id: number + coordinates?: Json | null + id?: string + title: string + } Update: { - category_id?: number; - coordinates?: Json | null; - id?: string; - title?: string; - }; + category_id?: number + coordinates?: Json | null + id?: string + title?: string + } Relationships: [ { - foreignKeyName: 'public_exhibits_category_id_fkey'; - columns: ['category_id']; - isOneToOne: false; - referencedRelation: 'categories'; - referencedColumns: ['id']; + foreignKeyName: "public_exhibits_category_id_fkey" + columns: ["category_id"] + isOneToOne: false + referencedRelation: "categories" + referencedColumns: ["id"] }, - ]; - }; + ] + } media: { Row: { - created_at: string; - id: string; - text: string | null; - title: string | null; - type: string | null; - url: string; - }; + created_at: string + id: string + text: string | null + title: string | null + type: string | null + url: string + } Insert: { - created_at?: string; - id?: string; - text?: string | null; - title?: string | null; - type?: string | null; - url?: string; - }; + created_at?: string + id?: string + text?: string | null + title?: string | null + type?: string | null + url?: string + } Update: { - created_at?: string; - id?: string; - text?: string | null; - title?: string | null; - type?: string | null; - url?: string; - }; - Relationships: []; - }; + created_at?: string + id?: string + text?: string | null + title?: string | null + type?: string | null + url?: string + } + Relationships: [] + } news: { Row: { - content_link: string; - created_at: string; - id: string; - title: string; - updated_at: string | null; - }; + content_link: string + created_at: string + id: string + title: string + updated_at: string | null + } Insert: { - content_link: string; - created_at?: string; - id?: string; - title: string; - updated_at?: string | null; - }; + content_link: string + created_at?: string + id?: string + title: string + updated_at?: string | null + } Update: { - content_link?: string; - created_at?: string; - id?: string; - title?: string; - updated_at?: string | null; - }; - Relationships: []; - }; + content_link?: string + created_at?: string + id?: string + title?: string + updated_at?: string | null + } + Relationships: [] + } spotlight_recommendations: { Row: { - source_display_id: string; - target_display_id: string; - }; + source_display_id: string + target_display_id: string + } Insert: { - source_display_id: string; - target_display_id: string; - }; + source_display_id: string + target_display_id: string + } Update: { - source_display_id?: string; - target_display_id?: string; - }; + source_display_id?: string + target_display_id?: string + } Relationships: [ { - foreignKeyName: 'spotlight_recommendations_source_display_id_fkey'; - columns: ['source_display_id']; - isOneToOne: false; - referencedRelation: 'tours'; - referencedColumns: ['id']; + foreignKeyName: "spotlight_recommendations_source_display_id_fkey" + columns: ["source_display_id"] + isOneToOne: false + referencedRelation: "tours" + referencedColumns: ["id"] }, { - foreignKeyName: 'spotlight_recommendations_target_display_id_fkey'; - columns: ['target_display_id']; - isOneToOne: false; - referencedRelation: 'tours'; - referencedColumns: ['id']; + foreignKeyName: "spotlight_recommendations_target_display_id_fkey" + columns: ["target_display_id"] + isOneToOne: false + referencedRelation: "tours" + referencedColumns: ["id"] }, - ]; - }; + ] + } tour_displays: { Row: { - display_id: string; - display_order: number | null; - tour_id: string; - }; + display_id: string + display_order: number | null + tour_id: string + } Insert: { - display_id: string; - display_order?: number | null; - tour_id: string; - }; + display_id: string + display_order?: number | null + tour_id: string + } Update: { - display_id?: string; - display_order?: number | null; - tour_id?: string; - }; + display_id?: string + display_order?: number | null + tour_id?: string + } Relationships: [ { - foreignKeyName: 'tour_displays_display_id_fkey'; - columns: ['display_id']; - isOneToOne: false; - referencedRelation: 'displays'; - referencedColumns: ['id']; + foreignKeyName: "tour_displays_display_id_fkey" + columns: ["display_id"] + isOneToOne: false + referencedRelation: "displays" + referencedColumns: ["id"] }, { - foreignKeyName: 'tour_displays_tour_id_fkey'; - columns: ['tour_id']; - isOneToOne: false; - referencedRelation: 'tours'; - referencedColumns: ['id']; + foreignKeyName: "tour_displays_tour_id_fkey" + columns: ["tour_id"] + isOneToOne: false + referencedRelation: "tours" + referencedColumns: ["id"] }, - ]; - }; + ] + } tour_media: { Row: { - media_id: string; - tour_id: string; - }; + media_id: string + tour_id: string + } Insert: { - media_id: string; - tour_id: string; - }; + media_id: string + tour_id: string + } Update: { - media_id?: string; - tour_id?: string; - }; + media_id?: string + tour_id?: string + } Relationships: [ { - foreignKeyName: 'tour_media_media_id_fkey'; - columns: ['media_id']; - isOneToOne: false; - referencedRelation: 'media'; - referencedColumns: ['id']; + foreignKeyName: "tour_media_media_id_fkey" + columns: ["media_id"] + isOneToOne: false + referencedRelation: "media" + referencedColumns: ["id"] }, { - foreignKeyName: 'tour_media_tour_id_fkey'; - columns: ['tour_id']; - isOneToOne: false; - referencedRelation: 'tours'; - referencedColumns: ['id']; + foreignKeyName: "tour_media_tour_id_fkey" + columns: ["tour_id"] + isOneToOne: false + referencedRelation: "tours" + referencedColumns: ["id"] }, - ]; - }; + ] + } tours: { Row: { - category: Database['public']['Enums']['tour_category']; - coordinates: Json | null; - created_at: string; - description: string | null; - id: string; - name: string; - preview_text: string | null; - spotlight: boolean; - stop_count: number | null; - }; + category: Database["public"]["Enums"]["tour_category"] + coordinates: Json | null + created_at: string + description: string | null + id: string + name: string + preview_text: string | null + spotlight: boolean + stop_count: number | null + } Insert: { - category?: Database['public']['Enums']['tour_category']; - coordinates?: Json | null; - created_at?: string; - description?: string | null; - id?: string; - name: string; - preview_text?: string | null; - spotlight?: boolean; - stop_count?: number | null; - }; + category?: Database["public"]["Enums"]["tour_category"] + coordinates?: Json | null + created_at?: string + description?: string | null + id?: string + name: string + preview_text?: string | null + spotlight?: boolean + stop_count?: number | null + } Update: { - category?: Database['public']['Enums']['tour_category']; - coordinates?: Json | null; - created_at?: string; - description?: string | null; - id?: string; - name?: string; - preview_text?: string | null; - spotlight?: boolean; - stop_count?: number | null; - }; - Relationships: []; - }; - }; + category?: Database["public"]["Enums"]["tour_category"] + coordinates?: Json | null + created_at?: string + description?: string | null + id?: string + name?: string + preview_text?: string | null + spotlight?: boolean + stop_count?: number | null + } + Relationships: [] + } + } Views: { - [_ in never]: never; - }; + [_ in never]: never + } Functions: { fetch_recommended_spotlights: { Args: { - source_spotlight_id: string; - }; + source_spotlight_id: string + } Returns: { - id: string; - name: string; - description: string; - created_at: string; - stop_count: number; - spotlight: boolean; - preview_text: string; - coordinates: Json; - category: Database['public']['Enums']['tour_category']; - }[]; - }; + id: string + name: string + description: string + created_at: string + stop_count: number + spotlight: boolean + preview_text: string + coordinates: Json + category: Database["public"]["Enums"]["tour_category"] + }[] + } fetchimagesfordisplay: { Args: { - displayid: string; - }; + displayid: string + } Returns: { - id: string; - url: string; - type: string; - title: string; - text: string; - created_at: string; - }[]; - }; + id: string + url: string + type: string + title: string + text: string + created_at: string + }[] + } fetchimagesfortour: { Args: { - tourid: string; - }; + tourid: string + } Returns: { - id: string; - url: string; - type: string; - title: string; - text: string; - created_at: string; - }[]; - }; + id: string + url: string + type: string + title: string + text: string + created_at: string + }[] + } get_category_color: { Args: { - category_in: string; - }; - Returns: string; - }; + category_in: string + } + Returns: string + } get_exhibit_details: { - Args: Record; + Args: Record Returns: { - coordinates: Json; - id: number; - category: string; - description: string; - image: string; - }[]; - }; + coordinates: Json + category_id: number + category: string + description: string + image: string + }[] + } get_non_spotlight_tours: { - Args: Record; + Args: Record Returns: { - id: string; - name: string; - description: string; - created_at: string; - stop_count: number; - spotlight: boolean; - preview_text: string; - coordinates: Json; - category: Database['public']['Enums']['tour_category']; - }[]; - }; + id: string + name: string + description: string + created_at: string + stop_count: number + spotlight: boolean + preview_text: string + coordinates: Json + category: Database["public"]["Enums"]["tour_category"] + }[] + } join_all_spotlights_with_media: { - Args: Record; + Args: Record Returns: { - id: string; - name: string; - description: string; - created_at: string; - stop_count: number; - spotlight: boolean; - preview_text: string; - coordinates: Json; - category: Database['public']['Enums']['tour_category']; - media_url: string; - }[]; - }; + id: string + name: string + description: string + created_at: string + stop_count: number + spotlight: boolean + preview_text: string + coordinates: Json + category: Database["public"]["Enums"]["tour_category"] + media_url: string + }[] + } join_all_tours_with_media: { - Args: Record; + Args: Record Returns: { - id: string; - name: string; - description: string; - created_at: string; - stop_count: number; - spotlight: boolean; - preview_text: string; - coordinates: Json; - category: Database['public']['Enums']['tour_category']; - media_url: string; - }[]; - }; - }; + id: string + name: string + description: string + created_at: string + stop_count: number + spotlight: boolean + preview_text: string + coordinates: Json + category: Database["public"]["Enums"]["tour_category"] + media_url: string + }[] + } + } Enums: { - media_type: 'image' | 'video' | 'link'; + media_type: "image" | "video" | "link" tour_category: - | 'BuildingsAndServices' - | 'ParksAviariesEnclosures' - | 'SiteFeatures'; - }; + | "BuildingsAndServices" + | "ParksAviariesEnclosures" + | "SiteFeatures" + } CompositeTypes: { - [_ in never]: never; - }; - }; -}; + [_ in never]: never + } + } +} -type PublicSchema = Database[Extract]; +type PublicSchema = Database[Extract] export type Tables< PublicTableNameOrOptions extends - | keyof (PublicSchema['Tables'] & PublicSchema['Views']) + | keyof (PublicSchema["Tables"] & PublicSchema["Views"]) | { schema: keyof Database }, TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof (Database[PublicTableNameOrOptions['schema']]['Tables'] & - Database[PublicTableNameOrOptions['schema']]['Views']) + ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] & + Database[PublicTableNameOrOptions["schema"]]["Views"]) : never = never, > = PublicTableNameOrOptions extends { schema: keyof Database } - ? (Database[PublicTableNameOrOptions['schema']]['Tables'] & - Database[PublicTableNameOrOptions['schema']]['Views'])[TableName] extends { - Row: infer R; + ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] & + Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends { + Row: infer R } ? R : never - : PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] & - PublicSchema['Views']) - ? (PublicSchema['Tables'] & - PublicSchema['Views'])[PublicTableNameOrOptions] extends { - Row: infer R; - } - ? R + : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & + PublicSchema["Views"]) + ? (PublicSchema["Tables"] & + PublicSchema["Views"])[PublicTableNameOrOptions] extends { + Row: infer R + } + ? R + : never : never - : never; export type TablesInsert< PublicTableNameOrOptions extends - | keyof PublicSchema['Tables'] + | keyof PublicSchema["Tables"] | { schema: keyof Database }, TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions['schema']]['Tables'] + ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] : never = never, > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends { - Insert: infer I; + ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Insert: infer I } ? I : never - : PublicTableNameOrOptions extends keyof PublicSchema['Tables'] - ? PublicSchema['Tables'][PublicTableNameOrOptions] extends { - Insert: infer I; - } - ? I + : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] + ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + Insert: infer I + } + ? I + : never : never - : never; export type TablesUpdate< PublicTableNameOrOptions extends - | keyof PublicSchema['Tables'] + | keyof PublicSchema["Tables"] | { schema: keyof Database }, TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions['schema']]['Tables'] + ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] : never = never, > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends { - Update: infer U; + ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Update: infer U } ? U : never - : PublicTableNameOrOptions extends keyof PublicSchema['Tables'] - ? PublicSchema['Tables'][PublicTableNameOrOptions] extends { - Update: infer U; - } - ? U + : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] + ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + Update: infer U + } + ? U + : never : never - : never; export type Enums< PublicEnumNameOrOptions extends - | keyof PublicSchema['Enums'] + | keyof PublicSchema["Enums"] | { schema: keyof Database }, EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums'] + ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] : never = never, > = PublicEnumNameOrOptions extends { schema: keyof Database } - ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName] - : PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] - ? PublicSchema['Enums'][PublicEnumNameOrOptions] - : never; + ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] + : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] + ? PublicSchema["Enums"][PublicEnumNameOrOptions] + : never diff --git a/tailwind.config.ts b/tailwind.config.ts index c8caf550..89c4f6ea 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -28,6 +28,9 @@ const config: Config = { 'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', }, + screens: { + web: '1024px', + }, /** Default font is Lato */ fontFamily: { sans: ['Lato'],