Skip to content

Commit

Permalink
upd: Page components use
Browse files Browse the repository at this point in the history
  • Loading branch information
vikdiesel committed Aug 25, 2023
1 parent 365a8c8 commit 167b017
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import NotificationBar from '../components/NotificationBar'
import TableSampleClients from '../components/Table/SampleClients'
import { getPageTitle } from '../config'

const Dashboard = () => {
const DashboardPage = () => {
const { clients } = useSampleClients()
const { transactions } = useSampleTransactions()

Expand Down Expand Up @@ -128,8 +128,8 @@ const Dashboard = () => {
)
}

Dashboard.getLayout = function getLayout(page: ReactElement) {
DashboardPage.getLayout = function getLayout(page: ReactElement) {
return <LayoutAuthenticated>{page}</LayoutAuthenticated>
}

export default Dashboard
export default DashboardPage
6 changes: 4 additions & 2 deletions src/pages/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SectionFullScreen from '../components/Section/FullScreen'
import LayoutGuest from '../layouts/Guest'
import { getPageTitle } from '../config'

export default function Error() {
const ErrorPage = () => {
return (
<>
<Head>
Expand All @@ -30,6 +30,8 @@ export default function Error() {
)
}

Error.getLayout = function getLayout(page: ReactElement) {
ErrorPage.getLayout = function getLayout(page: ReactElement) {
return <LayoutGuest>{page}</LayoutGuest>
}

export default ErrorPage
6 changes: 3 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { appTitle } from '../config'
import { useAppDispatch } from '../stores/hooks'
import { setDarkMode, setStyle } from '../stores/styleSlice'

const StyleSelect = () => {
const StyleSelectPage = () => {
const dispatch = useAppDispatch()

dispatch(setDarkMode(false))
Expand Down Expand Up @@ -69,8 +69,8 @@ const StyleSelect = () => {
)
}

StyleSelect.getLayout = function getLayout(page: ReactElement) {
StyleSelectPage.getLayout = function getLayout(page: ReactElement) {
return <LayoutGuest>{page}</LayoutGuest>
}

export default StyleSelect
export default StyleSelectPage
6 changes: 4 additions & 2 deletions src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Buttons from '../components/Buttons'
import { useRouter } from 'next/router'
import { getPageTitle } from '../config'

export default function Error() {
const LoginPage = () => {
const router = useRouter()

const handleSubmit = () => {
Expand Down Expand Up @@ -59,6 +59,8 @@ export default function Error() {
)
}

Error.getLayout = function getLayout(page: ReactElement) {
LoginPage.getLayout = function getLayout(page: ReactElement) {
return <LayoutGuest>{page}</LayoutGuest>
}

export default LoginPage

0 comments on commit 167b017

Please sign in to comment.