Skip to content

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

Resolve linting and react warnings

Joshen Lim1549af4a2a6e
diff --git a/www/components/ArticleThumb.tsx b/www/components/ArticleThumb.tsx
index 9cca119029c..b7cdcc9fee5 100644
--- a/www/components/ArticleThumb.tsx
+++ b/www/components/ArticleThumb.tsx
@@ -30,11 +30,12 @@ const ArticleThumb = (props: any) => {
const iconMarkup = icons && icons.map((icon :any) => {
return (
- <img
- className="inline-block h-12 w-12 rounded-full ring-2 ring-white"
- src={icon.img_url}
- alt={icon.img_alt}
- />
+ <img
+ key={icon.img_alt}
+ className="inline-block h-12 w-12 rounded-full ring-2 ring-white"
+ src={icon.img_url}
+ alt={icon.img_alt}
+ />
)
})
diff --git a/www/components/UI/SectionHeader.tsx b/www/components/UI/SectionHeader.tsx
index f4180ef0519..69d7f150d24 100644
--- a/www/components/UI/SectionHeader.tsx
+++ b/www/components/UI/SectionHeader.tsx
@@ -11,13 +11,13 @@ const SectionHeader = (props :any) => {
<span className="text-gray-600">{props.title_alt}</span>
)}
</h2>
- <p>
+ <div>
{props.paragraph && (
- <p className="mt-3 mx-auto text-xl text-gray-400 sm:mt-4">
- {props.paragraph}
- </p>
+ <p className="mt-3 mx-auto text-xl text-gray-400 sm:mt-4">
+ {props.paragraph}
+ </p>
)}
- </p>
+ </div>
</div>
</div>
)
diff --git a/www/components/features.tsx b/www/components/features.tsx
index c2589a4938d..d6418243ccc 100644
--- a/www/components/features.tsx
+++ b/www/components/features.tsx
@@ -7,7 +7,7 @@ const Features = () => {
const { name, description, icon, label, url } = solution
return (
- <div>
+ <div key={name}>
<div className="flex items-center">
<div className="flex items-center justify-center h-12 w-12 rounded-md bg-gray-900 text-white">
{/* <!-- Heroicon name: globe-alt --> */}
diff --git a/www/components/index_sections/AdminAccess.tsx b/www/components/index_sections/AdminAccess.tsx
index 8bf031eefe3..6d0986a98a1 100644
--- a/www/components/index_sections/AdminAccess.tsx
+++ b/www/components/index_sections/AdminAccess.tsx
@@ -18,13 +18,13 @@ const AdminAccess = () => {
tabId={tabId}
setTabId={setTabId}
/>
- <div>
+ <div className="shadow-md">
<div className="w-full rounded-t-md h-5 bg-dark-200 flex items-center justify-start px-2">
<div className="h-2 w-2 mr-2 rounded-full bg-dark-300"/>
<div className="h-2 w-2 mr-2 rounded-full bg-dark-300"/>
<div className="h-2 w-2 mr-2 rounded-full bg-dark-300"/>
</div>
- <video className="rounded-b-md shadow-md" src={`videos/${tabId}.mp4`} autoPlay loop muted>
+ <video className="rounded-b-md" src={`videos/${tabId}.mp4`} autoPlay loop muted>
Your browser does not support the video tag
</video>
</div>
diff --git a/www/components/nav.tsx b/www/components/nav.tsx
index e84701ab4aa..e77cc7c436e 100644
--- a/www/components/nav.tsx
+++ b/www/components/nav.tsx
@@ -61,13 +61,16 @@ const Nav = () => {
)
return url ? (
<a
+ key={`solution_${label}`}
href="#"
className="-m-3 p-3 flex flex-col justify-between rounded-lg hover:bg-gray-50 transition ease-in-out duration-150"
>
{content}
</a>
) : (
- <div className="-m-3 p-3 flex flex-col justify-between rounded-lg transition ease-in-out duration-150">
+ <div
+ key={`solution_${label}`}
+ className="-m-3 p-3 flex flex-col justify-between rounded-lg transition ease-in-out duration-150">
{content}
</div>
)
diff --git a/www/components/nav/FlyOut.js b/www/components/nav/FlyOut.js
index 912969a384b..e3abd7e34d2 100644
--- a/www/components/nav/FlyOut.js
+++ b/www/components/nav/FlyOut.js
@@ -58,13 +58,14 @@ const FlyOut = () => {
)
return url ? (
<a
+ key={name}
href="#"
className="-m-3 p-3 flex flex-col justify-between rounded-lg hover:bg-gray-50 transition ease-in-out duration-150"
>
{content}
</a>
) : (
- <div className="-m-3 p-3 flex flex-col justify-between rounded-lg transition ease-in-out duration-150">
+ <div key={name} className="-m-3 p-3 flex flex-col justify-between rounded-lg transition ease-in-out duration-150">
{content}
</div>
)
@@ -88,7 +89,7 @@ const FlyOut = () => {
<path
fillRule="evenodd"
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
- clip-rule="evenodd"
+ clipRule="evenodd"
/>
</svg>
</a>
diff --git a/www/components/tabs.tsx b/www/components/tabs.tsx
index f106d92f686..5c7c04050d7 100644
--- a/www/components/tabs.tsx
+++ b/www/components/tabs.tsx
@@ -1,3 +1,5 @@
+import TabMarkup from "./../data/AdminAccess.json"
+
type Props = {
tabId: string,
setTabId: Function,
@@ -13,24 +15,6 @@ function Tabs(props: Props) {
return setTabId(tabId)
}
- const tabMarkup: any = {
- tabTableEditor: {
- header: 'Manage your data with the familiarity of a spreadsheet',
- description: 'You don’t have to be a database expert to start using Supabase — Our table editor makes Postgres easy to use even for non-techies, and you can do everything right in our dashboard.',
- cta: 'Explore Table View'
- },
- tabSqlEditor: {
- header: 'In-built SQL editor for when you need greater control',
- description: 'Write, save, and execute SQL queries directly on our dashboard, with templates to help you save time from common queries and even build applications.',
- cta: 'Explore SQL Editor'
- },
- tabAuthRules: {
- header: 'User management as straight-forward as it can be',
- description: 'Easily manage your users via our authentication, or integrate third party logins. Create policies with complex SQL rules which fit your unique business needs.',
- cta: 'Explore Auth Policies'
- }
- }
-
return (
<div className="flex justify-between items-center w-full">
<div>
@@ -69,17 +53,17 @@ function Tabs(props: Props) {
<div>
<div className="mt-5">
<dd className="mt-8 text-2xl text-gray-800">
- {tabMarkup[tabId].header}
+ {TabMarkup[tabId].header}
</dd>
<dd className="mt-8 text-base text-gray-500">
- {tabMarkup[tabId].description}
+ {TabMarkup[tabId].description}
</dd>
</div>
<button
type="button"
className="mt-8 inline-flex items-center px-3 py-2 border border-transparent shadow-sm text-sm leading-4 rounded-md text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500"
>
- {tabMarkup[tabId].cta}
+ {TabMarkup[tabId].cta}
</button>
</div>
</div>
diff --git a/www/data/AdminAccess.json b/www/data/AdminAccess.json
new file mode 100644
index 00000000000..bdb0a6436ad
--- /dev/null
+++ b/www/data/AdminAccess.json
@@ -0,0 +1,17 @@
+{
+ "tabTableEditor": {
+ "header": "Manage your data with the familiarity of a spreadsheet",
+ "description": "You don’t have to be a database expert to start using Supabase — Our table editor makes Postgres easy to use even for non-techies, and you can do everything right in our dashboard.",
+ "cta": "Explore Table View"
+ },
+ "tabSqlEditor": {
+ "header": "In-built SQL editor for when you need greater control",
+ "description": "Write, save, and execute SQL queries directly on our dashboard, with templates to help you save time from common queries and even build applications.",
+ "cta": "Explore SQL Editor"
+ },
+ "tabAuthRules": {
+ "header": "User management as straight-forward as it can be",
+ "description": "Easily manage your users via our authentication, or integrate third party logins. Create policies with complex SQL rules which fit your unique business needs.",
+ "cta": "Explore Auth Policies"
+ }
+}
\ No newline at end of file