fix(admin-ui): Lint all UI files (#3459)
This commit is contained in:
committed by
GitHub
parent
55febef7f1
commit
ad7d7fcd51
@@ -1,4 +1,4 @@
|
||||
import React, { MutableRefObject, ReactNode } from "react"
|
||||
import React, { ReactNode } from "react"
|
||||
import StatusIndicator from "../../fundamentals/status-indicator"
|
||||
import Tooltip from "../../atoms/tooltip"
|
||||
import clsx from "clsx"
|
||||
@@ -16,18 +16,12 @@ export type ActivityCardProps = {
|
||||
export const ActivityCard: React.FC<ActivityCardProps> = (
|
||||
props: ActivityCardProps
|
||||
) => {
|
||||
const {
|
||||
key,
|
||||
title,
|
||||
icon,
|
||||
relativeTimeElapsed,
|
||||
shouldShowStatus,
|
||||
children
|
||||
} = props
|
||||
const { key, title, icon, relativeTimeElapsed, shouldShowStatus, children } =
|
||||
props
|
||||
|
||||
const date = !!props.date && new Date(props.date).toLocaleDateString(
|
||||
"en-us",
|
||||
{
|
||||
const date =
|
||||
!!props.date &&
|
||||
new Date(props.date).toLocaleDateString("en-us", {
|
||||
hour12: true,
|
||||
day: "2-digit",
|
||||
month: "short",
|
||||
@@ -40,47 +34,33 @@ export const ActivityCard: React.FC<ActivityCardProps> = (
|
||||
const getTimeElement = () => {
|
||||
return (
|
||||
<div className="flex cursor-default">
|
||||
{
|
||||
!!relativeTimeElapsed && (
|
||||
<span >{relativeTimeElapsed}</span>
|
||||
)
|
||||
}
|
||||
{
|
||||
shouldShowStatus &&
|
||||
<StatusIndicator variant={"primary"} className="ml-2"/>
|
||||
}
|
||||
{!!relativeTimeElapsed && <span>{relativeTimeElapsed}</span>}
|
||||
{shouldShowStatus && (
|
||||
<StatusIndicator variant={"primary"} className="ml-2" />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div key={key} className="mx-8 border-b last:border-b-0 border-grey-20">
|
||||
<div className="flex hover:bg-grey-5 -mx-8 px-8 py-6">
|
||||
<div className="relative w-full h-full">
|
||||
<div className="flex justify-between inter-small-semibold text-grey-90">
|
||||
<div key={key} className="border-grey-20 mx-8 border-b last:border-b-0">
|
||||
<div className="hover:bg-grey-5 -mx-8 flex px-8 py-6">
|
||||
<div className="relative h-full w-full">
|
||||
<div className="inter-small-semibold text-grey-90 flex justify-between">
|
||||
<div className="flex">
|
||||
{
|
||||
!!icon && icon
|
||||
}
|
||||
{!!icon && icon}
|
||||
<span>{title}</span>
|
||||
</div>
|
||||
|
||||
{
|
||||
((!!relativeTimeElapsed || shouldShowStatus)) && (
|
||||
formattedDate ? (
|
||||
<Tooltip content={formattedDate}>
|
||||
{getTimeElement()}
|
||||
</Tooltip>
|
||||
) : (
|
||||
getTimeElement()
|
||||
)
|
||||
)
|
||||
}
|
||||
{(!!relativeTimeElapsed || shouldShowStatus) &&
|
||||
(formattedDate ? (
|
||||
<Tooltip content={formattedDate}>{getTimeElement()}</Tooltip>
|
||||
) : (
|
||||
getTimeElement()
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className={clsx(!!icon && "pl-8")}>
|
||||
{children}
|
||||
</div>
|
||||
<div className={clsx(!!icon && "pl-8")}>{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user