Updated layout (#450)
* Updated layout * Fixed error * Changed integration background to white
This commit is contained in:
1 parent
0339922db8
commit
40a268ab18
54 files changed
+441
-773
No files matched your search
@@ -0,0 +1,14 @@
|
||||
.integrations h1.MuiTypography-root,
|
||||
.integrations p.MuiTypography-root {
|
||||
color: var(--env-var-color-5);
|
||||
}
|
||||
.integrations h1.MuiTypography-root {
|
||||
font-size: var(--env-var-font-size-large);
|
||||
font-weight: 600;
|
||||
}
|
||||
.integrations p.MuiTypography-root {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
}
|
||||
.integrations button {
|
||||
height: var(--env-var-height-2);
|
||||
}
|
||||
@@ -1,60 +1,108 @@
|
||||
import { Box, Typography, useTheme } from '@mui/material';
|
||||
import IntegrationsComponent from '../../Components/Integrations';
|
||||
import PropTypes from "prop-types";
|
||||
import { Stack, Box, Typography, Grid } from "@mui/material";
|
||||
import Button from "../../Components/Button";
|
||||
import { useTheme } from "@emotion/react";
|
||||
|
||||
import "./index.css";
|
||||
|
||||
/**
|
||||
* Integrations component
|
||||
* @param {Object} props - Props for the IntegrationsComponent.
|
||||
* @param {string} props.url - The URL for the integration image.
|
||||
* @param {string} props.header - The header for the integration.
|
||||
* @param {string} props.info - Information about the integration.
|
||||
* @param {Function} props.onClick - The onClick handler for the integration button.
|
||||
* @returns {JSX.Element} The JSX representation of the IntegrationsComponent.
|
||||
*/
|
||||
const IntegrationsComponent = ({ url, header, info, onClick }) => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<Grid item lg={6} flexGrow={1}>
|
||||
<Stack
|
||||
direction="row"
|
||||
justifyContent="space-between"
|
||||
gap={theme.gap.large}
|
||||
p={theme.gap.large}
|
||||
border={1}
|
||||
borderColor={theme.palette.divider}
|
||||
borderRadius={`${theme.shape.borderRadius}px`}
|
||||
sx={{ backgroundColor: theme.palette.otherColors.white }}
|
||||
>
|
||||
<Box
|
||||
component="img"
|
||||
src={url}
|
||||
alt="Integration"
|
||||
width={80}
|
||||
height={80}
|
||||
/>
|
||||
<Stack gap={theme.gap.xs} flex={1}>
|
||||
<Typography component="h1">{header}</Typography>
|
||||
<Typography
|
||||
sx={{
|
||||
maxWidth: "300px",
|
||||
wordWrap: "break-word",
|
||||
}}
|
||||
>
|
||||
{info}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Button
|
||||
label="Add"
|
||||
level="primary"
|
||||
onClick={onClick}
|
||||
sx={{ alignSelf: "center" }}
|
||||
/>
|
||||
</Stack>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
|
||||
// PropTypes for IntegrationsComponent
|
||||
IntegrationsComponent.propTypes = {
|
||||
url: PropTypes.string.isRequired,
|
||||
header: PropTypes.string.isRequired,
|
||||
info: PropTypes.string.isRequired,
|
||||
onClick: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
/**
|
||||
* Integrations Page Component
|
||||
* @returns {JSX.Element} The JSX representation of the Integrations page.
|
||||
*/
|
||||
|
||||
const Integrations = () => {
|
||||
const theme = useTheme();
|
||||
|
||||
|
||||
const integrations = [
|
||||
{
|
||||
url: 'https://via.placeholder.com/100',
|
||||
header: 'Integration 1',
|
||||
info: 'Info about Integration 1',
|
||||
onClick: () => {}
|
||||
{
|
||||
url: "https://via.placeholder.com/80",
|
||||
header: "Slack",
|
||||
info: "Connect with Slack and see incidents in a channel",
|
||||
onClick: () => {},
|
||||
},
|
||||
{
|
||||
url: "https://via.placeholder.com/80",
|
||||
header: "Discord",
|
||||
info: "Connect with Discord and view incidents directly in a channel",
|
||||
onClick: () => {},
|
||||
},
|
||||
{
|
||||
url: "https://via.placeholder.com/80",
|
||||
header: "Zapier",
|
||||
info: "Send all incidents to Zapier, and then see them everywhere",
|
||||
onClick: () => {},
|
||||
},
|
||||
{
|
||||
url: 'https://via.placeholder.com/100',
|
||||
header: 'Integration 2',
|
||||
info: 'Info about Integration 2',
|
||||
onClick: () => {}
|
||||
},
|
||||
{
|
||||
url: 'https://via.placeholder.com/100',
|
||||
header: 'Integration 2',
|
||||
info: 'Info about Integration 2',
|
||||
onClick: () => {}
|
||||
}
|
||||
// Add more integrations as needed
|
||||
];
|
||||
|
||||
return (
|
||||
<Box
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
alignItems="flex-start"
|
||||
justifyContent="flex-start"
|
||||
height="100vh"
|
||||
p={theme.spacing(4)}
|
||||
mt={theme.spacing(8)}
|
||||
>
|
||||
<Typography variant="h4" component="h1" gutterBottom style={{ fontSize: '16px' }}>
|
||||
Integrations
|
||||
</Typography>
|
||||
<Typography variant="h6" component="h2" gutterBottom style={{ fontSize: '13px' }}>
|
||||
Connect Uptime Genie to your favorite service
|
||||
</Typography>
|
||||
<Box
|
||||
display="flex"
|
||||
flexWrap="wrap"
|
||||
gap={theme.spacing(4)}
|
||||
>
|
||||
<Stack className="integrations" gap={theme.gap.xs}>
|
||||
<Typography component="h1">Integrations</Typography>
|
||||
<Typography>Connect Uptime Genie to your favorite service</Typography>
|
||||
<Grid container spacing={theme.gap.large} mt={theme.gap.xs}>
|
||||
{integrations.map((integration, index) => (
|
||||
<IntegrationsComponent
|
||||
<IntegrationsComponent
|
||||
key={index}
|
||||
url={integration.url}
|
||||
header={integration.header}
|
||||
@@ -62,8 +110,8 @@ const Integrations = () => {
|
||||
onClick={integration.onClick}
|
||||
/>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
</Grid>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user