-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from metrico/jacovinus-mutiple-label-tooltip
theming init
- Loading branch information
Showing
15 changed files
with
483 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/components/LabelBrowser/components/HistoryButton/HistoryButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
|
||
import { Tooltip } from '@mui/material'; | ||
import { useEffect, useState } from 'react'; | ||
import { HistoryButtonStyled, HistoryIconStyled } from '../styled'; | ||
|
||
export default function HistoryButton({ queryLength, handleHistoryClick, isMobile }) { | ||
const [buttonState, setButtonState] = useState(false); | ||
|
||
useEffect(() => { | ||
if (queryLength > 0) { | ||
setButtonState(true); | ||
} else { | ||
setButtonState(false); | ||
} | ||
}, [queryLength]); | ||
|
||
return ( | ||
<Tooltip title={"Query History (" + queryLength + ")"}> | ||
<HistoryButtonStyled | ||
isMobile={isMobile} | ||
onClick={handleHistoryClick} | ||
> | ||
<HistoryIconStyled color={buttonState ? "orange" : "#ddd"} /> | ||
{isMobile && <span>History</span>} | ||
</HistoryButtonStyled> | ||
</Tooltip> | ||
); | ||
} |
24 changes: 24 additions & 0 deletions
24
src/components/LabelBrowser/components/ShowLabelsButton/ShowLabelsButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ShowLabelsBtn } from "../styled"; | ||
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; | ||
import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight"; | ||
|
||
|
||
|
||
export default function ShowLabelsButton({ onValueDisplay, labelsBrowserOpen, isMobile }) { | ||
const LOG_BROWSER = "Labels"; | ||
|
||
return ( | ||
<ShowLabelsBtn | ||
onClick={onValueDisplay} | ||
browserActive={labelsBrowserOpen} | ||
isMobile={isMobile} | ||
> | ||
{labelsBrowserOpen ? ( | ||
<KeyboardArrowDownIcon fontSize={"small"} /> | ||
) : ( | ||
<KeyboardArrowRightIcon fontSize={"small"} /> | ||
)}{" "} | ||
{LOG_BROWSER} | ||
</ShowLabelsBtn> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/components/LabelBrowser/components/ShowLogsButton/ShowLogsButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ShowLogsBtn } from "../styled"; | ||
|
||
export default function ShowLogsButton({ disabled, onClick, isMobile }) { | ||
const SHOW_LOGS = "Show Logs"; | ||
return ( | ||
<ShowLogsBtn | ||
disabled={disabled} | ||
type="submit" | ||
onClick={onClick} | ||
isMobile={isMobile} | ||
> | ||
{SHOW_LOGS} | ||
</ShowLogsBtn> | ||
); | ||
} |
Oops, something went wrong.