mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
Merge pull request #625 from GlancingMind/upstream-minor-bugfixes
Minor bugfixes
This commit is contained in:
commit
c71d26d513
@ -79,6 +79,10 @@ function BugTitleForm({ bug }: Props) {
|
||||
|
||||
function submitNewTitle() {
|
||||
if (!isFormValid()) return;
|
||||
if (bug.title === issueTitleInput.value) {
|
||||
cancelChange();
|
||||
return;
|
||||
}
|
||||
setTitle({
|
||||
variables: {
|
||||
input: {
|
||||
@ -107,7 +111,7 @@ function BugTitleForm({ bug }: Props) {
|
||||
|
||||
function editableBugTitle() {
|
||||
return (
|
||||
<form className={classes.headerTitle} onSubmit={submitNewTitle}>
|
||||
<form className={classes.headerTitle}>
|
||||
<BugTitleInput
|
||||
inputRef={(node) => {
|
||||
issueTitleInput = node;
|
||||
@ -124,7 +128,7 @@ function BugTitleForm({ bug }: Props) {
|
||||
className={classes.saveButton}
|
||||
size="small"
|
||||
variant="contained"
|
||||
type="submit"
|
||||
onClick={() => submitNewTitle()}
|
||||
disabled={issueTitle.length === 0}
|
||||
>
|
||||
Save
|
||||
|
@ -67,14 +67,14 @@ const DisabledTabWithTooltip = (props: TabProps) => {
|
||||
function Header() {
|
||||
const classes = useStyles();
|
||||
const location = useLocation();
|
||||
const [selectedTab, setTab] = React.useState(location.pathname);
|
||||
|
||||
const handleTabClick = (
|
||||
event: React.ChangeEvent<{}>,
|
||||
newTabValue: string
|
||||
) => {
|
||||
setTab(newTabValue);
|
||||
};
|
||||
// Prevents error of invalid tab selection in <Tabs>
|
||||
// Will return a valid tab path or false if path is unkown.
|
||||
function highlightTab() {
|
||||
const validTabs = ['/', '/code', '/pulls', '/settings'];
|
||||
const tab = validTabs.find((tabPath) => tabPath === location.pathname);
|
||||
return tab === undefined ? false : tab;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -92,12 +92,7 @@ function Header() {
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<div className={classes.offset} />
|
||||
<Tabs
|
||||
centered
|
||||
value={selectedTab}
|
||||
onChange={handleTabClick}
|
||||
aria-label="nav tabs"
|
||||
>
|
||||
<Tabs centered value={highlightTab()} aria-label="nav tabs">
|
||||
<DisabledTabWithTooltip label="Code" value="/code" {...a11yProps(1)} />
|
||||
<Tab label="Bugs" value="/" component={Link} to="/" {...a11yProps(2)} />
|
||||
<DisabledTabWithTooltip
|
||||
|
Loading…
Reference in New Issue
Block a user