Files
Ivan VasilovandJoshen Lim 05a542ccea chore: Migrate all feather icons to lucide icons (#29038)
* Add lucide-react to docs (to make the autocomplete work).

* Migrate the docs app icons.

* Migrate the ui-patterns.

* Remove the old icons from ui package.

* Migrate the www app from react-feather icons.

* Migrate all of studio icons.

* Migrate the only component in design-system.

* Fix an old import in ui package. Revert an import in docs app.

* Fix some pages in www.

* Remove unneeded files used in generation of icons.

* Fix a prettier error.

* Fix more issues in www.

* Fix an issue in Log Date picker.

* Replace all string sizes with number sizes because the icons grew in some cases.

* Fix more imports in security page.

* Fix an extra import.

* Remove the size prop from all icons if they're in a button and they match the button size.

* Minor fixes for docs and www.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-09-04 19:46:21 +08:00

77 lines
2.7 KiB
TypeScript

import Link from 'next/link'
import { PropsWithChildren } from 'react'
import { withAuth } from 'hooks/misc/withAuth'
import { BASE_PATH } from 'lib/constants'
import type { Organization, Project } from 'types'
import { FeedbackDropdown } from './ProjectLayout/LayoutHeader/FeedbackDropdown'
import HelpPopover from './ProjectLayout/LayoutHeader/HelpPopover'
import { ChevronRight } from 'lucide-react'
interface WizardLayoutProps {
organization: Organization | null | undefined
project: Project | null
}
const WizardLayout = ({
organization,
project,
children,
}: PropsWithChildren<WizardLayoutProps>) => {
return (
<div className="flex w-full flex-col">
<Header organization={organization} project={project} />
<div className="overflow-auto">
<section className="has-slide-in slide-in relative mx-auto my-10 max-w-2xl">
{children}
</section>
</div>
</div>
)
}
export default withAuth(WizardLayout)
export const WizardLayoutWithoutAuth = WizardLayout
const Header = ({ organization, project }: WizardLayoutProps) => {
let stepNumber = organization ? 1 : project ? 2 : 0
return (
<div className="border-b p-3 border-default">
<div className="PageHeader">
<div className="Breadcrumbs flex justify-between">
<div className="flex items-center text-sm">
<div className="flex items-center space-x-2">
<Link href="/projects">
<img
src={`${BASE_PATH}/img/supabase-logo.svg`}
alt="Supabase"
className="rounded border p-1 hover:border-white border-default"
style={{ height: 24 }}
/>
</Link>
<ChevronRight size="18" className="text-foreground-light" strokeWidth={1} />
<p className="text-sm">
{organization ? `Organization: ${organization.name}` : 'Create an organization'}
</p>
<ChevronRight size="18" className="text-foreground-light" strokeWidth={1} />
<p className={`text-sm ${stepNumber < 1 ? 'text-foreground-light' : ''}`}>
{project ? project.name : 'Create a new project'}
</p>
<ChevronRight size="18" className="text-foreground-light" strokeWidth={1} />
<p className={`text-sm ${stepNumber < 2 ? 'text-foreground-light' : ''}`}>
{project ? project.name : 'Extend your database'}
</p>
</div>
</div>
<div className="flex">{/* The End */}</div>
<div className="flex items-center space-x-2">
<HelpPopover />
<FeedbackDropdown />
</div>
</div>
</div>
</div>
)
}