Adjust loading indicator for email templates

This commit is contained in:
Hillel Coren 2024-01-03 14:30:23 +02:00
parent 11ed6af110
commit aeb2960737
1 changed files with 38 additions and 39 deletions

View File

@ -297,23 +297,17 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
return Container( return Container(
color: Colors.white, color: Colors.white,
height: double.infinity, height: double.infinity,
child: Stack( child: (supportsInlineBrowser())
children: [ ? EmailPreview(
if (_isLoading) LinearProgressIndicator(),
if (supportsInlineBrowser())
EmailPreview(
isLoading: _isLoading, isLoading: _isLoading,
subject: _subjectPreview, subject: _subjectPreview,
body: _emailPreview, body: _emailPreview,
) )
else : IgnorePointer(
IgnorePointer(
child: ExampleEditor( child: ExampleEditor(
value: '### $_subjectPreview\n\n\n' + value: '### $_subjectPreview\n\n\n' +
html2md.convert(_bodyPreview), html2md.convert(_bodyPreview),
), ),
)
],
), ),
); );
} }
@ -372,9 +366,11 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
), ),
), ),
), ),
if (state.company.markdownEmailEnabled)
Expanded( Expanded(
child: ColoredBox( child: Stack(
children: [
if (state.company.markdownEmailEnabled)
ColoredBox(
color: Colors.white, color: Colors.white,
child: IgnorePointer( child: IgnorePointer(
ignoring: !enableCustomEmail, ignoring: !enableCustomEmail,
@ -388,7 +384,6 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
}, },
), ),
), ),
),
) )
else else
Padding( Padding(
@ -401,7 +396,11 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
onChanged: (_) => _onChanged(), onChanged: (_) => _onChanged(),
enabled: enableCustomEmail, enabled: enableCustomEmail,
), ),
) ),
if (_isLoading) LinearProgressIndicator(),
],
),
),
], ],
); );
} }