Skip to content

Commit

Permalink
fix: some styles
Browse files Browse the repository at this point in the history
  • Loading branch information
BIYUEHU committed Jun 12, 2024
1 parent 891bf17 commit efb3c94
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
24 changes: 7 additions & 17 deletions packages/client/src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,35 @@ import React from 'react';
const { Header, Footer, Content } = Layout;

const headerStyle: React.CSSProperties = {
textAlign: 'center',
color: '#fff',
height: 64,
paddingInline: 48,
lineHeight: '64px'
};

const contentStyle: React.CSSProperties = {
textAlign: 'center',
minHeight: 120,
lineHeight: '120px'
lineHeight: '120px',
overflow: 'initial'
};

const footerStyle: React.CSSProperties = {
textAlign: 'center',
color: '#ffff',
backgroundColor: '#333'
};

const layoutStyle = {
const layoutStyle: React.CSSProperties = {
textAlign: 'center',
borderRadius: 8,
overflow: 'hidden',
height: '100vh'
};

const layoutSecondStyle = {
margin: '0 auto',
width: 'min(85ch, 100% - 4rem)',
marginLine: 'auto'
minHeight: '100vh'
};

export default (outlet: React.ReactElement) => (
<Flex gap="middle" wrap>
<Layout style={layoutStyle}>
<Header style={headerStyle}>Header</Header>
<Layout style={layoutSecondStyle}>
<Content style={contentStyle}>{outlet}</Content>
<Footer style={footerStyle}>Footer</Footer>
</Layout>
<Content style={contentStyle}>{outlet}</Content>
<Footer style={footerStyle}>Ant Design ©{new Date().getFullYear()} Created by Ant UED</Footer>
</Layout>
</Flex>
);
6 changes: 1 addition & 5 deletions packages/client/src/http/http.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ http.interceptors.response.use(
} */
response.data,
(err) => {
console.log(err);

if (err instanceof Error) {
message.useMessage()[0].error(`请求错误:${err.message}`);
}
if (err instanceof Error) message.useMessage()[0].error(`请求错误:${err.message}`);
return Promise.reject(err);
}
);
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
// import 'antd/dist/reset.css';
import 'antd/dist/reset.css';
import 'tailwindcss/tailwind.css';
import 'antd/dist/antd.min.js.LICENSE.txt';
import './styles/index.css';
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/views/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export default () => {
return (
<div>
<h1>角色列表</h1>
<Flex justify="center" align="center" wrap="wrap">
<Flex justify="center" wrap="wrap">
{data
.filter((item) => item.images && item.images.length > 0)
.map((item) => (
<Card
key={item.id}
hoverable
style={{ width: 220, float: 'none', margin: '0.5vw' }}
style={{ width: 220, float: 'none', margin: '0.8vh 0.8vw' }}
cover={
<Image
src={item.images![0]}
Expand Down

0 comments on commit efb3c94

Please sign in to comment.