Skip to content

Commit

Permalink
♻️ refactor console function
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed May 26, 2021
1 parent c129d25 commit f5f7346
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can use the following environment variables to customize the configuration.

### Tencent CloudBase

Developed and deployed based on Tencent's open source project [CloudBase Framework](https://github.com/Tencent/cloudbase-framework) [![star](https://img.shields.io/github/stars/Tencent/cloudbase-framework?style=social)](https://github.com/Tencent/cloudbase-framework). One-click deploying is supported.
Developed and deployed based on Tencent's open source project [CloudBase Framework](https://github.com/Tencent/cloudbase-framework). One-click deploying is supported.

[![腾讯云|Deploy to CloudBase](https://main.qcloudimg.com/raw/67f5a389f1ac6f3b4d04c7256438e44f.svg)](https://console.cloud.tencent.com/tcb/env/index?action=CreateAndDeployCloudBaseProject&appUrl=https%3A%2F%2Fgithub.com%2FYunYouJun%2Fair-conditioner%2F&branch=master)

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@

### 腾讯云

基于腾讯开源项目 [CloudBase Framework](https://github.com/Tencent/cloudbase-framework) [![star](https://img.shields.io/github/stars/Tencent/cloudbase-framework?style=social)](https://github.com/Tencent/cloudbase-framework) 开发部署,支持一键云端部署
基于腾讯开源项目 [CloudBase Framework](https://github.com/Tencent/cloudbase-framework) 开发部署,支持一键云端部署

[![腾讯云|部署到云开发](https://main.qcloudimg.com/raw/67f5a389f1ac6f3b4d04c7256438e44f.svg)](https://console.cloud.tencent.com/tcb/env/index?action=CreateAndDeployCloudBaseProject&appUrl=https%3A%2F%2Fgithub.com%2FYunYouJun%2Fair-conditioner%2F&branch=master)

## Dev

```bash
# 开发预览
# yarn dev
yarn start
# http://localhost:3000/

# 构建项目
yarn build
# ./build
```
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
"dependencies": {
"@emotion/react": "^11.4.0",
"@emotion/styled": "^11.3.0",
"@material-ui/core": "^5.0.0-alpha.33",
"@material-ui/core": "^5.0.0-alpha.34",
"@material-ui/icons": "^4.11.2",
"@reduxjs/toolkit": "^1.5.1",
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^13.1.9",
"@types/jest": "^26.0.23",
"@types/node": "^15.3.0",
"@types/react": "^17.0.5",
"@types/node": "^15.6.1",
"@types/react": "^17.0.8",
"@types/react-dom": "^17.0.5",
"@types/react-redux": "^7.1.16",
"react": "^17.0.2",
Expand All @@ -61,7 +61,7 @@
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"sass": "^1.32.13",
"sass": "^1.34.0",
"typescript": "^4.2.4",
"web-vitals": "^1.1.2"
},
Expand Down
34 changes: 24 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,32 @@ import Home from "./pages/Home";
import Rc from "./pages/Rc";
import { useEffect } from "react";

import pkg from "../package.json";

/**
* 控制台输出信息
* @param name 名称
* @param link 链接
* @param color 颜色
* @param emoji
*/
function consoleInfo(
name: string,
link: string,
color = "#0078E7",
emoji = "☁️"
) {
console.log(
`%c ${emoji} ${name} %c ${link}`,
`color: white; background: ${color}; padding:5px 0;`,
`padding:4px;border:1px solid ${color};`
);
}

function App() {
useEffect(() => {
console.log(
`%c ☁️ air-conditioner %c https://github.com/YunYouJun/air-conditioner`,
"color: white; background: #0078E7; padding:5px 0;",
"padding:4px;border:1px solid #0078E7;"
);
console.log(
`%c ☁️ @YunYouJun %c https://www.yunyoujun.cn`,
"color: white; background: #0078E7; padding:5px 0;",
"padding:4px;border:1px solid #0078E7;"
);
consoleInfo(pkg.name, pkg.repository.url);
consoleInfo("@" + pkg.author.name, pkg.author.url);
}, []);
return (
<ThemeProvider>
Expand Down

1 comment on commit f5f7346

@vercel
Copy link

@vercel vercel bot commented on f5f7346 May 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.