Skip to content

Commit 9cb36c4

Browse files
add styling to TypesPage
1 parent 3da194a commit 9cb36c4

File tree

1 file changed

+54
-36
lines changed

1 file changed

+54
-36
lines changed

client/src/pages/TypesPage.js

Lines changed: 54 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,71 @@
1-
import { Box, Container } from '@mui/material';
1+
import { Box, Container, Typography } from '@mui/material';
22
import { NavLink } from 'react-router-dom';
33

44
export default function TypesPage() {
55
const types = ['Movies', 'Shorts', 'TV Series'];
66

7-
// flexFormat provides the formatting options for a "flexbox" layout that enables the album cards to be displayed
8-
// side-by-side and wrap to the next line when the screen is too narrow.
9-
// Flexboxes are incredibly powerful. You can learn more on MDN web docs linked below (or many other online
10-
// resources).
11-
// https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox
12-
// const flexFormat = { display: 'flex', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-evenly', height: '15vh'};
13-
147
const flexFormat = {
158
display: 'flex',
16-
flexDirection: 'row',
17-
flexWrap: 'wrap',
18-
justifyContent: 'space-evenly',
19-
// justifyContent: 'center',
9+
flexDirection: 'column', // Change to column to place subtitle and boxes vertically
2010
alignItems: 'center',
21-
minHeight: '100vh', // Use minHeight to center vertically
11+
minHeight: '90vh', // Adjust height to move content up
12+
justifyContent: 'flex-start', // Move content to the start of the container
13+
paddingTop: '150px', // Add some padding at the top
14+
};
15+
16+
const boxContainerStyle = {
17+
display: 'flex',
18+
justifyContent: 'space-evenly',
19+
width: '100%',
20+
};
21+
22+
const boxStyle = {
23+
background: 'grey', // Set the background color to grey
24+
borderRadius: '16px',
25+
border: '2px solid grey', // Set the border color to grey
26+
color: 'white', // Set the text color to white
27+
textAlign: 'center', // Center the text
28+
fontSize: '22px',
29+
margin: '20px', // Increase the spacing between boxes
30+
padding: '20px', // Add padding to make the boxes larger
31+
transition: 'transform 0.2s', // Add transition for hover effect
32+
};
33+
34+
const boxHoverStyle = {
35+
transform: 'scale(1.1)', // Increase the size slightly on hover
36+
};
37+
38+
const subtitleStyle = {
39+
marginBottom: '20px', // Adjust the spacing between subtitle and boxes
40+
textAlign: 'center',
41+
fontSize: '24px', // Add styling to the subtitle
42+
fontWeight: 'bold',
2243
};
2344

2445
return (
2546
<Container style={flexFormat}>
26-
{types.map((type) =>
27-
<Box
28-
key={type}
29-
p={3}
30-
m={2}
31-
// style={{ background: 'black', borderRadius: '16px', border: '2px solid #000' }}
32-
style={{
33-
background: 'black',
34-
borderRadius: '16px',
35-
border: '2px solid #000',
36-
color: 'red', // Set the text color to red
37-
textAlign: 'center', // Center the text
38-
fontSize: '22px',
39-
}}
40-
>
41-
{/* <h4><NavLink to={`/search_productions/${type}`}>{type}</NavLink></h4> */}
42-
<h4>
43-
<NavLink to={`/search_productions/${type}`} style={{ color: 'red' }}>
47+
<Typography variant="h6" style={subtitleStyle}>
48+
Choose a Production Type to Search For
49+
</Typography>
50+
<Container style={boxContainerStyle}>
51+
{types.map((type) =>
52+
<Box
53+
key={type}
54+
p={3}
55+
m={2}
56+
style={boxStyle}
57+
sx={{
58+
'&:hover': boxHoverStyle, // Apply hover effect
59+
}}
60+
>
61+
<h4>
62+
<NavLink to={`/search_productions/${type}`} style={{ color: 'white' }}>
4463
{type}
4564
</NavLink>
46-
</h4>
47-
</Box>
48-
)}
65+
</h4>
66+
</Box>
67+
)}
68+
</Container>
4969
</Container>
5070
);
51-
52-
5371
};

0 commit comments

Comments
 (0)