-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into ducanhgh-fix-hostnames
- Loading branch information
Showing
15 changed files
with
183 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import { useServerInsertedHTML } from 'next/navigation' | ||
import { StyleProvider, createCache, extractStyle } from '@ant-design/cssinjs' | ||
|
||
interface StyledRegistryProps { | ||
children: React.ReactNode | ||
} | ||
|
||
const StyledComponentsRegistry = ({ children }: StyledRegistryProps) => { | ||
const cache = createCache() | ||
useServerInsertedHTML(() => ( | ||
<style | ||
id="antd" | ||
dangerouslySetInnerHTML={{ __html: extractStyle(cache, true) }} | ||
/> | ||
)) | ||
return <StyleProvider cache={cache}>{children}</StyleProvider> | ||
} | ||
|
||
export default StyledComponentsRegistry |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
:root { | ||
--foreground-rgb: 0, 0, 0; | ||
--background-start-rgb: 214, 219, 220; | ||
--background-end-rgb: 255, 255, 255; | ||
} | ||
|
||
body { | ||
color: rgb(var(--foreground-rgb)); | ||
background: linear-gradient( | ||
to bottom, | ||
transparent, | ||
rgb(var(--background-end-rgb)) | ||
) | ||
rgb(var(--background-start-rgb)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react' | ||
import type { Metadata } from 'next' | ||
import { Inter } from 'next/font/google' | ||
import StyledComponentsRegistry from './AntdRegistry' | ||
import './globals.css' | ||
|
||
const inter = Inter({ subsets: ['latin'] }) | ||
|
||
export const metadata: Metadata = { | ||
title: 'Create Next App', | ||
description: 'Generated by create next app', | ||
} | ||
|
||
interface RootLayoutProps { | ||
children: React.ReactNode | ||
} | ||
|
||
function RootLayout({ children }: RootLayoutProps) { | ||
return ( | ||
<html lang="en"> | ||
<body className={inter.className}> | ||
<StyledComponentsRegistry>{children}</StyledComponentsRegistry> | ||
</body> | ||
</html> | ||
) | ||
} | ||
|
||
export default RootLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import Link from 'next/link' | ||
import { SmileFilled } from '@ant-design/icons' | ||
import { | ||
Button, | ||
DatePicker, | ||
Form, | ||
InputNumber, | ||
Select, | ||
Slider, | ||
Switch, | ||
ConfigProvider, | ||
} from 'antd' | ||
import theme from './themeConfig' | ||
|
||
const HomePage = () => ( | ||
<ConfigProvider theme={theme}> | ||
<div style={{ padding: 100, height: '100vh' }}> | ||
<div className="text-center mb-5"> | ||
<Link href="#" className="logo mr-0"> | ||
<SmileFilled style={{ fontSize: 48 }} /> | ||
</Link> | ||
<p className="mb-0 mt-3 text-disabled">Welcome to the world !</p> | ||
</div> | ||
<div> | ||
<Form | ||
layout="horizontal" | ||
size={'large'} | ||
labelCol={{ span: 8 }} | ||
wrapperCol={{ span: 8 }} | ||
> | ||
<Form.Item label="Input Number"> | ||
<InputNumber | ||
min={1} | ||
max={10} | ||
style={{ width: 100 }} | ||
defaultValue={3} | ||
name="inputNumber" | ||
/> | ||
</Form.Item> | ||
<Form.Item label="Switch"> | ||
<Switch defaultChecked /> | ||
</Form.Item> | ||
<Form.Item label="Slider"> | ||
<Slider defaultValue={70} /> | ||
</Form.Item> | ||
<Form.Item label="Select"> | ||
<Select | ||
defaultValue="lucy" | ||
style={{ width: 192 }} | ||
options={[ | ||
{ value: 'jack', label: 'Jack' }, | ||
{ value: 'lucy', label: 'Lucy' }, | ||
{ value: 'Yiminghe', label: 'yiminghe' }, | ||
{ value: 'lijianan', label: 'lijianan' }, | ||
{ value: 'disabled', label: 'Disabled', disabled: true }, | ||
]} | ||
/> | ||
</Form.Item> | ||
<Form.Item label="DatePicker"> | ||
<DatePicker showTime /> | ||
</Form.Item> | ||
<Form.Item style={{ marginTop: 48 }} wrapperCol={{ offset: 8 }}> | ||
<Button type="primary" htmlType="submit"> | ||
OK | ||
</Button> | ||
<Button style={{ marginLeft: 8 }}>Cancel</Button> | ||
</Form.Item> | ||
</Form> | ||
</div> | ||
</div> | ||
</ConfigProvider> | ||
) | ||
|
||
export default HomePage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { ThemeConfig } from 'antd' | ||
|
||
const theme: ThemeConfig = { | ||
token: { | ||
fontSize: 16, | ||
colorPrimary: '#52c41a', | ||
}, | ||
} | ||
|
||
export default theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.