File tree Expand file tree Collapse file tree 12 files changed +56
-19
lines changed
Expand file tree Collapse file tree 12 files changed +56
-19
lines changed Original file line number Diff line number Diff line change 11[ ![ Hackathon workflow] ( https://image.shutterstock.com/image-vector/banner-hackathon-design-sprintlike-event-260nw-1418226719.jpg )] ( https://drive.google.com/drive/folders/1Srw2T91_rRLTWgJc-Zh693hhbD2JS6Yh )
22
3+ ![ form example] ( ./docs/_img/01-form-example.png )
4+
35What's inside? React + Next.js + Ant + Turbo + react-i18next + Refine
46
57# Rapid Development Node.js Hackathon template
Original file line number Diff line number Diff line change 11'use server'
22
3- import { AntdInferencer } from '@repo/ui/refine/antd '
3+ import dynamic from 'next/dynamic '
44import React from 'react'
55
66import { Layout } from 'web/components/Layout'
77
8- export default async function ClonePage ( ) : Promise < React . JSX . Element > {
8+ const AntdInferencer = dynamic (
9+ ( ) => import ( '@repo/ui/refine/antd' ) . then ( ( i ) => i . AntdInferencer ) ,
10+ {
11+ ssr : false ,
12+ } ,
13+ )
14+
15+ export default async function ClonePage ( ) {
916 return (
1017 < Layout >
1118 < AntdInferencer />
Original file line number Diff line number Diff line change 11'use server'
22
3- import { AntdInferencer } from '@repo/ui/refine/antd '
3+ import dynamic from 'next/dynamic '
44import React from 'react'
55
66import { Layout } from 'web/components/Layout'
77
8- export default async function EditPage ( ) : Promise < React . JSX . Element > {
8+ const AntdInferencer = dynamic (
9+ ( ) => import ( '@repo/ui/refine/antd' ) . then ( ( i ) => i . AntdInferencer ) ,
10+ {
11+ ssr : false ,
12+ } ,
13+ )
14+
15+ export default async function EditPage ( ) {
916 return (
1017 < Layout >
1118 < AntdInferencer />
Original file line number Diff line number Diff line change 11'use server'
22
3- import { AntdInferencer } from '@repo/ui/refine/antd '
3+ import dynamic from 'next/dynamic '
44import React from 'react'
55
66import { Layout } from 'web/components/Layout'
77
8- export default async function ShowPage ( ) : Promise < React . JSX . Element > {
8+ const AntdInferencer = dynamic (
9+ ( ) => import ( '@repo/ui/refine/antd' ) . then ( ( i ) => i . AntdInferencer ) ,
10+ {
11+ ssr : false ,
12+ } ,
13+ )
14+
15+ export default async function ShowPage ( ) {
916 return (
1017 < Layout >
1118 < AntdInferencer />
Original file line number Diff line number Diff line change 11'use server'
22
3- import { AntdInferencer } from '@repo/ui/refine/antd '
3+ import dynamic from 'next/dynamic '
44import React from 'react'
55
66import { Layout } from 'web/components/Layout'
77
8- export default async function CreatePage ( ) : Promise < React . JSX . Element > {
8+ const AntdInferencer = dynamic (
9+ ( ) => import ( '@repo/ui/refine/antd' ) . then ( ( i ) => i . AntdInferencer ) ,
10+ {
11+ ssr : false ,
12+ } ,
13+ )
14+
15+ export default async function CreatePage ( ) {
916 return (
1017 < Layout >
1118 < AntdInferencer />
Original file line number Diff line number Diff line change 11'use server'
22
3- import { AntdInferencer } from '@repo/ui/refine/antd '
3+ import dynamic from 'next/dynamic '
44import React from 'react'
55
66import { Layout } from 'web/components/Layout'
77
8- export default async function ListPage ( ) : Promise < React . JSX . Element > {
8+ const AntdInferencer = dynamic (
9+ ( ) => import ( '@repo/ui/refine/antd' ) . then ( ( i ) => i . AntdInferencer ) ,
10+ {
11+ ssr : false ,
12+ } ,
13+ )
14+
15+ export default async function ListPage ( ) {
916 return (
1017 < Layout >
1118 < AntdInferencer />
Original file line number Diff line number Diff line change 11'use client'
22
3- import {
4- useIsAuthenticated ,
5- useLink ,
6- } from '@repo/ui/refine/core'
3+ import { useIsAuthenticated , useLink , useTranslate } from '@repo/ui/refine/core'
74import React from 'react'
85
96import { Layout , Space , theme } from '@repo/ui/general'
@@ -17,6 +14,8 @@ export const Header: React.FC = () => {
1714 const Link = useLink ( )
1815 const { data : auth } = useIsAuthenticated ( )
1916 const isAuthenticated = auth ?. authenticated
17+ const translate = useTranslate ( )
18+ const loginMessage = translate ( 'buttons.login' , 'Login' )
2019
2120 const headerStyles : React . CSSProperties = {
2221 backgroundColor : token . colorBgElevated ,
@@ -36,7 +35,7 @@ export const Header: React.FC = () => {
3635 < Space >
3736 { /*<Notifications/>*/ }
3837 { isAuthenticated ? < CurrentUser /> : null }
39- { ! isAuthenticated ? < Link to = { 'login' } > Login </ Link > : null }
38+ { ! isAuthenticated ? < Link to = { 'login' } > { loginMessage } </ Link > : null }
4039 </ Space >
4140 </ BaseHeader >
4241 )
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ import { BrandTitle } from '../BrandTitle'
66import { Header } from './header'
77
88export const Layout : React . FC < React . PropsWithChildren > = ( { children } ) => {
9- console . log ( 'Layout' )
10-
119 return (
1210 // ThemedLayoutV2: https://refine.dev/docs/ui-integrations/ant-design/components/themed-layout/
1311 // Header: https://refine.dev/docs/ui-integrations/ant-design/components/themed-layout/#header
Original file line number Diff line number Diff line change 99 DEFAULT_LOCALE ,
1010 DEFAULT_NAMESPACE ,
1111 LOCALES ,
12+ IS_I18N_DEBUG_ENABLED ,
1213} from '@repo/i18n'
1314
1415import { IMPORTER } from './importer'
@@ -20,7 +21,7 @@ i18next
2021 . use ( LanguageDetector )
2122 . use ( resourcesToBackend ( IMPORTER ) )
2223 . init ( {
23- // debug: true ,
24+ debug : IS_I18N_DEBUG_ENABLED ,
2425 lng : undefined , // let detect the language on client side
2526 fallbackLng : DEFAULT_LOCALE ,
2627 fallbackNS : DEFAULT_NAMESPACE ,
You can’t perform that action at this time.
0 commit comments