Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove AccountLayout section, create SidebarMenu component #471

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions apps/web/vibes/soul/docs/account-layout.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions apps/web/vibes/soul/docs/sticky-sidebar-layout.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Sticky Sidebar Layout
preview: sticky-sidebar-layout-example
previewSize: lg
---
6 changes: 3 additions & 3 deletions apps/web/vibes/soul/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export const examples = [
component: lazy(() => import('./examples/primitives/accordions')),
},
{
name: 'account-layout-example',
name: 'sticky-sidebar-layout-example',
dependencies: [],
registryDependencies: [],
files: ['examples/sections/account-layout/index.tsx'],
component: lazy(() => import('./examples/sections/account-layout')),
files: ['examples/sections/sticky-sidebar-layout/index.tsx'],
component: lazy(() => import('./examples/sections/sticky-sidebar-layout')),
},
{
name: 'account-settings-section-example',
Expand Down
11 changes: 0 additions & 11 deletions apps/web/vibes/soul/examples/sections/account-layout/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { AccountSettingsSection } from '@/vibes/soul/sections/account-settings-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

import { changePasswordAction, updateAccountAction } from './actions';

Expand All @@ -11,12 +12,12 @@ const links = [

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<AccountSettingsSection
account={{ firstName: '', lastName: '', email: '' }}
changePasswordAction={changePasswordAction}
updateAccountAction={updateAccountAction}
/>
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Field, FieldGroup } from '@/vibes/soul/primitives/dynamic-form/schema';
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { Address, AddressListSection } from '@/vibes/soul/sections/address-list-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

import { addressAction } from './actions';

Expand Down Expand Up @@ -109,13 +110,13 @@ const fields: Array<Field | FieldGroup<Field>> = [

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<AddressListSection
addressAction={addressAction}
addresses={addresses}
defaultAddress={{ id: '1' }}
fields={fields}
/>
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getProducts } from '@/vibes/soul/data';
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { OrderDetailsSection } from '@/vibes/soul/sections/order-details-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

const products = await getProducts('Electric');

Expand Down Expand Up @@ -95,15 +96,15 @@ const order = {
};

const links = [
{ href: '#', label: 'Orders' },
{ href: '#', label: 'Addresses' },
{ href: '#', label: 'Account' },
{ href: '#a', label: 'Orders' },
{ href: '#b', label: 'Addresses' },
{ href: '#c', label: 'Account' },
];

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<OrderDetailsSection order={order} prevHref="#" />
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getProducts } from '@/vibes/soul/data';
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { OrderDetailsSection } from '@/vibes/soul/sections/order-details-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

const products = await getProducts('Luxury');

Expand Down Expand Up @@ -95,15 +96,15 @@ const order = {
};

const links = [
{ href: '#', label: 'Orders' },
{ href: '#', label: 'Addresses' },
{ href: '#', label: 'Account' },
{ href: '#a', label: 'Orders' },
{ href: '#b', label: 'Addresses' },
{ href: '#c', label: 'Account' },
];

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<OrderDetailsSection order={order} prevHref="#" />
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getProducts } from '@/vibes/soul/data';
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { OrderDetailsSection } from '@/vibes/soul/sections/order-details-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

const products = await getProducts('Warm');

Expand Down Expand Up @@ -95,15 +96,15 @@ const order = {
};

const links = [
{ href: '#', label: 'Orders' },
{ href: '#', label: 'Addresses' },
{ href: '#', label: 'Account' },
{ href: '#a', label: 'Orders' },
{ href: '#b', label: 'Addresses' },
{ href: '#c', label: 'Account' },
];

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<OrderDetailsSection order={order} prevHref="#" />
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getProducts } from '@/vibes/soul/data';
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { OrderListSection } from '@/vibes/soul/sections/order-list-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

const products = await getProducts('Electric');

Expand Down Expand Up @@ -56,15 +57,15 @@ const orders = [
];

