8000 resolved latest comments · mozilla/perfcompare@9ddd150 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9ddd150

Browse files
committed
resolved latest comments
1 parent 6bff0f3 commit 9ddd150

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/components/CompareResults/EditTitleInput.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import FormControl from '@mui/material/FormControl';
66
import TextField from '@mui/material/TextField';
77

88
interface EditTitleInputProps {
9-
compact: boolean;
109
value: string;
1110
refInput: React.RefObject<HTMLInputElement>;
1211
onCancel: () => unknown;
@@ -15,14 +14,12 @@ interface EditTitleInputProps {
1514
}
1615

1716
function EditTitleInput({
18-
compact,
1917
value,
2018
refInput,
2119
onChange,
2220
onSave,
2321
onCancel,
2422
}: EditTitleInputProps) {
25-
const size = compact ? 'small' : undefined;
2623
const inputPlaceholder = 'Write a title for this comparison';
2724
const [titleError, setTitleError] = useState(false);
2825
const titleErrorMsg = 'Title cannot be empty';
@@ -41,12 +38,11 @@ function EditTitleInput({
4138
}, [onCancel]);
4239

4340
const onSaveSubmit = (e: React.FormEvent) => {
41+
e.preventDefault();
4442
if (!value.trim()) {
45-
e.preventDefault();
4643
setTitleError(true);
4744
return;
4845
}
49-
e.preventDefault();
5046
onSave();
5147
};
5248

@@ -74,7 +70,7 @@ function EditTitleInput({
7470
setTitleError(false);
7571
onChange(e.target.value);
7672
}}
77-
size={size}
73+
size='small'
7874
className='edit-results-title-text-field'
7975
error={titleError}
8076
value={value}

src/components/CompareResults/ResultsMain.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function ResultsMain() {
102102
const [comparisonTitleName, setComparisonTitleName] = useState(
103103
initialComparisonTitle,
104104
);
105-
const previousComparisonTitleRef = useRef('Results');
105+
const previousComparisonTitleRef = useRef(initialComparisonTitle);
106106
const editTitleInputRef = useRef<HTMLInputElement>(null);
107107
const [editComparisonTitleInputVisible, showEditComparisonTitleInput] =
108108
useState(false);
@@ -148,7 +148,6 @@ function ResultsMain() {
148148
{editComparisonTitleInputVisible ? (
149149
<EditTitleInput
150150
refInput={editTitleInputRef}
151-
compact={true}
152151
onChange={onComparisonTitleChange}
153152
onSave={onSaveButtonClick}
154153
onCancel={onCancelButtonClick}

0 commit comments

Comments
 (0)
0