Skip to content

Commit 7c68748

Browse files
committed
Merge remote-tracking branch 'origin/main' into yu/feat/auth-2
2 parents 985e1cf + 6bae0f4 commit 7c68748

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

packages/next/src/components/collection-sidebar/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export async function AppSidebar({ collections }: { collections: Collection[] })
2525
intent="inset"
2626
className="flex gap-y-12 p-0 py-6 group-[:not([data-sidebar-state=collapsed])]/sidebar-container:p-6"
2727
>
28-
<SidebarHeader className="border-border m-0 size-auto border-b pl-6">
28+
{/* TODO: Make sidebar variations, so we won't need an important css flag */}
29+
<SidebarHeader className="border-border m-0 size-auto! border-b pl-6 h-auto! w-full!">
2930
<div className="flex h-[68px] items-center gap-x-4">
3031
<div className="bg-primary/15 dark:bg-primary/20 border-primary dark:border-primary/40 relative flex overflow-clip rounded-md border p-4">
3132
<div className="bg-primary/20 absolute -inset-x-[25%] inset-y-0 m-auto h-2 -translate-x-4 -translate-y-4 -rotate-45 blur-[3px]" />

packages/next/src/config.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { AuthLayout } from './views/auth/layout'
1616
import { LoginView } from './views/auth/login'
1717
import { SignUpView } from './views/auth/sign-up'
1818
import { CreateView } from './views/collections/create'
19+
import { HomeView } from './views/collections/home'
1920
import { CollectionLayout } from './views/collections/layout'
2021
import { ListView } from './views/collections/list'
2122
import { OneView } from './views/collections/one'
@@ -76,6 +77,16 @@ export function defineNextJsServerConfig<
7677
): NextJsServerConfig<TFullSchema, TContext, TCollections, TApiRouter> {
7778
const radixRouter = createRouter<RouterData>()
7879

80+
radixRouter.insert('/collections', {
81+
view(args: { serverConfig: ServerConfig }) {
82+
return (
83+
<CollectionLayout serverConfig={args.serverConfig}>
84+
<HomeView serverConfig={args.serverConfig} />
85+
</CollectionLayout>
86+
)
87+
},
88+
})
89+
7990
// Collection
8091
radixRouter.insert(`/collections/:slug`, {
8192
requiredAuthentication: true,

packages/next/src/pages/home.tsx renamed to packages/next/src/views/collections/home.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import 'server-only'
55
*/
66
import type { ServerConfig } from '@kivotos/core'
77

8-
import { CollectionCard } from '../components/collection-card'
9-
import { Typography } from '../components/primitives/typography'
8+
import { CollectionCard } from '../../components/collection-card'
9+
import { Typography } from '../../components/primitives/typography'
1010

1111
const greeting = () => {
1212
const time = new Date().getHours()
@@ -26,7 +26,7 @@ type HomepageProps = {
2626
serverConfig: ServerConfig
2727
}
2828

29-
export const HomePage = ({ serverConfig }: HomepageProps) => {
29+
export const HomeView = ({ serverConfig }: HomepageProps) => {
3030
const collections = serverConfig.collections.map((col) => col.slug)
3131

3232
return (

0 commit comments

Comments
 (0)