Skip to content

Commit

Permalink
#3698: Fix home page
Browse files Browse the repository at this point in the history
  • Loading branch information
asafkaganbezgin committed Aug 9, 2021
1 parent d0b94af commit 41ef5f1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 34 deletions.
9 changes: 6 additions & 3 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,10 @@ button.home-tile.btn {
font-weight: 900;
}

.home-tile:hover {
.home-tile-col:hover {
background: #dae3ee;
}
.home-tile:hover,
.home-tile:focus {
.home-tile-col:focus {
text-decoration: none;
}

Expand Down Expand Up @@ -1107,6 +1106,10 @@ header.searchPagination {
transform: translate(0, 150px);
}

.fade.in.modal {
opacity: 1;
}

@page {
margin: 0;
}
Expand Down
71 changes: 40 additions & 31 deletions client/src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Person, Report } from "models"
import { superUserTour, userTour } from "pages/HopscotchTour"
import PropTypes from "prop-types"
import React, { useContext, useState } from "react"
import { Button, Container, Form, Row } from "react-bootstrap"
import { Button, Col, Container, Form, Row } from "react-bootstrap"
import { connect } from "react-redux"
import { useHistory, useLocation } from "react-router-dom"
import { RECURSE_STRATEGY } from "searchUtils"
Expand Down Expand Up @@ -122,12 +122,13 @@ const HomeTiles = ({ currentUser, setSearchQuery, pageDispatchers }) => {
{queries
.filter(q => q.query !== null)
.map((query, index) => (
<HomeTile
key={index}
query={query}
setSearchQuery={setSearchQuery}
pageDispatchers={pageDispatchers}
/>
<Col key={index} className="home-tile-col">
<HomeTile
query={query}
setSearchQuery={setSearchQuery}
pageDispatchers={pageDispatchers}
/>
</Col>
))}
</Row>
</Container>
Expand Down Expand Up @@ -322,33 +323,41 @@ const SavedSearches = ({ setSearchQuery, pageDispatchers }) => {
return (
<>
<Messages error={stateError} />
<Form.Group controlId="savedSearchSelect">
<Form.Label>Select a saved search</Form.Label>
<Form.Control as="select" onChange={onSaveSearchSelect}>
{savedSearches &&
savedSearches.map(savedSearch => (
<option value={savedSearch.uuid} key={savedSearch.uuid}>
{savedSearch.name}
</option>
))}
</Form.Control>
<Form.Group as={Row} className="mb-3" controlId="savedSearchSelect">
<Form.Label column sm={2}>
<b>Select a saved search</b>
</Form.Label>
<Col sm={10}>
<Form.Control as="select" onChange={onSaveSearchSelect}>
{savedSearches &&
savedSearches.map(savedSearch => (
<option value={savedSearch.uuid} key={savedSearch.uuid}>
{savedSearch.name}
</option>
))}
</Form.Control>
</Col>
</Form.Group>

{selectedSearch && (
<div>
<div className="pull-right">
<Button style={{ marginRight: 12 }} onClick={showSearch}>
Show Search
</Button>
<ConfirmDestructive
onConfirm={onConfirmDelete}
objectType="search"
objectDisplay={selectedSearch.name}
variant="danger"
buttonLabel="Delete Search"
/>
</div>
<SavedSearchTable search={selectedSearch} />
<Row>
<Col sm={8}>
<SavedSearchTable search={selectedSearch} />
</Col>
<Col className="text-end">
<Button style={{ marginRight: 12 }} onClick={showSearch}>
Show Search
</Button>
<ConfirmDestructive
onConfirm={onConfirmDelete}
objectType="search"
objectDisplay={selectedSearch.name}
variant="danger"
buttonLabel="Delete Search"
/>
</Col>
</Row>
</div>
)}
</>
Expand Down Expand Up @@ -410,7 +419,7 @@ const Home = ({ setSearchQuery, pageDispatchers }) => {

return (
<div>
<div className="pull-right">
<div style={{ width: "inherit" }} className="float-end">
<GuidedTour
title="Take a guided tour of the home page."
tour={currentUser.isSuperUser() ? superUserTour : userTour}
Expand Down

0 comments on commit 41ef5f1

Please sign in to comment.