-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…te-onboarding-block #3007 Onboarding Block Component
- Loading branch information
Showing
5 changed files
with
82 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Box, Grid, Typography, useTheme } from '@mui/material'; | ||
import EditIcon from '@mui/icons-material/Edit'; | ||
import { Organization } from 'shared'; | ||
|
||
interface OnboardingBlockProps { | ||
organization: Organization; | ||
isAdmin?: boolean; | ||
} | ||
|
||
const OnboardingBlock: React.FC<OnboardingBlockProps> = ({ organization, isAdmin }) => { | ||
const theme = useTheme(); | ||
const handleEdit = () => { | ||
console.log('clicked'); | ||
}; | ||
|
||
return ( | ||
<Grid item> | ||
<Box | ||
sx={{ | ||
height: '25vh', | ||
borderRadius: '10px', | ||
width: '100%', | ||
background: theme.palette.background.paper | ||
}} | ||
> | ||
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}> | ||
<Typography variant="h5" ml={2} pt={2}> | ||
Onboarding | ||
</Typography> | ||
{isAdmin && <EditIcon sx={{ marginRight: '15px', marginTop: '20px' }} onClick={handleEdit}></EditIcon>} | ||
</Box> | ||
<Typography sx={{ mt: 1, mb: -1, ml: 2, fontSize: { xs: 16, sm: 16, md: 18 }, marginRight: '15px' }}> | ||
{organization.onboardingText} | ||
</Typography> | ||
</Box> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default OnboardingBlock; |
30 changes: 18 additions & 12 deletions
30
src/frontend/src/pages/AdminToolsPage/OnboardingConfig/OnboardingInfoSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { Grid, Typography, ListItem, List, useTheme, Button } from '@mui/material'; | ||
import { Box } from '@mui/system'; | ||
import { useAllUsefulLinks } from '../../../hooks/projects.hooks'; | ||
import LoadingIndicator from '../../../components/LoadingIndicator'; | ||
import { useCurrentOrganization } from '../../../hooks/organizations.hooks'; | ||
import ErrorPage from '../../ErrorPage'; | ||
import LoadingIndicator from '../../../components/LoadingIndicator'; | ||
import OnboardingBlock from '../../../components/OnboardingBlock'; | ||
import { useAllUsefulLinks } from '../../../hooks/projects.hooks'; | ||
|
||
const OnboardingInfoSection: React.FC = () => { | ||
const theme = useTheme(); | ||
|
@@ -11,32 +13,26 @@ const OnboardingInfoSection: React.FC = () => { | |
'Chief Mechanical Engineer - Max Boone [email protected]', | ||
'Chief Software Engineer - Peyton Mckee [email protected]' | ||
]; | ||
const { | ||
data: organization, | ||
isLoading: organizationIsLoading, | ||
isError: organizationIsError, | ||
error: organizationError | ||
} = useCurrentOrganization(); | ||
|
||
const { data: links, isError: linksIsError, error: linksError, isLoading: linksIsLoading } = useAllUsefulLinks(); | ||
|
||
if (!links || linksIsLoading) return <LoadingIndicator />; | ||
if (organizationIsError) { | ||
return <ErrorPage message={organizationError.message} />; | ||
} | ||
|
||
if (linksIsError) return <ErrorPage message={linksError?.message} />; | ||
|
||
if (!organization || organizationIsLoading || !links || linksIsLoading) return <LoadingIndicator />; | ||
|
||
return ( | ||
<Grid container item sx={{ display: 'flex', flexDirection: 'column', gap: 2.5 }}> | ||
<Grid item> | ||
<Box | ||
sx={{ | ||
height: '25vh', | ||
borderRadius: '10px', | ||
width: '100%', | ||
background: theme.palette.background.paper | ||
}} | ||
> | ||
<Typography variant="h5" ml={2} pt={2}> | ||
Onboarding | ||
</Typography> | ||
<Typography sx={{ mt: 1, mb: -1, ml: 2 }}> | ||
Thank you for applying to Northeastern Electric Racing! After reviewing your application, we are very excited to | ||
officially welcome you to our team. | ||
</Typography> | ||
</Box> | ||
</Grid> | ||
<OnboardingBlock organization={organization} /> | ||
<Grid item> | ||
<Box | ||
sx={{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters