Skip to content

Commit

Permalink
refactor(flat-component): adjust title type in MainPageHeader compone…
Browse files Browse the repository at this point in the history
…nt (#643)
  • Loading branch information
Cheerego7 committed May 18, 2021
1 parent 3c15496 commit 607d803
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ export const Overview: Story<MainPageHeaderProps> = args => (
);
Overview.args = {
routePath: "/example/path",
title: "Example",
periodicUUID: "periodicUUID",
title: <span>Example</span>,
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,3 @@
.main-page-header-back {
color: #3381ff;
}

.main-page-header-title {
margin: 0;
font-size: 16px;
font-weight: 500;
color: #444e60;
line-height: 1;
}

.main-page-header-periodic-sign {
display: flex;
width: 36px;
height: 22px;
line-height: 22px;
margin-left: 8px;
background-color: #3381ff;
border-radius: 4px;
color: #fff;
justify-content: center;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ import { Divider } from "antd";

export interface MainPageHeaderProps {
routePath: string;
title: string;
periodicUUID?: string;
title: React.ReactNode;
}

export const MainPageHeader: React.FC<MainPageHeaderProps> = ({
routePath,
title,
periodicUUID,
}) => {
export const MainPageHeader: React.FC<MainPageHeaderProps> = ({ routePath, title }) => {
return (
<div className="main-page-header-container">
<Link to={routePath}>
Expand All @@ -25,8 +20,7 @@ export const MainPageHeader: React.FC<MainPageHeaderProps> = ({
</div>
</Link>
<Divider type="vertical" />
<h1 className="main-page-header-title">{title}</h1>
{periodicUUID && <span className="main-page-header-periodic-sign">周期</span>}
{title}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Avatar, Divider, Popover } from "antd";
import React, { useState } from "react";
import classNames from "classnames";

export * from "./MainPageHeader";

export interface MainPageLayoutItem {
key: string;
icon: (active: boolean) => React.ReactNode;
Expand Down

0 comments on commit 607d803

Please sign in to comment.