Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
56d97e46
Commit
56d97e46
authored
May 18, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 去掉 styled-component
parent
67a31268
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
48 deletions
+52
-48
index.less
src/components/MellowCard/index.less
+47
-0
index.tsx
src/components/MellowCard/index.tsx
+5
-48
No files found.
src/components/MellowCard/index.less
View file @
56d97e46
.mellow-card {
:global {
.ant-card {
border-radius: 8px;
.ant-card-head {
border-bottom: none;
.ant-card-head-title {
padding-bottom: 0;
font-size: 14px;
font-weight: 500;
color: rgba(23, 43, 77, 1);
}
}
.ant-card-extra {
padding: 16px 0 0 0;
}
.ant-card-body {
padding: 14px 24px 24px;
}
}
}
&.fullHeight {
height: 100%;
:global {
.ant-card {
height: 100%;
display: flex;
flex-direction: column !important;
.ant-card-head {
flex-shrink: 0;
}
.ant-card-body {
flex: 1;
}
}
}
}
}
\ No newline at end of file
src/components/MellowCard/index.tsx
View file @
56d97e46
...
@@ -9,50 +9,7 @@ import React from 'react';
...
@@ -9,50 +9,7 @@ import React from 'react';
import
{
Card
}
from
'antd'
;
import
{
Card
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
{
CardProps
}
from
'antd/lib/card'
;
import
{
CardProps
}
from
'antd/lib/card'
;
import
styled
from
'styled-components'
;
import
styles
from
'./index.less'
;
const
Wrap
=
styled
(
props
=>
<
div
{
...
props
}
/>)
`
> .ant-card {
border-radius: 8px;
.ant-card-head {
border-bottom: none;
.ant-card-head-title {
padding-bottom: 0;
font-size: 14px;
font-weight: 500;
color: rgba(23, 43, 77, 1);
}
}
.ant-card-extra {
padding: 16px 0 0 0;
}
.ant-card-body {
padding: 14px 24px 24px;
}
}
&.fullHeight {
height: 100%;
.ant-card {
height: 100%;
display: flex;
flex-direction: column !important;
.ant-card-head {
flex-shrink: 0;
}
.ant-card-body {
flex: 1;
}
}
}
`
export
interface
MellowCardProps
extends
CardProps
{
export
interface
MellowCardProps
extends
CardProps
{
/**
/**
...
@@ -63,16 +20,16 @@ export interface MellowCardProps extends CardProps {
...
@@ -63,16 +20,16 @@ export interface MellowCardProps extends CardProps {
const
MellowCard
:
React
.
FC
<
MellowCardProps
>
=
props
=>
{
const
MellowCard
:
React
.
FC
<
MellowCardProps
>
=
props
=>
{
const
{
children
,
fullHeight
,
...
rest
}
=
props
;
const
{
children
,
fullHeight
,
...
rest
}
=
props
;
const
cls
=
classNames
({
const
cls
=
classNames
(
styles
[
'mellow-card'
],
{
'fullHeight'
:
fullHeight
,
[
styles
.
fullHeight
]
:
fullHeight
,
});
});
return
(
return
(
<
Wrap
className=
{
cls
}
>
<
div
className=
{
cls
}
>
<
Card
bordered=
{
false
}
{
...
rest
}
>
<
Card
bordered=
{
false
}
{
...
rest
}
>
{
children
}
{
children
}
</
Card
>
</
Card
>
</
Wrap
>
</
div
>
)
)
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment