Skip to content

Commit

Permalink
feat(onboarding): improve styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Oct 1, 2024
1 parent 2d8bc32 commit e9fbb25
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 19 deletions.
11 changes: 8 additions & 3 deletions frontend/src/component/onboarding/flow/ProjectOnboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Container = styled('div')(({ theme }) => ({
}));

const TitleBox = styled('div')(({ theme }) => ({
padding: theme.spacing(2, 7, 2, 7),
padding: theme.spacing(2, 2.5, 2, 5),
borderBottom: '1px solid',
borderColor: theme.palette.divider,
minHeight: '80px',
Expand All @@ -38,11 +38,16 @@ const TitleBox = styled('div')(({ theme }) => ({
const Actions = styled('div')(({ theme }) => ({
display: 'flex',
flexGrow: 1,
gap: theme.spacing(7),
padding: theme.spacing(3, 5),
[theme.breakpoints.down('md')]: {
flexDirection: 'column',
gap: theme.spacing(7),
},
}));

const ActionBox = styled('div')(({ theme }) => ({
flexBasis: '50%',
padding: theme.spacing(3, 2, 6, 8),
display: 'flex',
gap: theme.spacing(3),
flexDirection: 'column',
Expand Down Expand Up @@ -111,7 +116,7 @@ export const ProjectOnboarding = ({
};

return (
<Container>
<Container data-testid='container'>
<TitleBox>
<TitleRow>
<Typography fontWeight='bold'>
Expand Down
54 changes: 38 additions & 16 deletions frontend/src/component/onboarding/flow/SdkExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { type SelectChangeEvent, styled, Typography } from '@mui/material';
import {
Box,
Button,
type SelectChangeEvent,
styled,
Typography,
} from '@mui/material';
import { Link } from 'react-router-dom';
import { useLocalStorageState } from 'hooks/useLocalStorageState';
import Select from 'component/common/select';
Expand All @@ -13,11 +19,17 @@ const TitleContainer = styled('div')(({ theme }) => ({
fontWeight: 'bold',
}));

const StyledLink = styled(Link)({
const StyledButton = styled(Button<typeof Link>)({
fontWeight: 'bold',
textDecoration: 'none',
});

const SelectWithButton = styled(Box)(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
gap: theme.spacing(1),
}));

const repositoryUrl =
'https://github.com/Unleash/unleash-sdk-examples/tree/main';

Expand Down Expand Up @@ -56,21 +68,31 @@ export const SdkExample = () => {
<>
<TitleContainer>View SDK Example</TitleContainer>
<Typography>
Choose your preferred SDK to view an example
Choose your preferred SDK to view an example.
</Typography>
<Select
id='sdk-select'
name='sdk'
options={sdkOptions}
value={selectedSdk}
onChange={onChange}
style={{
width: '60%',
}}
/>
<StyledLink to={`${repositoryUrl}/${selectedSdk}`} target='_blank'>
Go to example
</StyledLink>
<SelectWithButton>
<Select
id='sdk-select'
name='sdk'
options={sdkOptions}
value={selectedSdk}
onChange={onChange}
style={{
width: '60%',
}}
/>
<Box>
<StyledButton
to={`${repositoryUrl}/${selectedSdk}`}
target='_blank'
component={Link}
variant='text'
color='primary'
>
Go to example
</StyledButton>
</Box>
</SelectWithButton>
</>
);
};

0 comments on commit e9fbb25

Please sign in to comment.