Skip to content

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

chore: ui update

Isaiah Hamilton07ac110ec6b7
diff --git a/apps/temp-docs/components/CodeBlock/CodeBlock.module.css b/apps/temp-docs/components/CodeBlock/CodeBlock.module.css
deleted file mode 100644
index 9dda8e0be0c..00000000000
--- a/apps/temp-docs/components/CodeBlock/CodeBlock.module.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.code-block::before {
- content: '';
- background: #1e1e1e;
- height: 10px;
- width: 48px;
- display: block;
-}
-
-.code-block::after {
- content: '';
- background: #1e1e1e;
- height: 12px;
- width: 48px;
- display: block;
-}
-
-.code-block code .linenumber {
- margin-right: 4px;
-}
-
-.code-block code::after,
-.code-block code::before {
- content: none !important;
-}
diff --git a/apps/temp-docs/components/CodeBlock/CodeBlock.tsx b/apps/temp-docs/components/CodeBlock/CodeBlock.tsx
index d8444bac260..600a9778387 100644
--- a/apps/temp-docs/components/CodeBlock/CodeBlock.tsx
+++ b/apps/temp-docs/components/CodeBlock/CodeBlock.tsx
@@ -1,12 +1,12 @@
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'
import monokaiCustomTheme from './CodeBlock.utils'
-import CodeBlockStyles from './CodeBlock.module.css'
-import { Button, IconCopy } from '@supabase/ui'
+import { Button, IconCheck, IconCopy } from '@supabase/ui'
import CopyToClipboard from 'react-copy-to-clipboard'
import js from 'react-syntax-highlighter/dist/cjs/languages/hljs/javascript'
import py from 'react-syntax-highlighter/dist/cjs/languages/hljs/python'
import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql'
+import { useState } from 'react'
interface Props {
lang: 'js' | 'sql' | 'py'
@@ -18,6 +18,15 @@ interface Props {
}
function CodeBlock(props: Props) {
+ const [copied, setCopied] = useState(false)
+
+ const handleCopy = () => {
+ setCopied(true)
+ setTimeout(() => {
+ setCopied(false)
+ }, 1000)
+ }
+
let lang = props.lang
? props.lang
: props.className
@@ -38,7 +47,7 @@ function CodeBlock(props: Props) {
<SyntaxHighlighter
language={lang}
style={monokaiCustomTheme}
- className={'code-block dark:border-dark rounded-lg border border-gray-600'}
+ className={'code-block border-scale-600 rounded-lg border'}
customStyle={{
padding: 0,
fontSize: large ? 18 : 12,
@@ -51,23 +60,25 @@ function CodeBlock(props: Props) {
paddingTop: '128px',
}}
lineNumberStyle={{
- minWidth: '48px',
+ minWidth: '44px',
background: '#1e1e1e',
- paddingLeft: '21px',
+ paddingLeft: '4px',
+ paddingRight: '4px',
marginRight: '12px',
color: '#828282',
+ textAlign: 'center',
fontSize: large ? 14 : 12,
paddingTop: '4px',
paddingBottom: '4px',
}}
>
- {props.children}
+ {props.children?.trimEnd()}
</SyntaxHighlighter>
{!props.hideCopy && props.children ? (
<div className="dark absolute right-2 top-2">
<CopyToClipboard text={props.children}>
- <Button type="outline" className="dark:bg-dark-800" icon={<IconCopy />}>
- Copy
+ <Button type="default" icon={copied ? <IconCheck /> : <IconCopy />} onClick={() => handleCopy()}>
+ {copied ? 'Copied' : 'Copy'}
</Button>
</CopyToClipboard>
</div>
diff --git a/apps/temp-docs/components/TabPanel.tsx b/apps/temp-docs/components/TabPanel.tsx
index 453668972f9..512cd5b74a0 100644
--- a/apps/temp-docs/components/TabPanel.tsx
+++ b/apps/temp-docs/components/TabPanel.tsx
@@ -1,10 +1,10 @@
import { ReactElement } from 'react'
import { Tabs } from '@supabase/ui'
-export default function TabPanel(props) {
+export default function TabPanel(props: { id: string | undefined; label: string | undefined; children: any }) {
console.log({ props })
return (
<Tabs.Panel id={props.id} label={props.label}>
{props.children}
</Tabs.Panel>
)
-}
+}
\ No newline at end of file
diff --git a/apps/temp-docs/components/TabWrapper.tsx b/apps/temp-docs/components/TabWrapper.tsx
index 9412b506312..482f1225cd7 100644
--- a/apps/temp-docs/components/TabWrapper.tsx
+++ b/apps/temp-docs/components/TabWrapper.tsx
@@ -1,10 +1,15 @@
import { Tabs } from '@supabase/ui'
-const TabWrapper = (props) => {
- console.log('Tab props: ', props)
- const { children, ...otherProps } = props
-
- return <Tabs {...otherProps}>{props.children}</Tabs>
+const TabWrapper = (props: any) => {
+ return (
+ <div className='dashboard-tabs'>
+ <Tabs size="xlarge" type="underlined">
+ <Tabs.Panel id={props.id} label={props.label}>
+ {props.children}
+ </Tabs.Panel>
+ </Tabs>
+ </div>
+ )
}
export default TabWrapper
diff --git a/apps/temp-docs/styles/main.css b/apps/temp-docs/styles/main.css
index 37765d87dd6..f949d8a60e2 100644
--- a/apps/temp-docs/styles/main.css
+++ b/apps/temp-docs/styles/main.css
@@ -8,6 +8,7 @@
body {
@apply bg-white dark:bg-[#1c1c1c] !important;
+ scroll-behavior: smooth;
}
::selection {