mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: project mode tooltip (#3353)
This commit is contained in:
		
							parent
							
								
									4c6cdf562f
								
							
						
					
					
						commit
						9495df6705
					
				| @ -0,0 +1,38 @@ | |||||||
|  | import { Box, styled, Typography } from '@mui/material'; | ||||||
|  | import { HelpOutline } from '@mui/icons-material'; | ||||||
|  | import { HtmlTooltip } from '../../../common/HtmlTooltip/HtmlTooltip'; | ||||||
|  | import React, { FC } from 'react'; | ||||||
|  | 
 | ||||||
|  | const StyledTitle = styled(Typography)(({ theme }) => ({ | ||||||
|  |     fontWeight: theme.fontWeight.bold, | ||||||
|  |     display: ' inline', | ||||||
|  | })); | ||||||
|  | const StyledDescription = styled(Typography)(({ theme }) => ({ | ||||||
|  |     display: ' inline', | ||||||
|  |     color: theme.palette.text.secondary, | ||||||
|  | })); | ||||||
|  | 
 | ||||||
|  | export const CollaborationModeTooltip: FC = () => ( | ||||||
|  |     <HtmlTooltip | ||||||
|  |         title={ | ||||||
|  |             <> | ||||||
|  |                 <Box> | ||||||
|  |                     <StyledTitle>open: </StyledTitle> | ||||||
|  |                     <StyledDescription> | ||||||
|  |                         everyone can submit change requests | ||||||
|  |                     </StyledDescription> | ||||||
|  |                 </Box> | ||||||
|  |                 <Box sx={{ mt: 2 }}> | ||||||
|  |                     <StyledTitle>protected: </StyledTitle> | ||||||
|  |                     <StyledDescription> | ||||||
|  |                         only project members can submit change requests | ||||||
|  |                     </StyledDescription> | ||||||
|  |                 </Box> | ||||||
|  |             </> | ||||||
|  |         } | ||||||
|  |         arrow | ||||||
|  |         describeChild | ||||||
|  |     > | ||||||
|  |         <HelpOutline /> | ||||||
|  |     </HtmlTooltip> | ||||||
|  | ); | ||||||
| @ -13,6 +13,7 @@ export const StyledContainer = styled('div')(() => ({ | |||||||
| 
 | 
 | ||||||
| export const StyledDescription = styled('p')(({ theme }) => ({ | export const StyledDescription = styled('p')(({ theme }) => ({ | ||||||
|     marginBottom: theme.spacing(1), |     marginBottom: theme.spacing(1), | ||||||
|  |     marginRight: theme.spacing(1), | ||||||
| })); | })); | ||||||
| 
 | 
 | ||||||
| export const StyledInput = styled(Input)(({ theme }) => ({ | export const StyledInput = styled(Input)(({ theme }) => ({ | ||||||
|  | |||||||
| @ -14,6 +14,8 @@ import { StickinessSelect } from 'component/feature/StrategyTypes/FlexibleStrate | |||||||
| import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | ||||||
| import Select from 'component/common/select'; | import Select from 'component/common/select'; | ||||||
| import { DefaultStickiness, ProjectMode } from '../hooks/useProjectForm'; | import { DefaultStickiness, ProjectMode } from '../hooks/useProjectForm'; | ||||||
|  | import { Box } from '@mui/material'; | ||||||
|  | import { CollaborationModeTooltip } from './CollaborationModeTooltip'; | ||||||
| 
 | 
 | ||||||
| interface IProjectForm { | interface IProjectForm { | ||||||
|     projectId: string; |     projectId: string; | ||||||
| @ -138,14 +140,17 @@ const ProjectForm: React.FC<IProjectForm> = ({ | |||||||
|                     condition={Boolean(projectModeFlag)} |                     condition={Boolean(projectModeFlag)} | ||||||
|                     show={ |                     show={ | ||||||
|                         <> |                         <> | ||||||
|                             <StyledDescription> |                             <Box sx={{ display: 'flex' }}> | ||||||
|                                 What is your project mode? |                                 <StyledDescription> | ||||||
|                             </StyledDescription> |                                     What is your project collaboration mode? | ||||||
|  |                                 </StyledDescription> | ||||||
|  |                                 <CollaborationModeTooltip /> | ||||||
|  |                             </Box> | ||||||
|                             <Select |                             <Select | ||||||
|                                 id="project-mode" |                                 id="project-mode" | ||||||
|                                 value={projectMode} |                                 value={projectMode} | ||||||
|                                 label="Project mode" |                                 label="Project collaboration mode" | ||||||
|                                 name="Project mode" |                                 name="Project collaboration mode" | ||||||
|                                 onChange={e => { |                                 onChange={e => { | ||||||
|                                     setProjectMode?.( |                                     setProjectMode?.( | ||||||
|                                         e.target.value as ProjectMode |                                         e.target.value as ProjectMode | ||||||
| @ -155,7 +160,7 @@ const ProjectForm: React.FC<IProjectForm> = ({ | |||||||
|                                     { key: 'open', label: 'open' }, |                                     { key: 'open', label: 'open' }, | ||||||
|                                     { key: 'protected', label: 'protected' }, |                                     { key: 'protected', label: 'protected' }, | ||||||
|                                 ]} |                                 ]} | ||||||
|                                 style={{ minWidth: '150px' }} |                                 style={{ minWidth: '200px' }} | ||||||
|                             ></Select> |                             ></Select> | ||||||
|                         </> |                         </> | ||||||
|                     } |                     } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user