Skip to content

Commit

Permalink
Merge pull request #61 from metrico/alexey-header-fixes
Browse files Browse the repository at this point in the history
Prevent header elements from interfering with each other
  • Loading branch information
jacovinus authored Mar 10, 2022
2 parents c2a9014 + c1b5d6c commit b8d4e64
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/components/StatusBar/StatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { DateRangePicker } from "../../plugins/daterangepicker";
import { DATE_TIME_RANGE } from '../../plugins/daterangepicker/consts';
import { findRangeByLabel } from "../../plugins/daterangepicker/utils";
import { UpdateStateFromQueryParams } from "../UpdateStateFromQueryParams";
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
import store from '../../store/store'
import loadLabels from "../../actions/LoadLabels";
import localUrl from "../../services/localUrl";
Expand Down Expand Up @@ -207,8 +208,8 @@ export function StatusBarSelectors() {
title={"Copy Link"}
onClick={shareLink}
>
<LinkIcon
fontSize={"small"}
<ContentCopyIcon
fontSize={"15px"}
/>

<span>{"Copy Link"}</span>
Expand Down
56 changes: 46 additions & 10 deletions src/plugins/daterangepicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import store from '../../store/store'
import loadLogs from "../../actions/loadLogs"
import { setLabelsBrowserOpen } from "../../actions/setLabelsBrowserOpen";
import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined';
import { Tooltip } from "@mui/material";
export function DateRangePickerMain(props) {
const today = Date.now();
const {
Expand Down Expand Up @@ -163,6 +164,8 @@ useEffect(()=>{
})
);
};
const mediaMatch = window.matchMedia('(min-width: 1200px)');
const [matches, setMatches] = useState(mediaMatch.matches);
const dateButtonStyles = {
border:'none',
height:'21px',
Expand All @@ -173,8 +176,7 @@ useEffect(()=>{
fontSize:'.85em',
display:'flex',
alignItems:'center',
marginLeft:'20px'

marginLeft:'20px',
}

const helpers = {
Expand All @@ -199,14 +201,47 @@ useEffect(()=>{
}
return (
<div>
<button style={dateButtonStyles}
onClick={openButtonHandler}
><AccessTimeOutlinedIcon
style={{
fontSize:'1.15em',
marginRight:'3px'
}} />
<Tooltip title={
timeLabel ? <React.Fragment>
<span style={{
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
padding: '3px',
}} >
<span style={{
textAlign: 'center'
}}>
{(isValid(dateRange.dateStart)
? format(dateRange.dateStart, "yyyy/MM/dd HH:mm:ss")
: dateRange.dateStart)}
</span>
<span style={{
textAlign: 'center'
}}>
to
</span>
<span style={{
textAlign: 'center'
}}>
{(isValid(dateRange.dateEnd)
? format(dateRange.dateEnd, "yyyy/MM/dd HH:mm:ss")
: typeof dateRange.dateEnd !== 'undefined' ?
dateRange.dateEnd : ''
)}
</span>

</span>
</React.Fragment> : undefined
}>
<button style={dateButtonStyles}
onClick={openButtonHandler} className={'date-time-selector'}
>

<AccessTimeOutlinedIcon />


<span>
{timeLabel ?
timeLabel :
(isValid(dateRange.dateStart)
Expand All @@ -219,8 +254,9 @@ useEffect(()=>{
dateRange.dateEnd : ''
)
}
</span>
</button>

</Tooltip>
{ isComponentVisible ? (
<div tabIndex={"0"} ref={ref}>
<ThemeProvider theme={theme}>
Expand Down
3 changes: 2 additions & 1 deletion src/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
@import "modules/log-view";
@import "modules/valuesList.scss";
@import "modules/query-bar.scss";
@import "modules/status-bar.scss";
@import "modules/status-bar.scss";
@import "modules/date-range-picker.scss";
22 changes: 22 additions & 0 deletions src/scss/modules/date-range-picker.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.date-time-selector {
svg {
font-size: 1.15em;
margin-right: 3px;
}
.tooltip {
background-color: red;
display: flex;
align-items: center;
justify-items: center;
}
}
@media screen and (max-width: 1200px) {
.date-time-selector {
svg {
margin-right: 0;
}
span {
display: none;
}
}
}
9 changes: 8 additions & 1 deletion src/scss/modules/status-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.label {
flex: 1;
color: #bfbfbf;

min-width: 51px;
padding: 6px 6px;
margin: 5px;
font-size: 0.7rem;
Expand Down Expand Up @@ -132,7 +132,14 @@
}

}
@media screen and (max-width: 950px) {
.url-copy {
span {
display: none;
}

}
}
.copied-warning {
transition:.2s all;
color:orange;
Expand Down

0 comments on commit b8d4e64

Please sign in to comment.