Skip to content

Commit

Permalink
fix:use client to fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
ssagg committed Jun 17, 2024
1 parent 65e9b1e commit 87d1816
Show file tree
Hide file tree
Showing 14 changed files with 169 additions and 26 deletions.
104 changes: 104 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/entrypoints/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"start": "node dist/src/index.cjs"
},
"dependencies": {
"@app/base-layout-fragment": "workspace:*",
"react-intl": "6.6.8"
},
"devDependencies": {
"@app/base-layout-fragment": "workspace:*",
"@app/index-page": "workspace:*",
"@app/registration-page": "workspace:*",
"@app/users-page": "workspace:*",
"@emotion/react": "11.11.4",
Expand Down
4 changes: 1 addition & 3 deletions app/entrypoints/renderer/src/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use client'
import { BaseLayout } from '@app/base-layout-fragment'

import React from 'react'

import { BaseLayout } from '@app/base-layout-fragment'

const Layout = ({ children }) => <BaseLayout>{children}</BaseLayout>

export default Layout
2 changes: 0 additions & 2 deletions app/entrypoints/renderer/src/app/dashboard/users/page.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
'use client'

export { default } from '@app/users-page'
12 changes: 1 addition & 11 deletions app/entrypoints/renderer/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
'use client'

// @ts-ignore:next-line
import { useRouter } from 'next/navigation'

const Page = () => {
const router = useRouter()
router.push('/dashboard/users')
}

export default Page
export { default } from '@app/index-page'
2 changes: 0 additions & 2 deletions app/entrypoints/renderer/src/app/registration/page.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
'use client'

export { default } from '@app/registration-page'
10 changes: 6 additions & 4 deletions app/fragments/app-base-layout/src/base-layout.component.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useTheme } from '@emotion/react'

import React from 'react'
Expand All @@ -10,16 +12,16 @@ import { Row } from '@ui/layout'
import { Column } from '@ui/layout'
import { Sidebar } from '@ui/sidebar'

import { AVATAR } from './base-layout.constants.js'
import { EMAIL } from './base-layout.constants.js'
import { NAME } from './base-layout.constants.js'
import { BaseLayoutProps } from './base-layout.interfaces.js'
import { avatar } from './base-layout.constants.js'
import { email } from './base-layout.constants.js'
import { name } from './base-layout.constants.js'

export const BaseLayout: FC<PropsWithChildren<BaseLayoutProps>> = ({ children }) => {
const theme: any = useTheme()
return (
<Row backgroundColor={theme.backgrounds.main}>
<Sidebar name={name} email={email} src={avatar} />
<Sidebar name={NAME} email={EMAIL} src={AVATAR} />
<Column alignItems='center' flex={1}>
<ThemeSelector />
<Column
Expand Down
6 changes: 3 additions & 3 deletions app/fragments/app-base-layout/src/base-layout.constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const name = 'Bill Gates'
export const email = '[email protected]'
export const avatar = '/profile.png'
export const NAME = 'Bill Gates'
export const EMAIL = '[email protected]'
export const AVATAR = '/profile.png'
21 changes: 21 additions & 0 deletions app/pages/index-page/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@app/index-page",
"version": "0.0.1",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"main": "src/index.ts",
"devDependencies": {
"@emotion/react": "11.11.4",
"@types/react": "^18.3.3",
"@types/react-dom": "18.3.0",
"next": "14.1.0"
},
"peerDependencies": {
"@emotion/react": "*",
"react": "*",
"react-dom": "*"
}
}
10 changes: 10 additions & 0 deletions app/pages/index-page/src/index.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use client'

import { useRouter } from 'next/navigation.js'

const IndexPage = () => {
const router = useRouter()
router.push('/dashboard/users')
}

export default IndexPage
1 change: 1 addition & 0 deletions app/pages/index-page/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './index.page.js'
2 changes: 2 additions & 0 deletions app/pages/registration-page/src/registration.page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React from 'react'

import { Registration } from '@app/registration'
Expand Down
2 changes: 2 additions & 0 deletions app/pages/users-page/src/users.page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React from 'react'

import { UserCard } from '@app/user-card'
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@ __metadata:
languageName: unknown
linkType: soft

"@app/index-page@workspace:*, @app/index-page@workspace:app/pages/index-page":
version: 0.0.0-use.local
resolution: "@app/index-page@workspace:app/pages/index-page"
dependencies:
"@emotion/react": "npm:11.11.4"
"@types/react": "npm:^18.3.3"
"@types/react-dom": "npm:18.3.0"
next: "npm:14.1.0"
peerDependencies:
"@emotion/react": "*"
react: "*"
react-dom: "*"
languageName: unknown
linkType: soft

"@app/main-logo@workspace:*, @app/main-logo@workspace:app/fragments/app-main-logo":
version: 0.0.0-use.local
resolution: "@app/main-logo@workspace:app/fragments/app-main-logo"
Expand Down Expand Up @@ -314,6 +329,7 @@ __metadata:
resolution: "@app/renderer-entrypoint@workspace:app/entrypoints/renderer"
dependencies:
"@app/base-layout-fragment": "workspace:*"
"@app/index-page": "workspace:*"
"@app/registration-page": "workspace:*"
"@app/users-page": "workspace:*"
"@emotion/react": "npm:11.11.4"
Expand Down

0 comments on commit 87d1816

Please sign in to comment.