Skip to content

Commit

Permalink
chore: prittier
Browse files Browse the repository at this point in the history
  • Loading branch information
pahaz committed Jun 8, 2024
1 parent b8a7bcf commit bd92dfa
Show file tree
Hide file tree
Showing 34 changed files with 585 additions and 519 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![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)

What's inside? React + Next.js + Ant + Turbo + react-i18next + Refine
What's inside? React + Next.js + Ant + Turbo + react-i18next + Refine

# Rapid Development Node.js Hackathon template

Expand Down
1 change: 0 additions & 1 deletion apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ All applications are stored here.

You can use a microservice approach or a traditional monolith approach.
But we strongly recommend separating your API from the front-end application.

3 changes: 1 addition & 2 deletions apps/web/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import React from 'react'

import { Layout } from 'web/components/Layout'


export default async function DashboardPage (): Promise<React.JSX.Element> {
export default async function DashboardPage(): Promise<React.JSX.Element> {
return (
<Layout>
<Show headerButtons={[]}>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/forgot-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface QueryProps {
email?: string
}

export default function ForgotPasswordPage (): React.JSX.Element {
export default function ForgotPasswordPage(): React.JSX.Element {
const { params } = useParsed<QueryProps>()

const emailFromSearchParams = params['email']
Expand All @@ -23,7 +23,7 @@ export default function ForgotPasswordPage (): React.JSX.Element {
<AuthPage
type="forgotPassword"
formProps={{ initialValues }}
title={<BrandTitle collapsed={false}/>}
title={<BrandTitle collapsed={false} />}
/>
)
}
10 changes: 6 additions & 4 deletions apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ import { Providers } from './providers'

const inter = Inter({ subsets: ['latin'] })

export default async function RootLayout ({ children }: {
export default async function RootLayout({
children,
}: {
children: React.ReactNode
}): Promise<React.JSX.Element> {
const locale = await getLocale()

return (
<html lang={locale} dir={dir(locale)}>
<body className={inter.className}>
<Providers locale={locale}>{(children)}</Providers>
</body>
<body className={inter.className}>
<Providers locale={locale}>{children}</Providers>
</body>
</html>
)
}
8 changes: 4 additions & 4 deletions apps/web/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface QueryProps {
refreshToken?: string
}

export default function LoginPage (): React.JSX.Element {
export default function LoginPage(): React.JSX.Element {
const { params } = useParsed<QueryProps>()
const { mutate } = useLogin()
const translate = useTranslate()
Expand All @@ -39,11 +39,11 @@ export default function LoginPage (): React.JSX.Element {
<AuthPage
type="login"
formProps={{ initialValues }}
title={<BrandTitle collapsed={false}/>}
title={<BrandTitle collapsed={false} />}
providers={[
{
name: 'google',
label: translate("pages.login.google", 'Sign in with Google'),
label: translate('pages.login.google', 'Sign in with Google'),
icon: (
<GoogleOutlined
style={{
Expand All @@ -55,7 +55,7 @@ export default function LoginPage (): React.JSX.Element {
},
{
name: 'github',
label: translate("pages.login.github", 'Sign in with GitHub'),
label: translate('pages.login.github', 'Sign in with GitHub'),
icon: (
<GithubOutlined
style={{
Expand Down
113 changes: 56 additions & 57 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,25 @@ const LINKS = [
},
]

async function Head (): Promise<React.JSX.Element> {
async function Head(): Promise<React.JSX.Element> {
const locale = await getLocale()
const translate = await getServerTranslate(locale)

return <div className={styles.description}>
<p>
{translate('dashboard.title', 'Dashboard')}
</p>
<div>
<BrandTitle collapsed={false}/>
return (
<div className={styles.description}>
<p>{translate('dashboard.title', 'Dashboard')}</p>
<div>
<BrandTitle collapsed={false} />
</div>
</div>
</div>
)
}

function Gradient ({ conic, className, small }: {
function Gradient({
conic,
className,
small,
}: {
small?: boolean
conic?: boolean
className?: string
Expand All @@ -65,53 +69,47 @@ function Gradient ({ conic, className, small }: {
)
}

function Hero (): React.JSX.Element {
return <div className={styles.hero}>
<div className={styles.heroContent}>
<div className={styles.logos}>
<div className={styles.circles}>
<Image
alt=""
height={614}
src="circles.svg"
width={614}
style={{ pointerEvents: 'none' }}
/>
</div>
<div className={styles.logoGradientContainer}>
<Gradient
className={styles.logoGradient}
conic
small
/>
</div>
function Hero(): React.JSX.Element {
return (
<div className={styles.hero}>
<div className={styles.heroContent}>
<div className={styles.logos}>
<div className={styles.circles}>
<Image
alt=""
height={614}
src="circles.svg"
width={614}
style={{ pointerEvents: 'none' }}
/>
</div>
<div className={styles.logoGradientContainer}>
<Gradient className={styles.logoGradient} conic small />
</div>

<div className={styles.logo}>
<Logo width={65} height={65}/>
<div className={styles.logo}>
<Logo width={65} height={65} />
</div>
</div>
<Gradient className={styles.backgroundGradient} conic />
</div>
<Gradient className={styles.backgroundGradient} conic/>
</div>
</div>
)
}

function Card ({
function Card({
className,
title,
children,
href,
}: {
className?: string;
title: string;
children: React.ReactNode;
href: string;
className?: string
title: string
children: React.ReactNode
href: string
}): React.JSX.Element {
return (
<a
className={className}
href={href}
rel="noopener noreferrer"
>
<a className={className} href={href} rel="noopener noreferrer">
<h2>
{title} <span>-&gt;</span>
</h2>
Expand All @@ -120,26 +118,27 @@ function Card ({
)
}

function CardLinks (): React.JSX.Element {
return <div className={styles.grid}>
{LINKS.map(({ title, href, description }) => (
<Card className={styles.card} href={href} key={title} title={title}>
{description}
</Card>
))}
</div>
function CardLinks(): React.JSX.Element {
return (
<div className={styles.grid}>
{LINKS.map(({ title, href, description }) => (
<Card className={styles.card} href={href} key={title} title={title}>
{description}
</Card>
))}
</div>
)
}

export default async function Page (): Promise<React.JSX.Element> {
export default async function Page(): Promise<React.JSX.Element> {
return (
<Layout className={styles.main}>
{/*<NavigateToResource/>*/}

<Head/>
<Hero/>
<CardLinks/>
<FormExample/>

<Head />
<Hero />
<CardLinks />
<FormExample />
</Layout>
)
}
27 changes: 18 additions & 9 deletions apps/web/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,29 @@ const resources: ResourceProps[] = [
},
]

export function Providers ({ children, locale }: { children?: ReactNode, locale: string }) {
export function Providers({
children,
locale,
}: {
children?: ReactNode
locale: string
}) {
const { t, i18n } = useTranslation(DEFAULT_NAMESPACE, { lng: locale })
const i18nProvider: I18nProvider = {
translate: (key: string, params) => t(key, params),
changeLocale: (lang: string) => i18n.changeLanguage(lang),
getLocale: () => i18n.language,
}

return <Refine
dataProvider={dataProvider}
authProvider={authProvider}
notificationProvider={useNotificationProvider}
i18nProvider={i18nProvider}
resources={resources}>
{children}
</Refine>
return (
<Refine
dataProvider={dataProvider}
authProvider={authProvider}
notificationProvider={useNotificationProvider}
i18nProvider={i18nProvider}
resources={resources}
>
{children}
</Refine>
)
}
6 changes: 3 additions & 3 deletions apps/web/app/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface QueryProps {
email?: string
}

export default function RegisterPage (): React.JSX.Element {
export default function RegisterPage(): React.JSX.Element {
const { params } = useParsed<QueryProps>()
const translate = useTranslate()

Expand All @@ -25,7 +25,7 @@ export default function RegisterPage (): React.JSX.Element {
<AuthPage
type="register"
formProps={{ initialValues }}
title={<BrandTitle collapsed={false}/>}
title={<BrandTitle collapsed={false} />}
providers={[
{
name: 'google',
Expand All @@ -41,7 +41,7 @@ export default function RegisterPage (): React.JSX.Element {
},
{
name: 'github',
label: translate("pages.login.github", 'Sign in with GitHub'),
label: translate('pages.login.github', 'Sign in with GitHub'),
icon: (
<GithubOutlined
style={{
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/samples/[id]/clone/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React from 'react'

import { Layout } from 'web/components/Layout'

export default async function ClonePage (): Promise<React.JSX.Element> {
export default async function ClonePage(): Promise<React.JSX.Element> {
return (
<Layout>
<AntdInferencer/>
<AntdInferencer />
</Layout>
)
}
4 changes: 2 additions & 2 deletions apps/web/app/samples/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React from 'react'

import { Layout } from 'web/components/Layout'

export default async function EditPage (): Promise<React.JSX.Element> {
export default async function EditPage(): Promise<React.JSX.Element> {
return (
<Layout>
<AntdInferencer/>
<AntdInferencer />
</Layout>
)
}
4 changes: 2 additions & 2 deletions apps/web/app/samples/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React from 'react'

import { Layout } from 'web/components/Layout'

export default async function ShowPage (): Promise<React.JSX.Element> {
export default async function ShowPage(): Promise<React.JSX.Element> {
return (
<Layout>
<AntdInferencer/>
<AntdInferencer />
</Layout>
)
}
4 changes: 2 additions & 2 deletions apps/web/app/samples/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React from 'react'

import { Layout } from 'web/components/Layout'

export default async function CreatePage (): Promise<React.JSX.Element> {
export default async function CreatePage(): Promise<React.JSX.Element> {
return (
<Layout>
<AntdInferencer/>
<AntdInferencer />
</Layout>
)
}
4 changes: 2 additions & 2 deletions apps/web/app/samples/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React from 'react'

import { Layout } from 'web/components/Layout'

export default async function ListPage (): Promise<React.JSX.Element> {
export default async function ListPage(): Promise<React.JSX.Element> {
return (
<Layout>
<AntdInferencer/>
<AntdInferencer />
</Layout>
)
}
7 changes: 2 additions & 5 deletions apps/web/app/update-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import React from 'react'

import { BrandTitle } from 'web/components/BrandTitle'

export default function UpdatePasswordPage (): React.JSX.Element {
export default function UpdatePasswordPage(): React.JSX.Element {
return (
<AuthPage
type="updatePassword"
title={<BrandTitle collapsed={false}/>}
/>
<AuthPage type="updatePassword" title={<BrandTitle collapsed={false} />} />
)
}
Loading

0 comments on commit bd92dfa

Please sign in to comment.