Skip to content

Commit 34d5b92

Browse files
authored
Merge pull request #5 from oslabs-beta/topbarStyles
Search bar and topBar styles
2 parents 27322b6 + bd0bc2e commit 34d5b92

File tree

4 files changed

+81
-51
lines changed

4 files changed

+81
-51
lines changed

app/assets/search.svg

Lines changed: 1 addition & 0 deletions
Loading

app/components/Occupied.tsx

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
Button,
1212
Typography,
1313
} from '@material-ui/core';
14+
import { spacing } from '@material-ui/system';
15+
1416
import { Theme, makeStyles } from '@material-ui/core/styles';
1517
import { BaseCSSProperties } from '@material-ui/core/styles/withStyles';
1618

@@ -20,7 +22,7 @@ import AddCircleOutlineTwoToneIcon from '@material-ui/icons/AddCircleOutlineTwoT
2022
import DeleteForeverOutlinedIcon from '@material-ui/icons/DeleteForeverOutlined';
2123
import HighlightOffIcon from '@material-ui/icons/HighlightOff';
2224
import ListIcon from '@material-ui/icons/List';
23-
import SearchIcon from '@material-ui/icons/Search';
25+
import SearchIcon from '@material-ui/icons/SearchSharp';
2426
import DashboardIcon from '@material-ui/icons/Dashboard';
2527
import NotificationsIcon from '@material-ui/icons/Notifications';
2628
import Badge from '@material-ui/core/Badge';
@@ -30,6 +32,7 @@ import UpdateIcon from '@material-ui/icons/Update';
3032
import AddModal from '../modals/AddModal';
3133
import AddsModal from '../modals/AddsModal';
3234
import ServicesModal from '../modals/ServicesModal';
35+
import Search from '../components/icons/Search';
3336

3437
// STYLESHEETS
3538
// import '../stylesheets/Occupied.scss';
@@ -222,30 +225,35 @@ const Occupied = React.memo(() => {
222225
type="text"
223226
name="search"
224227
/>
228+
{/* <SearchIcon className="icon" id="searchIcon" /> */}
229+
{/* <img src="../assets/search.svg" /> */}
230+
<Search />
225231
<hr />
226232
</label>
227-
<button className="form" id="submitBtn" type="submit">
228-
<SearchIcon className="icon" id="searchIcon" />
229-
</button>
230233
</form>
231-
<div className="dashboardIconArea">
232-
<span className="dashboardTooltip">
233-
You have {applications.length} active databases
234-
</span>
235-
<DashboardIcon className="navIcon" id="dashboardIcon" />
236-
</div>
237-
{/* onClick={updateNotification} */}
238-
<div className="notificationsIconArea">
239-
<span className="notificationsTooltip">
240-
You have {notification ? notification.length : 0} new alerts
241-
</span>
242-
<NotificationsIcon className="navIcon" id="notificationsIcon" />
243-
<Badge badgeContent={notification ? notification.length : 0} color="secondary" />
234+
235+
<div className="dashboardIconWrapper">
236+
<div className="dashboardIconArea">
237+
<span className="dashboardTooltip">
238+
You have {applications.length} active databases
239+
</span>
240+
<DashboardIcon className="navIcon" id="dashboardIcon" />
241+
</div>
242+
{/* onClick={updateNotification} */}
243+
<div className="notificationsIconArea">
244+
<span className="notificationsTooltip">
245+
You have {notification ? notification.length : 0} new alerts
246+
</span>
247+
<NotificationsIcon className="navIcon" id="notificationsIcon" />
248+
<Badge badgeContent={notification ? notification.length : 0} color="secondary" />
249+
</div>
250+
<div className="personIconArea">
251+
<Button className="personTooltip" onClick={() => setAddsOpen(true)}>
252+
<PersonIcon className="navIcon" id="personIcon" />
253+
Logged In
254+
</Button>
255+
</div>
244256
</div>
245-
<Button className="personTooltip" onClick={() => setAddsOpen(true)}>
246-
Logged In
247-
<PersonIcon className="navIcon" id="personIcon" />
248-
</Button>
249257
</section>
250258
</header>
251259

app/components/icons/Search.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
export default function Search(props) {
4+
return (
5+
<svg class="searchIconSvg" focusable="false" viewBox="0 0 20 20" aria-hidden="true">
6+
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
7+
</svg>
8+
);
9+
}

app/stylesheets/Occupied.scss

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828

2929
#rightHeader {
3030
display: flex;
31-
justify-content: center;
31+
justify-content: space-between;
32+
width: 100%;
3233
align-items: center;
3334
margin: 0;
34-
margin-top: 20px;
35+
margin-top: 33px;
3536
}
3637

3738
#listIcon {
@@ -64,7 +65,7 @@
6465
vertical-align: middle;
6566
text-align: center;
6667
color: $icon;
67-
background-color: $background;
68+
// background-color: $background;
6869
box-sizing: content-box;
6970
border-radius: 50%;
7071
box-shadow: $boxshadow1;
@@ -102,7 +103,7 @@
102103
}
103104

