Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: small formating on slack clone

Paul Copplestone158418504aa5
diff --git a/examples/slack-clone/README.md b/examples/slack-clone/README.md
index eb00fa31af5..79cf9081d81 100644
--- a/examples/slack-clone/README.md
+++ b/examples/slack-clone/README.md
@@ -1,6 +1,6 @@
-# Basic Slack Clone
+# Slack Clone
-Build a simple slack clone using Supabase, Postgres and React hooks.
+Deploy a simple slack clone using Supabase and Vercel.
<p align="center">
<kbd>
@@ -15,20 +15,35 @@ Build a simple slack clone using Supabase, Postgres and React hooks.
Embed video.
-**Sign up to Supabase**
+**1. Create new project**
-**Create new project**
+Sign up to Supabase - [https://app.supabase.io](https://app.supabase.io) and create a new project. Wait for your database to start.
-**Run "Slack Clone" Quickstart**
+**2. Run "Slack Clone" Quickstart**
-**Get the URL and Key**
+Once your database has started, run the "Slack Clone" quickstart.
-**Deploy the front end**
+![Slack Clone Quick Start](https://user-images.githubusercontent.com/10214025/88916135-1b1d7a00-d298-11ea-82e7-e2c18314e805.png)
+
+**3. Get the URL and Key**
+
+Go to the Project Settings (the cog icon), and find your API URL and `anon` key.
+
+![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png)
+
+**4. Deploy the front end**
+
+Deploy!
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fslack-clone&env=NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_KEY&envDescription=Find%20the%20Supabase%20URL%20and%20key%20in%20the%20your%20auto-generated%20docs%20at%20app.supabase.io&project-name=supabase-slack-clone&repo-name=supabase-slack-clone)
+You will be asked for a `NEXT_PUBLIC_SUPABASE_URL` and `NENEXT_PUBLIC_SUPABASE_KEY`. You can use the keys in step 3.
+
+
## For developers
+If you want to run this without deploying:
+
**Clone this folder**
```sh
diff --git a/examples/slack-clone/components/Layout.js b/examples/slack-clone/components/Layout.js
index fcd2c3987ad..9d30ddaacf3 100644
--- a/examples/slack-clone/components/Layout.js
+++ b/examples/slack-clone/components/Layout.js
@@ -3,7 +3,7 @@ import { useContext } from 'react'
import UserContext from '~/lib/UserContext'
import { addChannel } from '~/lib/Store'
-export default props => {
+export default function Layout(props) {
const { signOut } = useContext(UserContext)
const slugify = text => {
@@ -27,13 +27,16 @@ export default props => {
}
return (
- <main className="main flex h-screen w-screen absolute">
+ <main className="main flex h-screen w-screen absolute overflow-hidden">
{/* Sidebar */}
- <nav className="w-1/4 bg-gray-900 text-gray-100 h-screen">
+ <nav
+ className="w-64 bg-gray-900 text-gray-100 h-screen"
+ style={{ maxWidth: '20%', minWidth: 150 }}
+ >
<div className="p-2">
<h4 className="font-bold">Channels</h4>
<ul className="channel-list">
- {props.channels.map(x => (
+ {props.channels.map((x) => (
<SidebarItem channel={x} key={x.id} isActiveChannel={x.id == props.activeChannelId} />
))}
</ul>
@@ -41,7 +44,7 @@ export default props => {
<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"
+ className="bg-blue-900 hover:bg-blue-800 text-white py-2 px-4 rounded w-full transition duration-150"
onClick={() => newChannel()}
>
New Channel
@@ -50,7 +53,7 @@ export default props => {
<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"
+ className="bg-blue-900 hover:bg-blue-800 text-white py-2 px-4 rounded w-full transition duration-150"
onClick={() => signOut()}
>
Log out
@@ -59,7 +62,7 @@ export default props => {
</nav>
{/* Messages */}
- <div className="w-3/4 bg-gray-800 h-screen">{props.children}</div>
+ <div className="flex-1 bg-gray-800 h-screen">{props.children}</div>
</main>
)
}
diff --git a/examples/slack-clone/pages/index.js b/examples/slack-clone/pages/index.js
index 94692480654..8b8bbcf0ead 100644
--- a/examples/slack-clone/pages/index.js
+++ b/examples/slack-clone/pages/index.js
@@ -30,9 +30,9 @@ const Home = () => {
}
return (
- <div className="container mx-auto h-full flex justify-center items-center">
- <div className="w-1/3 mt-8">
- <div className="border-teal p-8 border-t-12 bg-white mb-6 rounded-lg shadow-lg">
+ <div className="w-full h-full flex justify-center items-center p-4 bg-gray-300">
+ <div className="w-full sm:w-1/2 xl:w-1/3">
+ <div className="border-teal p-8 border-t-12 bg-white mb-6 rounded-lg shadow-lg bg-white">
<div className="mb-4">
<label className="font-bold text-grey-darker block mb-2">Email</label>
<input
@@ -54,26 +54,26 @@ const Home = () => {
/>
</div>
- <div className="flex gap-3">
+ <div className="flex flex-col gap-2">
<a
onClick={(e) => {
e.preventDefault()
- handleLogin('LOGIN', username, password)
+ handleLogin('SIGNUP', username, password)
}}
href={'/channels'}
- className="bg-gray-900 hover:bg-teal text-white font-bold py-2 px-4 rounded"
+ className="bg-indigo-700 hover:bg-teal text-white py-2 px-4 rounded text-center transition duration-150 hover:bg-indigo-600 hover:text-white"
>
- Login
+ Sign up
</a>
<a
onClick={(e) => {
e.preventDefault()
- handleLogin('SIGNUP', username, password)
+ handleLogin('LOGIN', username, password)
}}
href={'/channels'}
- className="bg-gray-900 hover:bg-teal text-white font-bold py-2 px-4 rounded"
+ className="border border-indigo-700 text-indigo-700 py-2 px-4 rounded w-full text-center transition duration-150 hover:bg-indigo-700 hover:text-white"
>
- Sign up
+ Login
</a>
</div>
</div>