Skip to content

Commit

Permalink
Revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
obgibson committed Jan 18, 2024
1 parent 09668f4 commit daaae82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/components/Form/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ type CheckboxFieldProps = {
label: string;
checked: boolean;
className?: string;
onChange: () => void;
onChange?: () => void;
disabled?: boolean;
'data-testid'?: string;
};

Expand All @@ -22,8 +23,11 @@ type CheckboxFieldProps = {
export const CheckboxField: React.FC<CheckboxFieldProps> = ({
label,
checked = false,
onChange,
onChange = () => {
/*empty*/
},
className,
disabled = false,
...rest
}) => {
const [id] = useState(uuid());
Expand All @@ -34,6 +38,7 @@ export const CheckboxField: React.FC<CheckboxFieldProps> = ({
data-testid={testid}
className={className}
onClick={() => onChange !== undefined && onChange()}
disabled={disabled}
>
<span className={`checkbox ${id}`}>{checked && <Icon name="check" />}</span>
<label htmlFor={id}>{label}</label>
Expand All @@ -45,12 +50,12 @@ export const CheckboxField: React.FC<CheckboxFieldProps> = ({
// Style
//

const CheckboxWrapper = styled.div<{ checked: boolean }>`
const CheckboxWrapper = styled.div<{ checked: boolean; disabled: boolean }>`
display: flex;
align-items: center;
width: auto;
position: relative;
cursor: pointer;
cursor: ${(p) => (p.disabled ? 'not-allowed' : 'pointer')};
label {
display: inline-block;
Expand Down
12 changes: 10 additions & 2 deletions src/components/Timeline/TaskListLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const TaskListLabel: React.FC<Props> = (props) => {
tasksTotal === tasksVisible ? tasksTotal : `${tasksVisible}/${tasksTotal}`
}`}
>
{props.item.step_name}
<StepNameWithCount>{props.item.step_name}</StepNameWithCount>
{!!tasksTotal && (
<>
{' '}
Expand Down Expand Up @@ -129,6 +129,7 @@ const RowLabel = styled.div<{ type: 'step' | 'task'; isOpen?: boolean; group?: b
font-weight: ${(p) => (p.type === 'step' ? '600' : 'normal')};
line-height: 1.6875rem;
border-left: ${(p) => p.theme.border.thinLight};
padding-left: ${(p) => (p.type === 'task' ? '0.5rem' : undefined)};
a {
display: flex;
Expand Down Expand Up @@ -158,6 +159,7 @@ const RowStepName = styled.span<{ bigName: boolean }>`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: flex;
`;

const RowDuration = styled.span`
Expand Down Expand Up @@ -210,10 +212,16 @@ const StepLabel = styled.div<{ isLoading: boolean }>`
}
svg path {
fill: ${(p) => (p.isLoading ? '#717171' : '#fff')};
fill: ${(p) => (p.isLoading ? '#717171' : undefined)};
}
`;

const Padding = styled.div`
width: 1.875rem;
`;

const StepNameWithCount = styled.span`
overflow: hidden;
text-overflow: ellipsis;
max-width: 100px;
`;

0 comments on commit daaae82

Please sign in to comment.