mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat: show card action only on hover
This commit is contained in:
@@ -1,14 +1,6 @@
|
|||||||
import { styled } from '@toeverything/components/ui';
|
|
||||||
import { RenderBlock, useKanban } from '@toeverything/components/editor-core';
|
|
||||||
import type { KanbanCard } from '@toeverything/components/editor-core';
|
import type { KanbanCard } from '@toeverything/components/editor-core';
|
||||||
|
import { RenderBlock, useKanban } from '@toeverything/components/editor-core';
|
||||||
const CardContainer = styled('div')({
|
import { styled } from '@toeverything/components/ui';
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
backgroundColor: '#fff',
|
|
||||||
border: '1px solid #E2E7ED',
|
|
||||||
borderRadius: '5px',
|
|
||||||
});
|
|
||||||
|
|
||||||
const CardContent = styled('div')({
|
const CardContent = styled('div')({
|
||||||
margin: '20px',
|
margin: '20px',
|
||||||
@@ -20,12 +12,16 @@ const CardActions = styled('div')({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '29px',
|
height: '29px',
|
||||||
background: 'rgba(152, 172, 189, 0.1)',
|
|
||||||
borderRadius: '0px 0px 5px 5px',
|
borderRadius: '0px 0px 5px 5px',
|
||||||
padding: '6px 0 6px 19px',
|
padding: '6px 0 6px 19px',
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
fontWeight: '300',
|
fontWeight: '300',
|
||||||
color: '#98ACBD',
|
color: '#98ACBD',
|
||||||
|
transition: 'all ease-in 0.2s',
|
||||||
|
|
||||||
|
':hover': {
|
||||||
|
background: '#F5F7F8',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const PlusIcon = styled('div')({
|
const PlusIcon = styled('div')({
|
||||||
@@ -37,6 +33,23 @@ const PlusIcon = styled('div')({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const CardContainer = styled('div')({
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
border: '1px solid #E2E7ED',
|
||||||
|
borderRadius: '5px',
|
||||||
|
|
||||||
|
[CardActions.toString()]: {
|
||||||
|
opacity: '0',
|
||||||
|
},
|
||||||
|
':hover': {
|
||||||
|
[CardActions.toString()]: {
|
||||||
|
opacity: '1',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const CardItem = ({
|
export const CardItem = ({
|
||||||
id,
|
id,
|
||||||
block,
|
block,
|
||||||
@@ -56,7 +69,7 @@ export const CardItem = ({
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
<CardActions onClick={onAddItem}>
|
<CardActions onClick={onAddItem}>
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
Add item
|
<span>Add item</span>
|
||||||
</CardActions>
|
</CardActions>
|
||||||
</CardContainer>
|
</CardContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user