Skip to content

Commit 41f1986

Browse files
committed
Fix tablet/mobile view and add a custom scroll bar
1 parent 55120a8 commit 41f1986

File tree

4 files changed

+54
-10
lines changed

4 files changed

+54
-10
lines changed

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"prettier.tabWidth": 2,
3+
"editor.tabSize": 2
4+
}

client/src/components/EmployerProfile/EmployerProfile.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import React from 'react';
22
import firebase from '../../firebase/firebase';
3-
import { ModalContainer, ModalMain } from '../../styles/ModalGlobalStyle';
3+
import { ModalContainer } from '../../styles/ModalGlobalStyle';
44
import profile from '../../images/avatar-icon.jpg';
5-
import { Info, Styling, ProfilePic, InfoContainer } from './EmployerStyles';
5+
import {
6+
Info,
7+
Styling,
8+
ProfilePic,
9+
InfoContainer,
10+
EmployerModalMain,
11+
} from './EmployerStyles';
612
import axios from 'axios';
713
import EmployerPostings from './EmployerPostings';
814
import FavHeart from '../../images/favorites-icon.png';
@@ -131,10 +137,7 @@ class EmployerProfile extends React.Component {
131137
return (
132138
<>
133139
<ModalContainer data-type="modal-container">
134-
<ModalMain
135-
style={{ maxWidth: '750px', borderRadius: '20px' }}
136-
className="modal"
137-
>
140+
<EmployerModalMain className="modal">
138141
{this.state.loading ? (
139142
<LoadingModal />
140143
) : (
@@ -166,7 +169,7 @@ class EmployerProfile extends React.Component {
166169
/>
167170
</Styling>
168171
)}
169-
</ModalMain>
172+
</EmployerModalMain>
170173
</ModalContainer>
171174
</>
172175
);

client/src/components/EmployerProfile/EmployerStyles.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import styled from 'styled-components';
22

3+
import { ModalMain } from '../../styles/ModalGlobalStyle';
4+
5+
export const EmployerModalMain = styled(ModalMain)`
6+
max-width: 750px;
7+
overflow-y: auto;
8+
9+
@media (max-width: 801px) {
10+
height: 98%;
11+
}
12+
`;
13+
314
export const Info = styled.div`
415
display: flex;
516
flex-direction: column;
@@ -24,11 +35,11 @@ export const Styling = styled.div`
2435
display: flex;
2536
padding: 5%;
2637
justify-content: space-between;
27-
max-width: 750px;
2838
width: 100%;
29-
@media (max-width: 650px) {
39+
@media (max-width: 801px) {
3040
flex-wrap: wrap;
31-
padding-top: 500px;
41+
flex-direction: column;
42+
align-items: center;
3243
}
3344
`;
3445

@@ -77,4 +88,8 @@ export const Job = styled.div`
7788
text-decoration: none;
7889
color: rgba(109, 7, 26, 0.95);
7990
}
91+
92+
@media (max-width: 801px) {
93+
max-width: none;
94+
}
8095
`;

client/src/styles/ModalGlobalStyle.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,26 @@ export const ModalMain = styled.div`
2727
@media (max-width: 661px) {
2828
width: 90%;
2929
}
30+
31+
/* width */
32+
::-webkit-scrollbar {
33+
width: 10px;
34+
}
35+
36+
/* Track */
37+
::-webkit-scrollbar-track {
38+
margin: 2% 0;
39+
}
40+
41+
/* Handle */
42+
::-webkit-scrollbar-thumb {
43+
background: #888;
44+
border-radius: 10px;
45+
height: 50px;
46+
}
47+
48+
/* Handle on hover */
49+
::-webkit-scrollbar-thumb:hover {
50+
background: #555;
51+
}
3052
`;

0 commit comments

Comments
 (0)