style: auto format whole project
This commit is contained in:
@@ -16,12 +16,14 @@ import { Apps, CardContent, ContextMenu, Title, Typography } from './style';
|
||||
|
||||
type FlowRowProps = {
|
||||
flow: IFlow;
|
||||
}
|
||||
};
|
||||
|
||||
export default function FlowRow(props: FlowRowProps): React.ReactElement {
|
||||
const formatMessage = useFormatMessage();
|
||||
const contextButtonRef = React.useRef<HTMLButtonElement | null>(null);
|
||||
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(null);
|
||||
const contextButtonRef = React.useRef<HTMLButtonElement | null>(null);
|
||||
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(
|
||||
null
|
||||
);
|
||||
const { flow } = props;
|
||||
|
||||
const handleClose = () => {
|
||||
@@ -32,7 +34,7 @@ export default function FlowRow(props: FlowRowProps): React.ReactElement {
|
||||
event.stopPropagation();
|
||||
event.nativeEvent.stopImmediatePropagation();
|
||||
setAnchorEl(contextButtonRef.current);
|
||||
}
|
||||
};
|
||||
|
||||
const createdAt = DateTime.fromMillis(parseInt(flow.createdAt, 10));
|
||||
const updatedAt = DateTime.fromMillis(parseInt(flow.updatedAt, 10));
|
||||
@@ -45,7 +47,7 @@ export default function FlowRow(props: FlowRowProps): React.ReactElement {
|
||||
<Card sx={{ mb: 1 }}>
|
||||
<CardActionArea component={Link} to={URLS.FLOW(flow.id)}>
|
||||
<CardContent>
|
||||
<Apps direction="row" gap={1} sx={{gridArea:"apps"}}>
|
||||
<Apps direction="row" gap={1} sx={{ gridArea: 'apps' }}>
|
||||
<FlowAppIcons steps={flow.steps} />
|
||||
</Apps>
|
||||
|
||||
@@ -53,15 +55,21 @@ export default function FlowRow(props: FlowRowProps): React.ReactElement {
|
||||
justifyContent="center"
|
||||
alignItems="flex-start"
|
||||
spacing={1}
|
||||
sx={{gridArea:"title"}}
|
||||
sx={{ gridArea: 'title' }}
|
||||
>
|
||||
<Typography variant="h6" noWrap>
|
||||
{flow?.name}
|
||||
</Typography>
|
||||
|
||||
<Typography variant="caption">
|
||||
{isUpdated && formatMessage('flow.updatedAt', { datetime: relativeUpdatedAt })}
|
||||
{!isUpdated && formatMessage('flow.createdAt', { datetime: relativeCreatedAt })}
|
||||
{isUpdated &&
|
||||
formatMessage('flow.updatedAt', {
|
||||
datetime: relativeUpdatedAt,
|
||||
})}
|
||||
{!isUpdated &&
|
||||
formatMessage('flow.createdAt', {
|
||||
datetime: relativeCreatedAt,
|
||||
})}
|
||||
</Typography>
|
||||
</Title>
|
||||
|
||||
@@ -69,8 +77,10 @@ export default function FlowRow(props: FlowRowProps): React.ReactElement {
|
||||
<Chip
|
||||
size="small"
|
||||
color={flow?.active ? 'success' : 'info'}
|
||||
variant={flow?.active ? 'filled': 'outlined'}
|
||||
label={formatMessage(flow?.active ? 'flow.published' : 'flow.draft')}
|
||||
variant={flow?.active ? 'filled' : 'outlined'}
|
||||
label={formatMessage(
|
||||
flow?.active ? 'flow.published' : 'flow.draft'
|
||||
)}
|
||||
/>
|
||||
|
||||
<IconButton
|
||||
@@ -88,11 +98,13 @@ export default function FlowRow(props: FlowRowProps): React.ReactElement {
|
||||
</CardActionArea>
|
||||
</Card>
|
||||
|
||||
{anchorEl && <FlowContextMenu
|
||||
flowId={flow.id}
|
||||
onClose={handleClose}
|
||||
anchorEl={anchorEl}
|
||||
/>}
|
||||
{anchorEl && (
|
||||
<FlowContextMenu
|
||||
flowId={flow.id}
|
||||
onClose={handleClose}
|
||||
anchorEl={anchorEl}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ export const CardContent = styled(MuiCardContent)(({ theme }) => ({
|
||||
`,
|
||||
gridTemplateColumns: 'minmax(0, auto) min-content',
|
||||
gridTemplateRows: 'auto auto',
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
export const Apps = styled(MuiStack)(() => ({
|
||||
@@ -46,5 +46,5 @@ export const Typography = styled(MuiTypography)(() => ({
|
||||
export const DesktopOnlyBreakline = styled('br')(({ theme }) => ({
|
||||
[theme.breakpoints.down('sm')]: {
|
||||
display: 'none',
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
Reference in New Issue
Block a user