Skip to content

Commit

Permalink
fix: removes welcome message and updates view details button (#8385)
Browse files Browse the repository at this point in the history
The welcome message doesn't provide much help, and the question mark was
confusing. This PR removes the message and changes the button to look
like a link.


![image](https://github.com/user-attachments/assets/f2039b7a-05c8-4353-8440-22786072d0db)
  • Loading branch information
thomasheartman authored Oct 8, 2024
1 parent b190efc commit 3f9278b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ test('Render personal dashboard for a long running project', async () => {
await screen.findByText('100'); // features
await screen.findByText('80%'); // health

await screen.findByText(
'We have gathered projects and flags you have favorited or owned',
);
await screen.findByText('Project health');
await screen.findByText('70%'); // avg health past window
await screen.findByText('someone created a flag');
Expand Down
52 changes: 30 additions & 22 deletions frontend/src/component/personalDashboard/PersonalDashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
import {
Button,
IconButton,
Link,
List,
Expand All @@ -20,7 +21,6 @@ import type {
} from '../../openapi';
import { FlagExposure } from 'component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FlagExposure';
import { usePersonalDashboardProjectDetails } from 'hooks/api/getters/usePersonalDashboard/usePersonalDashboardProjectDetails';
import HelpOutline from '@mui/icons-material/HelpOutline';
import useLoading from '../../hooks/useLoading';
import { MyProjects } from './MyProjects';
import {
Expand Down Expand Up @@ -166,6 +166,22 @@ const useDashboardState = (
setActiveProject,
};
};

const WelcomeSection = styled('div')(({ theme }) => ({
display: 'flex',
justifyContent: 'space-between',
gap: theme.spacing(1),
flexFlow: 'row wrap',
alignItems: 'baseline',
marginBottom: theme.spacing(2),
}));

const ViewKeyConceptsButton = styled(Button)(({ theme }) => ({
fontWeight: 'normal',
padding: 0,
margin: 0,
}));

export const PersonalDashboard = () => {
const { user } = useAuthUser();

Expand Down Expand Up @@ -206,30 +222,22 @@ export const PersonalDashboard = () => {

return (
<div>
<Typography component='h2' variant='h2'>
Welcome {name}
</Typography>
<ScreenExplanation>
<p data-loading>
{activeProjectStage === 'onboarded'
? 'We have gathered projects and flags you have favorited or owned'
: null}
{setupIncomplete
? 'Here are some tasks we think would be useful in order to get the most out of Unleash'
: null}
{activeProjectStage === 'loading'
? 'We have gathered projects and flags you have favorited or owned'
: null}
</p>
<IconButton
data-loading
<WelcomeSection>
<Typography component='h2' variant='h2'>
Welcome {name}
</Typography>

<ViewKeyConceptsButton
sx={{
fontWeight: 'normal',
}}
size={'small'}
title='Key concepts'
variant='text'
onClick={() => setWelcomeDialog('open')}
>
<HelpOutline />
</IconButton>
</ScreenExplanation>
View key concepts
</ViewKeyConceptsButton>
</WelcomeSection>

{noProjects && personalDashboard ? (
<ContentGridNoProjects
Expand Down

0 comments on commit 3f9278b

Please sign in to comment.