The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
added bold active channel name, css fix and linting
awalias486d169d590b
diff --git a/examples/slack-clone-basic/components/Layout.js b/examples/slack-clone-basic/components/Layout.jsindex 3423c3f80e0..2ace68ac88b 100644--- a/examples/slack-clone-basic/components/Layout.js+++ b/examples/slack-clone-basic/components/Layout.js@@ -21,55 +21,55 @@ export default props => {const newChannel = async () => {const slug = prompt('Please enter your name')if (slug) {- // let { body } = await+ // let { body } = awaitaddChannel(slugify(slug))// console.log('body', body)}}return (- <main className="main flex mb-4 h-screen w-screen absolute">- {/* Sidebar */}- <nav className="w-1/4 bg-gray-900 text-gray-100 h-screen">- <div className="p-2">- <h4 className="font-bold">Channels</h4>- <ul className="channel-list">- {props.channels.map(x => (- <SidebarItem channel={x} key={x.id} />- ))}- </ul>- </div>- <hr className="m-2" />- <div className="p-2">- <button- className="bg-blue-900 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded w-full"- onClick={() => newChannel()}- >- New Channel- </button>- </div>- <hr className="m-2" />- <div className="p-2">- <button- className="bg-blue-900 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded w-full"- onClick={() => signOut()}- >- Log out- </button>- </div>- </nav>+ <main className="main flex h-screen w-screen absolute">+ {/* Sidebar */}+ <nav className="w-1/4 bg-gray-900 text-gray-100 h-screen">+ <div className="p-2">+ <h4 className="font-bold">Channels</h4>+ <ul className="channel-list">+ {props.channels.map(x => (+ <SidebarItem channel={x} key={x.id} isActiveChannel={x.id == props.activeChannelId} />+ ))}+ </ul>+ </div>+ <hr className="m-2" />+ <div className="p-2">+ <button+ className="bg-blue-900 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded w-full"+ onClick={() => newChannel()}+ >+ New Channel+ </button>+ </div>+ <hr className="m-2" />+ <div className="p-2">+ <button+ className="bg-blue-900 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded w-full"+ onClick={() => signOut()}+ >+ Log out+ </button>+ </div>+ </nav>- {/* Messages */}- <div className="w-3/4 bg-gray-800 h-screen">{props.children}</div>+ {/* Messages */}+ <div className="w-3/4 bg-gray-800 h-screen">{props.children}</div></main>)}-const SidebarItem = ({ channel }) => (+const SidebarItem = ({ channel, isActiveChannel }) => (<><li><Link href="/channels/[id]" as={`/channels/${channel.id}`}>- <a>{channel.slug}</a>+ <a className={isActiveChannel ? 'font-bold' : ''}>{channel.slug}</a></Link></li></>diff --git a/examples/slack-clone-basic/package-lock.json b/examples/slack-clone-basic/package-lock.jsonindex c7058d601c1..327ee084939 100644--- a/examples/slack-clone-basic/package-lock.json+++ b/examples/slack-clone-basic/package-lock.json@@ -1,5 +1,5 @@{- "name": "supabase-slack-clone",+ "name": "supabase-slack-clone-basic","version": "0.1.0","lockfileVersion": 1,"requires": true,@@ -75,9 +75,9 @@}},"@babel/generator": {- "version": "7.8.3",- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz",- "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==",+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz",+ "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==","requires": {"@babel/types": "^7.8.3","jsesc": "^2.5.1",@@ -330,12 +330,12 @@}},"@babel/helpers": {- "version": "7.8.3",- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.3.tgz",- "integrity": "sha512-LmU3q9Pah/XyZU89QvBgGt+BCsTPoQa+73RxAQh8fb8qkDyIfeQnmgs+hvzhTCKTzqOyk7JTkS3MS1S8Mq5yrQ==",+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz",+ "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==","requires": {"@babel/template": "^7.8.3",- "@babel/traverse": "^7.8.3",+ "@babel/traverse": "^7.8.4","@babel/types": "^7.8.3"}},@@ -378,9 +378,9 @@}},"@babel/parser": {- "version": "7.8.3",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz",- "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ=="+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz",+ "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw=="},"@babel/plugin-proposal-async-generator-functions": {"version": "7.8.3",@@ -647,9 +647,9 @@}},"@babel/plugin-transform-for-of": {- "version": "7.8.3",- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.3.tgz",- "integrity": "sha512-ZjXznLNTxhpf4Q5q3x1NsngzGA38t9naWH8Gt+0qYZEJAcvPI9waSStSh56u19Ofjr7QmD0wUsQ8hw8s/p1VnA==",+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.4.tgz",+ "integrity": "sha512-iAXNlOWvcYUYoV8YIxwS7TxGRJcxyl8eQCfT+A5j8sKUzRFvJdcyjp97jL2IghWSRDaL2PU2O2tX8Cu9dTBq5A==","requires": {"@babel/helper-plugin-utils": "^7.8.3"}@@ -746,9 +746,9 @@}},"@babel/plugin-transform-parameters": {- "version": "7.8.3",- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.3.tgz",- "integrity": "sha512-/pqngtGb54JwMBZ6S/D3XYylQDFtGjWrnoCF4gXZOUpFV/ujbxnoNGNvDGu6doFWRPBveE72qTx/RRU44j5I/Q==",+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.4.tgz",+ "integrity": "sha512-IsS3oTxeTsZlE5KqzTbcC2sV0P9pXdec53SU+Yxv7o/6dvGM5AkTotQKhoSffhNgZ/dftsSiOoxy7evCYJXzVA==","requires": {"@babel/helper-call-delegate": "^7.8.3","@babel/helper-get-function-arity": "^7.8.3",@@ -861,9 +861,9 @@}},"@babel/plugin-transform-typeof-symbol": {- "version": "7.8.3",- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.3.tgz",- "integrity": "sha512-3TrkKd4LPqm4jHs6nPtSDI/SV9Cm5PRJkHLUgTcqRQQTMAZ44ZaAdDZJtvWFSaRcvT0a1rTmJ5ZA5tDKjleF3g==",+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz",+ "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==","requires": {"@babel/helper-plugin-utils": "^7.8.3"}@@ -1006,15 +1006,15 @@}},"@babel/traverse": {- "version": "7.8.3",- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz",- "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==",+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz",+ "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==","requires": {"@babel/code-frame": "^7.8.3",- "@babel/generator": "^7.8.3",+ "@babel/generator": "^7.8.4","@babel/helper-function-name": "^7.8.3","@babel/helper-split-export-declaration": "^7.8.3",- "@babel/parser": "^7.8.3",+ "@babel/parser": "^7.8.4","@babel/types": "^7.8.3","debug": "^4.1.0","globals": "^11.1.0",@@ -2985,9 +2985,9 @@"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="},"cssnano-preset-simple": {- "version": "1.0.2",- "resolved": "https://registry.npmjs.org/cssnano-preset-simple/-/cssnano-preset-simple-1.0.2.tgz",- "integrity": "sha512-FhAjiyAJoQOfvOZVSaNYkmmg2KE/SmaJVBNqglvvZ4QgwtTMVOaggozmRwfyO2QfeyKstRCpeRglziWym0Q9/w==",+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/cssnano-preset-simple/-/cssnano-preset-simple-1.0.3.tgz",+ "integrity": "sha512-TMtCiUf75Kw+RCyBcYSz14cEmjKb+QI9KDUZbuinqdaZvc7qOuTKU27FTIfnCorbekmA7EGMC3tgN7J4vt1N1Q==","requires": {"postcss": "^7.0.18"},diff --git a/examples/slack-clone-basic/pages/channels/[id].js b/examples/slack-clone-basic/pages/channels/[id].jsindex ecab800cb6d..54c547c86cf 100644--- a/examples/slack-clone-basic/pages/channels/[id].js+++ b/examples/slack-clone-basic/pages/channels/[id].js@@ -27,14 +27,14 @@ const ChannelsPage = props => {// Render the channels and messagesreturn (- <Layout channels={channels}>+ <Layout channels={channels} activeChannelId={channelId}><div className="relative h-screen"><div className="Messages h-full pb-16"><div className="p-2 overflow-y-auto">{messages.map(x => (<Message key={x.id} message={x} />))}- <div ref={messagesEndRef} style={{height: 0}} />+ <div ref={messagesEndRef} style={{ height: 0 }} /></div></div><div className="p-2 absolute bottom-0 left-0 w-full">diff --git a/examples/slack-clone-basic/styles/style.scss b/examples/slack-clone-basic/styles/style.scssindex 0ba46b3847f..e6f0385abc0 100644--- a/examples/slack-clone-basic/styles/style.scss+++ b/examples/slack-clone-basic/styles/style.scss@@ -1,8 +1,11 @@-@import "~tailwindcss/dist/base.css";-@import "~tailwindcss/dist/components.css";-@import "~tailwindcss/dist/utilities.css";+@import '~tailwindcss/dist/base.css';+@import '~tailwindcss/dist/components.css';+@import '~tailwindcss/dist/utilities.css';-html, body, #__next, .main {+html,+body,+#__next,+.main {max-height: 100vh;height: 100vh;margin: 0;@@ -19,7 +22,7 @@ html, body, #__next, .main {}}.Messages {- overflow:auto;+ overflow: auto;display: flex;flex-direction: column-reverse;-}\ No newline at end of file+}