mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
fix: add edit project icon in header
This commit is contained in:
parent
10fa0fd908
commit
cdf54667c5
@ -16,7 +16,6 @@ const BreadcrumbNav = () => {
|
|||||||
item =>
|
item =>
|
||||||
item !== 'create' &&
|
item !== 'create' &&
|
||||||
item !== 'edit' &&
|
item !== 'edit' &&
|
||||||
item !== 'access' &&
|
|
||||||
item !== 'view' &&
|
item !== 'view' &&
|
||||||
item !== 'variants' &&
|
item !== 'variants' &&
|
||||||
item !== 'logs' &&
|
item !== 'logs' &&
|
||||||
|
@ -6,7 +6,8 @@ import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig';
|
|||||||
import ApiError from '../../common/ApiError/ApiError';
|
import ApiError from '../../common/ApiError/ApiError';
|
||||||
import ConditionallyRender from '../../common/ConditionallyRender';
|
import ConditionallyRender from '../../common/ConditionallyRender';
|
||||||
import { useStyles } from './Project.styles';
|
import { useStyles } from './Project.styles';
|
||||||
import { Tab, Tabs } from '@material-ui/core';
|
import { IconButton, Tab, Tabs } from '@material-ui/core';
|
||||||
|
import { Edit } from '@material-ui/icons';
|
||||||
import useToast from '../../../hooks/useToast';
|
import useToast from '../../../hooks/useToast';
|
||||||
import useQueryParams from '../../../hooks/useQueryParams';
|
import useQueryParams from '../../../hooks/useQueryParams';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
@ -59,6 +60,15 @@ const Project = () => {
|
|||||||
/* eslint-disable-next-line */
|
/* eslint-disable-next-line */
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const goToTabWithName = (name: string) => {
|
||||||
|
const index = tabData.findIndex(t => t.name === name);
|
||||||
|
if(index >= 0) {
|
||||||
|
const tab = tabData[index];
|
||||||
|
history.push(tab.path);
|
||||||
|
setActiveTab(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const tabData = [
|
const tabData = [
|
||||||
{
|
{
|
||||||
title: 'Overview',
|
title: 'Overview',
|
||||||
@ -127,8 +137,11 @@ const Project = () => {
|
|||||||
<div ref={ref}>
|
<div ref={ref}>
|
||||||
<div className={styles.header}>
|
<div className={styles.header}>
|
||||||
<div className={styles.innerContainer}>
|
<div className={styles.innerContainer}>
|
||||||
<h2 data-loading className={commonStyles.title}>
|
<h2 data-loading className={commonStyles.title} style={{margin: 0}}>
|
||||||
Project: {project?.name}{' '}
|
Project: {project?.name}{' '}
|
||||||
|
<IconButton onClick={() => goToTabWithName('settings')}>
|
||||||
|
<Edit />
|
||||||
|
</IconButton>
|
||||||
</h2>
|
</h2>
|
||||||
<p>{project?.description}</p>
|
<p>{project?.description}</p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user