104105
#searchIcon {
105-
background-color: $background;
106+
// background-color: $background;
106107
font-size: 26px;
107108
font-weight: 400px;
108109
padding: 8px;
@@ -118,6 +119,7 @@
118119

119120
// Dashboard Icon
120121
#dashboardIcon {
122+
margin-top: 4px;
121123
margin-left: -35px;
122124
font-size: 26px;
123125
padding: 8px;
@@ -146,12 +148,12 @@
146148
color: $ggreen;
147149
text-align: center;
148150
border-radius: 6px;
149-
padding: 5px 0;
151+
// padding: 5px 0;
150152
font-size: 12px;
151153
/* Position the tooltip */
152154
position: absolute;
153155
z-index: 1;
154-
top: 63px;
156+
top: 30px;
155157
right: -14px;
156158
}
157159

@@ -167,9 +169,10 @@
167169

168170
// Notification Icon
169171
#notificationsIcon {
172+
margin-top: 4px;
170173
margin-left: 2px;
171174
font-size: 26px;
172-
padding: 8px;
175+
// padding: 8px;
173176
&:hover {
174177
cursor: pointer;
175178
box-shadow: $boxshadow3;
@@ -216,10 +219,10 @@
216219

217220
// Person Icon
218221
#personIcon {
219-
margin-right: 30px;
222+
margin-top: 4px;
220223
margin-left: 2px;
221224
font-size: 26px;
222-
padding: 8px;
225+
// padding: 8px;
223226
&:hover {
224227
cursor: pointer;
225228
box-shadow: $boxshadow3;
@@ -239,29 +242,33 @@
239242
}
240243

241244
.personIconArea .personTooltip {
242-
visibility: hidden;
243-
width: 80px;
244-
background-color: $background;
245+
// visibility: hidden;
246+
// width: 80px;
247+
// background-color: $background;
245248
color: $gyellow;
246249
text-align: center;
247-
border-radius: 6px;
248-
padding: 5px 0;
249-
font-size: 12px;
250-
/* Position the tooltip */
251-
position: absolute;
252-
z-index: 1;
253-
top: 63px;
254-
right: 10px;
255-
}
256-
257-
.personIconArea .personTooltip::after {
258-
content: '';
259-
position: absolute;
260-
bottom: 37px;
261-
left: 35px;
262-
border-width: 5px;
263-
border-style: solid;
264-
border-color: transparent transparent $background transparent;
250+
// border-radius: 6px;
251+
// padding: 5px 0 !important;
252+
// font-size: 12px;
253+
// /* Position the tooltip */
254+
// position: absolute;
255+
// z-index: 1;
256+
// top: 63px;
257+
// right: 10px;
258+
}
259+
260+
// .personIconArea .personTooltip::after {
261+
// content: '';
262+
// position: absolute;
263+
// bottom: 37px;
264+
// left: 35px;
265+
// border-width: 5px;
266+
// border-style: solid;
267+
// border-color: transparent transparent $background transparent;
268+
// }
269+
270+
.dashboardIconWrapper {
271+
margin-right: 37px;
265272
}
266273

267274
button {
@@ -307,6 +314,11 @@ button {
307314
position: relative;
308315
display: flex;
309316
flex-direction: column;
317+
.searchIconSvg {
318+
transform: scale(0.1) translate(758.9px, -720px);
319+
position: absolute;
320+
fill: white;
321+
}
310322
}
311323

312324
#textInput {

0 commit comments

Comments
 (0)