feat: ability to add notes to accounts

This commit is contained in:
Matiss Janis Aboltins 2022-10-06 20:27:36 +01:00 committed by James Long
parent ba71c1ba05
commit 2566b950c2

View file

@ -35,6 +35,7 @@ import {
Stack Stack
} from 'loot-design/src/components/common'; } from 'loot-design/src/components/common';
import { KeyHandlers } from 'loot-design/src/components/KeyHandlers'; import { KeyHandlers } from 'loot-design/src/components/KeyHandlers';
import NotesButton from 'loot-design/src/components/NotesButton';
import CellValue from 'loot-design/src/components/spreadsheet/CellValue'; import CellValue from 'loot-design/src/components/spreadsheet/CellValue';
import format from 'loot-design/src/components/spreadsheet/format'; import format from 'loot-design/src/components/spreadsheet/format';
import useSheetValue from 'loot-design/src/components/spreadsheet/useSheetValue'; import useSheetValue from 'loot-design/src/components/spreadsheet/useSheetValue';
@ -670,30 +671,46 @@ const AccountHeader = React.memo(
/> />
</InitialFocus> </InitialFocus>
) : isNameEditable ? ( ) : isNameEditable ? (
<Button <View
bare
style={{ style={{
fontSize: 25, flexDirection: 'row',
fontWeight: 500, alignItems: 'center',
marginLeft: -5, gap: 3,
marginTop: -5, '& .hover-visible': {
backgroundColor: 'transparent', opacity: 0,
'& svg': { display: 'none' }, transition: 'opacity .25s'
'&:hover svg': { display: 'unset' } },
'&:hover .hover-visible': {
opacity: 1
}
}} }}
onClick={() => onExposeName(true)}
> >
{accountName} <View
<Pencil1
style={{ style={{
width: 11, fontSize: 25,
height: 11, fontWeight: 500,
marginLeft: 5, marginRight: 5,
color: colors.n4 marginBottom: 5
}} }}
/> >
</Button> {accountName}
</View>
<NotesButton id={`account-notes-${account.id}`} />
<Button
bare
className="hover-visible"
onClick={() => onExposeName(true)}
>
<Pencil1
style={{
width: 11,
height: 11,
color: colors.n8
}}
/>
</Button>
</View>
) : ( ) : (
<View <View
style={{ fontSize: 25, fontWeight: 500, marginBottom: 5 }} style={{ fontSize: 25, fontWeight: 500, marginBottom: 5 }}