-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
580aa7c
commit 0e3a15e
Showing
30 changed files
with
1,028 additions
and
141 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
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,34 @@ | ||
import React from "react"; | ||
import { CacheProvider } from "@emotion/react"; | ||
import { ColorModeScript, ChakraProvider } from "@chakra-ui/react"; | ||
import { App } from "components/App"; | ||
import { createEmotionCache } from "config/createEmotionCache"; | ||
import { HelmetProvider } from "react-helmet-async"; | ||
import { Provider } from "react-redux"; | ||
import { BrowserRouter as Router } from "react-router-dom"; | ||
import { createUniversalStore } from "store"; | ||
|
||
const cache = createEmotionCache(); | ||
|
||
const Root = ({ store }: { store: ReturnType<typeof createUniversalStore> }) => { | ||
console.warn("you are using chakra UI component library!"); | ||
|
||
return ( | ||
// <React.StrictMode> for chakra UI always have id not match issue on the develop mode | ||
<CacheProvider value={cache}> | ||
<ChakraProvider resetCSS> | ||
<Provider store={store}> | ||
<Router> | ||
<HelmetProvider> | ||
<ColorModeScript /> | ||
<App /> | ||
</HelmetProvider> | ||
</Router> | ||
</Provider> | ||
</ChakraProvider> | ||
</CacheProvider> | ||
// </React.StrictMode> | ||
); | ||
}; | ||
|
||
export { Root }; |
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.
This file was deleted.
Oops, something went wrong.
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
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 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 React from "react"; | ||
import { getUniverSalUI } from "utils/universal"; | ||
|
||
export function UI() { | ||
return ( | ||
<div> | ||
<h3>当前UI Component: {getUniverSalUI()}</h3> | ||
</div> | ||
); | ||
} |
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,29 @@ | ||
import React from "react"; | ||
import { DatePicker, Carousel } from "antd"; | ||
|
||
const AntDesignComponent = () => { | ||
return ( | ||
<> | ||
<h2>Ant Design</h2> | ||
<DatePicker /> | ||
<br /> | ||
<div style={{ width: "300px", borderRadius: "0.6rem", overflow: "hidden" }}> | ||
<Carousel autoplay> | ||
<div> | ||
<div style={{ height: "200px", backgroundColor: "#ccc", textAlign: "center", fontSize: "1.6rem" }}>1</div> | ||
</div> | ||
<div> | ||
<div style={{ height: "200px", backgroundColor: "#ccc", textAlign: "center", fontSize: "1.6rem" }}>2</div> | ||
</div> | ||
<div> | ||
<div style={{ height: "200px", backgroundColor: "#ccc", textAlign: "center", fontSize: "1.6rem" }}>3</div> | ||
</div> | ||
<div> | ||
<div style={{ height: "200px", backgroundColor: "#ccc", textAlign: "center", fontSize: "1.6rem" }}>4</div> | ||
</div> | ||
</Carousel> | ||
</div> | ||
</> | ||
); | ||
}; | ||
export default AntDesignComponent; |
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,37 @@ | ||
import React from "react"; | ||
import { Select, Button, Box, Fade, useDisclosure, Menu, MenuButton, MenuList, MenuItem } from "@chakra-ui/react"; | ||
|
||
export default function ChakraComponent() { | ||
const { isOpen, onToggle } = useDisclosure(); | ||
return ( | ||
<> | ||
<h2>Chakra UI</h2> | ||
<Select placeholder="Select option"> | ||
<option value="option1">Option 1</option> | ||
<option value="option2">Option 2</option> | ||
<option value="option3">Option 3</option> | ||
</Select> | ||
<hr /> | ||
<Button onClick={onToggle}>Click Me</Button> | ||
<Fade in={isOpen}> | ||
<Box p="40px" color="white" mt="4" bg="teal.500" rounded="md" shadow="md"> | ||
Fade | ||
</Box> | ||
</Fade> | ||
|
||
<Menu> | ||
{({ isOpen }) => ( | ||
<> | ||
<MenuButton isActive={isOpen} as={Button} rightIcon={<span>{1234}</span>}> | ||
{isOpen ? "Close" : "Open"} | ||
</MenuButton> | ||
<MenuList> | ||
<MenuItem>Download</MenuItem> | ||
<MenuItem onClick={() => alert("Kagebunshin")}>Create a Copy</MenuItem> | ||
</MenuList> | ||
</> | ||
)} | ||
</Menu> | ||
</> | ||
); | ||
} |
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,17 @@ | ||
import React from "react"; | ||
import { useIntl } from "react-intl"; | ||
import style from "./style.module.scss"; | ||
|
||
export const I18n = () => { | ||
const { formatMessage: f } = useIntl(); | ||
return ( | ||
<div className={style.c}> | ||
aaaa | ||
<p>{f({ id: "app.title", defaultMessage: "hello" })}</p> | ||
<p>{f({ id: "home.lead", defaultMessage: "test" })}</p> | ||
<p>{f({ id: "home.title", defaultMessage: "title" })}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default I18n; |
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
Oops, something went wrong.