const links = [
{ href: '/preview/soul/order-list-section-electric-example', label: 'Orders' },
{ href: '/preview/soul/address-list-section-example', label: 'Addresses' },
{ href: '/preview/soul/account-settings-section-example', label: 'Account' },
{ href: '#a', label: 'Orders' },
{ href: '#b', label: 'Addresses' },
{ href: '#c', label: 'Account' },
];

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<OrderListSection orders={orders} paginationInfo={{ startCursor: '1', endCursor: '5' }} />
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getProducts } from '@/vibes/soul/data';
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { OrderListSection } from '@/vibes/soul/sections/order-list-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

const products = await getProducts('Luxury');

Expand Down Expand Up @@ -56,15 +57,15 @@ const orders = [
];

const links = [
{ href: '#', label: 'Orders' },
{ href: '#', label: 'Addresses' },
{ href: '#', label: 'Account' },
{ href: '#a', label: 'Orders' },
{ href: '#b', label: 'Addresses' },
{ href: '#c', label: 'Account' },
];

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<OrderListSection orders={orders} paginationInfo={{ startCursor: '1', endCursor: '5' }} />
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getProducts } from '@/vibes/soul/data';
import { AccountLayout } from '@/vibes/soul/sections/account-layout';
import { OrderListSection } from '@/vibes/soul/sections/order-list-section';
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

const products = await getProducts('Warm');

Expand Down Expand Up @@ -56,15 +57,15 @@ const orders = [
];

const links = [
{ href: '#', label: 'Orders' },
{ href: '#', label: 'Addresses' },
{ href: '#', label: 'Account' },
{ href: '#a', label: 'Orders' },
{ href: '#b', label: 'Addresses' },
{ href: '#c', label: 'Account' },
];

export default function Preview() {
return (
<AccountLayout links={links}>
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
<OrderListSection orders={orders} paginationInfo={{ startCursor: '1', endCursor: '5' }} />
</AccountLayout>
</StickySidebarLayout>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { SidebarMenu } from '@/vibes/soul/sections/sidebar-menu';
import { StickySidebarLayout } from '@/vibes/soul/sections/sticky-sidebar-layout';

const links = [
{ href: '/preview/soul/sticky-sidebar-layout-example/Electric#a', label: 'Orders' },
{ href: '/preview/soul/sticky-sidebar-layout-example/Electric#b', label: 'Addresses' },
{ href: '/preview/soul/sticky-sidebar-layout-example/Electric#c', label: 'Account' },
];

export default function Preview() {
return (
<StickySidebarLayout sidebar={<SidebarMenu links={links} />} sidebarSize="small">
Put some stuff here!
</StickySidebarLayout>
);
}
12 changes: 6 additions & 6 deletions apps/web/vibes/soul/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ export const navigation = [
{
title: 'Sections',
pages: [
{
title: 'Account Layout',
slug: 'account-layout',
file: 'docs/account-layout.mdx',
component: 'account-layout',
},
{
title: 'Account Settings Section',
slug: 'account-settings-section',
Expand Down Expand Up @@ -281,6 +275,12 @@ export const navigation = [
file: 'docs/slideshow.mdx',
component: 'slideshow',
},
{
title: 'Sticky Sidebar Layout',
slug: 'sticky-sidebar-layout',
file: 'docs/sticky-sidebar-layout.mdx',
component: 'sticky-sidebar-layout',
},
{
title: 'Subscribe',
slug: 'subscribe',
Expand Down
4 changes: 2 additions & 2 deletions apps/web/vibes/soul/sections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Components } from '@/vibes/schema';

export const sections = [
{
name: 'account-layout',
name: 'sticky-sidebar-layout',
dependencies: ['clsx'],
registryDependencies: [],
files: ['sections/account-layout/index.tsx'],
files: ['sections/sticky-sidebar-layout/index.tsx'],
},
{
name: 'account-settings-section',
Expand Down
38 changes: 0 additions & 38 deletions apps/web/vibes/soul/sections/account-layout/index.tsx

This file was deleted.

Loading
Loading