The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Putting the menu toggle on the right
Copple698a49bc68b3
diff --git a/web/docs/about.md b/web/docs/about.mdindex 89dadac5f64..9ac62311514 100755--- a/web/docs/about.md+++ b/web/docs/about.md@@ -15,7 +15,7 @@ It does all of this without you having to write a single line of code.## What it isn't-@todo+- An ORM, at least not like typical ORMs. Supabase is more like an API, since we don't require you to set up any mappings and we interact with your database through a derived schema that get from introspecting your database.## How it worksdiff --git a/web/src/css/custom.css b/web/src/css/custom.cssindex d3ec037f6c0..cb4233db08f 100755--- a/web/src/css/custom.css+++ b/web/src/css/custom.css@@ -235,7 +235,7 @@ li + li {.markdown h2:after {content: '\2501\2501';display: block;- color: var(--custom-primary);+ color: #333;}article header {margin-bottom: 3rem;@@ -298,9 +298,13 @@ article header {a.card {text-decoration: none !important;color: var(--ifm-color-content);+ box-shadow: none;+ border: 1px solid #333;+ background-color: var(--ifm-background-color);}a.card:hover {transition: all 0.2s ease;+ border: 1px solid var(--custom-primary);box-shadow: var(--custom-shadow-xl), 0 0 0 1px var(--custom-primary) !important;}@@ -468,11 +472,12 @@ div[class^='sidebar_'] .menu__link.menu__link--active:not(.menu__link--sublist)/* Hero */.hero--button {- margin: 0 10px 0 0 !important;+ text-transform: uppercase;+ padding: 10px 25px;}/* Hero */.hero--button.button--secondary {- border-color: #000;+ border-color: #333;}/* Code */diff --git a/web/src/pages/index.js b/web/src/pages/index.jsindex aa49c09c409..57c3b62d9d5 100755--- a/web/src/pages/index.js+++ b/web/src/pages/index.js@@ -14,7 +14,7 @@ import { createClient } from '@supabase/supabase-js'const supabase = createClient('https://your-db.supabase.io', '1a2b-3c4d-5e6f-7g8h')// Receive updates when a new record is inserted into your database-const listener = supabase+const realtime = supabase.from('*').on('INSERT', change => {console.log('Change received!', change)@@ -116,6 +116,7 @@ function Home() {Add realtime and RESTful APIs to your <strong>existing</strong> PostgreSQLdatabase without a single line of code.<br />+ <br />Forget about custom-coding relational APIs and websockets. We introspect yourdatabase and provide APIs <strong>instantly</strong> so you can focus on what ismost important - building your products.@@ -127,6 +128,7 @@ function Home() {styles.button)}to={useBaseUrl('docs/about')}+ style={{marginLeft: 0 , marginTop: 10}}>Learn More</Link>@@ -136,6 +138,7 @@ function Home() {styles.button)}to={'https://app.supabase.io'}+ style={{ marginTop: 10}}>Join the List</Link>@@ -222,10 +225,10 @@ function Home() {<section style={{ marginTop: 40, padding: 20 }} className="hero is--dark"><div className="container text--right"><div className="">- <strong>Join the waiting list</strong>+ <strong>Join the waiting list.</strong><LinkclassName={classnames(- 'button button--outline button--md button--primary',+ 'button hero--button button--md button--primary',styles.button)}to={'https://app.supabase.io'}diff --git a/web/src/theme/Navbar/index.js b/web/src/theme/Navbar/index.jsnew file mode 100755index 00000000000..2a312c73b93--- /dev/null+++ b/web/src/theme/Navbar/index.js@@ -0,0 +1,183 @@+/**+ * Copyright (c) 2017-present, Facebook, Inc.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++import React, {useCallback, useState} from 'react';+import Link from '@docusaurus/Link';+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';+import useBaseUrl from '@docusaurus/useBaseUrl';++import SearchBar from '@theme/SearchBar';+import Toggle from '@theme/Toggle';++import classnames from 'classnames';++import useTheme from '@theme/hooks/useTheme';+import useHideableNavbar from '@theme/hooks/useHideableNavbar';++import styles from './styles.module.css';++function NavLink({to, href, label, position, ...props}) {+ const toUrl = useBaseUrl(to);+ return (+ <Link+ className="navbar__item navbar__link"+ {...(href+ ? {+ target: '_blank',+ rel: 'noopener noreferrer',+ href,+ }+ : {+ activeClassName: 'navbar__link--active',+ to: toUrl,+ })}+ {...props}>+ {label}+ </Link>+ );+}++function Navbar() {+ const context = useDocusaurusContext();+ const {siteConfig = {}} = context;+ const {baseUrl, themeConfig = {}} = siteConfig;+ const {navbar = {}, disableDarkMode = false} = themeConfig;+ const {title, logo = {}, links = [], hideOnScroll = false} = navbar;+ const [sidebarShown, setSidebarShown] = useState(false);+ const [isSearchBarExpanded, setIsSearchBarExpanded] = useState(false);+ const [theme, setTheme] = useTheme();++ const {navbarRef, isNavbarVisible} = useHideableNavbar(hideOnScroll);++ const showSidebar = useCallback(() => {+ document.body.style.overflow = 'hidden';+ setSidebarShown(true);+ }, [setSidebarShown]);+ const hideSidebar = useCallback(() => {+ document.body.style.overflow = 'visible';+ setSidebarShown(false);+ }, [setSidebarShown]);++ const onToggleChange = useCallback(+ e => setTheme(e.target.checked ? 'dark' : ''),+ [setTheme],+ );++ const logoUrl = useBaseUrl(logo.src);+ return (+ <nav+ ref={navbarRef}+ className={classnames('navbar', 'navbar--light', 'navbar--fixed-top', {+ 'navbar-sidebar--show': sidebarShown,+ [styles.navbarHideable]: hideOnScroll,+ [styles.navbarHidden]: !isNavbarVisible,+ })}>+ <div className="navbar__inner">+ <div className={classnames("navbar__items", styles.navbarItems)}>+ <Link className="navbar__brand" to={baseUrl}>+ {logo != null && (+ <img className="navbar__logo" src={logoUrl} alt={logo.alt} />+ )}+ {title != null && (+ <strong+ className={isSearchBarExpanded ? styles.hideLogoText : ''}>+ {title}+ </strong>+ )}+ </Link>+ <div+ aria-label="Navigation bar toggle"+ className="navbar__toggle"+ role="button"+ tabIndex={0}+ onClick={showSidebar}+ onKeyDown={showSidebar}>+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="30"+ height="30"+ viewBox="0 0 30 30"+ role="img"+ focusable="false">+ <title>Menu</title>+ <path+ stroke="currentColor"+ strokeLinecap="round"+ strokeMiterlimit="10"+ strokeWidth="2"+ d="M4 7h22M4 15h22M4 23h22"+ />+ </svg>+ </div>+ {links+ .filter(linkItem => linkItem.position !== 'right')+ .map((linkItem, i) => (+ <NavLink {...linkItem} key={i} />+ ))}+ </div>+ <div className="navbar__items navbar__items--right">+ {links+ .filter(linkItem => linkItem.position === 'right')+ .map((linkItem, i) => (+ <NavLink {...linkItem} key={i} />+ ))}+ {!disableDarkMode && (+ <Toggle+ className={styles.displayOnlyInLargeViewport}+ aria-label="Dark mode toggle"+ checked={theme === 'dark'}+ onChange={onToggleChange}+ />+ )}+ <SearchBar+ handleSearchBarToggle={setIsSearchBarExpanded}+ isSearchBarExpanded={isSearchBarExpanded}+ />+ </div>+ </div>+ <div+ role="presentation"+ className="navbar-sidebar__backdrop"+ onClick={hideSidebar}+ />+ <div className="navbar-sidebar">+ <div className="navbar-sidebar__brand">+ <Link className="navbar__brand" onClick={hideSidebar} to={baseUrl}>+ {logo != null && (+ <img className="navbar__logo" src={logoUrl} alt={logo.alt} />+ )}+ {title != null && <strong>{title}</strong>}+ </Link>+ {!disableDarkMode && sidebarShown && (+ <Toggle+ aria-label="Dark mode toggle in sidebar"+ checked={theme === 'dark'}+ onChange={onToggleChange}+ />+ )}+ </div>+ <div className="navbar-sidebar__items">+ <div className="menu">+ <ul className="menu__list">+ {links.map((linkItem, i) => (+ <li className="menu__list-item" key={i}>+ <NavLink+ className="menu__link"+ {...linkItem}+ onClick={hideSidebar}+ />+ </li>+ ))}+ </ul>+ </div>+ </div>+ </div>+ </nav>+ );+}++export default Navbar;diff --git a/web/src/theme/Navbar/styles.module.css b/web/src/theme/Navbar/styles.module.cssnew file mode 100755index 00000000000..5c28f3a3456--- /dev/null+++ b/web/src/theme/Navbar/styles.module.css@@ -0,0 +1,29 @@+/**+ * Copyright (c) 2017-present, Facebook, Inc.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++@media screen and (max-width: 997px) {+ .displayOnlyInLargeViewport {+ display: none !important;+ }+}++@media (max-width: 360px) {+ .hideLogoText {+ display: none;+ }+}++.navbarHideable {+ transition: top 0.2s ease-in-out;+}++.navbarHidden {+ top: calc(var(--ifm-navbar-height) * -1) !important;+}+.navbarItems {+ justify-content: space-between;+}\ No newline at end of file