Skip to content

Commit d5cd1b6

Browse files
committed
Improve log modal style
1 parent bae7518 commit d5cd1b6

File tree

4 files changed

+24
-57
lines changed

4 files changed

+24
-57
lines changed

packages/evmcrispr-terminal/src/components/LogModal/index.tsx

+3-23
Original file line numberDiff line numberDiff line change
@@ -45,41 +45,21 @@ export default function LogModal({
4545
closeModal: () => void;
4646
logs: string[];
4747
}) {
48-
const hasError = logs.find((log) => log.startsWith(':error:'));
49-
const hasSuccess = logs.find((log) => log.startsWith(':success:'));
50-
const statusColor = hasError
51-
? 'warning.300'
52-
: hasSuccess
53-
? 'green.300'
54-
: 'yellow.300';
55-
5648
return (
5749
<Modal
5850
size="xl"
5951
isOpen={isOpen}
6052
onClose={closeModal}
6153
isCentered
62-
colorScheme={hasError ? 'warning' : hasSuccess ? 'green' : 'yellow'}
54+
colorScheme={'yellow'}
6355
>
6456
<ModalOverlay />
6557
<ModalContent>
6658
<ModalHeader>Logs</ModalHeader>
6759
<ModalCloseButton />
68-
<ModalBody overflow="scroll">
60+
<ModalBody overflow="auto">
6961
<VStack spacing={10} w={'full'} height="100%">
70-
<Icon
71-
as={
72-
hasError
73-
? XCircleIcon
74-
: hasSuccess
75-
? CheckCircleIcon
76-
: InformationCircleIcon
77-
}
78-
color={statusColor}
79-
boxSize={20}
80-
mt={10}
81-
/>
82-
<VStack spacing={2} w={'full'} pb="20px">
62+
<VStack spacing={2} w={'full'} py="30px">
8363
{logs.map((log, i) => {
8464
const _status = status(log);
8565
const _statusColor =

packages/evmcrispr-terminal/src/components/Toast/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Alert, AlertDescription, AlertIcon } from '@chakra-ui/react';
22

33
export default function Toast({ status, description }: any) {
44
return (
5-
<Alert status={status}>
5+
<Alert variant="solid" status={status}>
66
<AlertIcon />
77
<AlertDescription>{description}</AlertDescription>
88
</Alert>

packages/evmcrispr-terminal/src/theme/AlertCustomization.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@ const baseStyle = definePartsStyle((props) => {
1010
color: 'white',
1111
},
1212
container: {
13-
fontFamily: 'Ubuntu Mono, monospace',
13+
'& p': {
14+
marginBottom: '0px',
15+
fontFamily: '"Ubuntu Mono", monospace',
16+
},
17+
fontFamily: '"Ubuntu Mono", monospace',
18+
paddingY: '14px',
1419
bgColor:
1520
props.status === 'error'
1621
? 'pink.700'
1722
: props.status === 'success'
1823
? 'green.800'
1924
: props.status === 'info'
20-
? 'blue.500'
25+
? 'grey.500'
2126
: 'orange.700',
22-
border: '1px solid',
27+
border: '0',
2328
borderColor: 'white',
2429
},
2530
title: {
@@ -38,6 +43,13 @@ const baseStyle = definePartsStyle((props) => {
3843

3944
const alertTheme = defineMultiStyleConfig({
4045
baseStyle,
46+
variants: {
47+
solid: {
48+
container: {
49+
border: '1px solid',
50+
},
51+
},
52+
},
4153
});
4254

4355
export default alertTheme;

packages/evmcrispr-terminal/src/theme/ModalCustomization.ts

+5-30
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,16 @@ const baseStyle = definePartsStyle((props) => {
1818
closeButton: {
1919
color: `${c}.300`,
2020
},
21+
dialogContainer: {
22+
'& > section': {
23+
boxShadow: `6px 6px var(--chakra-colors-${c}-800)`,
24+
},
25+
},
2126
dialog: {
2227
bgColor: 'black',
2328
border: '2px solid',
2429
borderColor: `${c}.300`,
2530
borderRadius: 'none',
26-
27-
'&:before': {
28-
boxSizing: 'border-box',
29-
borderRight: '10px solid',
30-
borderBottom: '10px solid',
31-
borderColor: `${c}.800`,
32-
content: '""',
33-
display: 'block',
34-
position: 'absolute',
35-
},
3631
},
3732
body: {
3833
w: 'full',
@@ -55,26 +50,13 @@ const headerBase = defineStyle({
5550
const mdDialog = defineStyle({
5651
fontSize: 'md',
5752
lineHeight: 'base',
58-
59-
'&:before': {
60-
h: 'full',
61-
w: 'full',
62-
top: '13px',
63-
left: '13px',
64-
},
6553
});
6654

6755
const lgDialog = defineStyle({
6856
w: '2xl',
6957
maxW: 'unset',
7058
fontSize: '2xl',
7159
lineHeight: 'base',
72-
'&:before': {
73-
w: '2xl',
74-
h: 'full',
75-
top: '13px',
76-
left: '9px',
77-
},
7860
});
7961

8062
const xlDialog = defineStyle({
@@ -83,13 +65,6 @@ const xlDialog = defineStyle({
8365
h: 'lg',
8466
fontSize: '2xl',
8567
lineHeight: 'base',
86-
'&:before': {
87-
maxW: 'unset',
88-
w: '4xl',
89-
h: 'lg',
90-
top: '9px',
91-
left: '9px',
92-
},
9368
});
9469

9570
const xlBody = defineStyle({

0 commit comments

Comments
 (0)