Skip to content

Commit

Permalink
moved unit selector to above the graph #209
Browse files Browse the repository at this point in the history
  • Loading branch information
io53 committed Aug 13, 2024
1 parent af8698d commit 702fd2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/components/SensorTypePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function SensorTypePicker(props) {
variant: "shareSensorSelect",
style: { fontFamily: "mulish", fontSize: 15, fontWeight: 800, width: "250px", textAlign: "left" }
}
if (props.normalStyle) {
if (!props.altStyle) {
style = {
variant: "ddl",
className: "durationPicker",
Expand All @@ -36,7 +36,7 @@ export default function SensorTypePicker(props) {
rightIcon={<MdArrowDropDown size={26} className="buttonSideIcon" style={{ marginLeft: -10, marginRight: -8 }} />}
{...style}
borderRadius='4px'>
<Box pl={1} className={props.normalStyle ? "ddlItemAlt" : ""}>
<Box pl={1} className={props.altStyle ? "" : "ddlItemAlt"}>
{current}
</Box>
</MenuButton>
Expand Down
2 changes: 1 addition & 1 deletion src/states/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class Dashboard extends Component {
else SessionStore.setBackRoute("/")
const dropdowns = <>
<DashboardViewType value={this.state.cardType} onChange={this.setDashboardViewType.bind(this)} showResetOrder={this.getOrder() !== null} resetOrder={() => this.setState({ ...this.state, showResetOrderConfirmation: true })} />
<SensorTypePicker value={this.state.graphType} onChange={type => this.setGraphType(type)} normalStyle />
<SensorTypePicker value={this.state.graphType} onChange={type => this.setGraphType(type)} />
<DurationPicker value={this.state.from} onChange={v => this.updateFrom(v)} dashboard disabled={this.shouldDurationBeDisabled()} />
</>
const search = width => {
Expand Down
22 changes: 3 additions & 19 deletions src/states/SensorCompare.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ function SensorCompare(props) {
</Flex>
</>

const selectUnitTitle = <div style={{ marginTop: 8, paddingRight: 8, fontWeight: 800, fontFamily: "mulish" }}>{i18next.t("unit")}</div>
const selectUnit = <>
<SensorTypePicker value={dataKey} onChange={v => setDataKey(v)} />
</>
Expand Down Expand Up @@ -149,14 +148,6 @@ function SensorCompare(props) {
{selectSensor}
</td>
</tr>
<tr>
<td valign="top">
{selectUnitTitle}
</td>
<td>
{selectUnit}
</td>
</tr>
<tr>
<td valign="top">
</td>
Expand All @@ -176,15 +167,6 @@ function SensorCompare(props) {
{selectSensor}
</Box>
</Box>

<Box display="block" mb={4}>
<Box p={2}>
{selectUnitTitle}
</Box>
<Box flex={1} ml={{ md: 2, base: 1 }}>
{selectUnit}
</Box>
</Box>
<Box ml={{ md: 2, base: 1 }}>
{loadButton}
</Box>
Expand All @@ -205,10 +187,11 @@ function SensorCompare(props) {

</td>
<td>
<Flex justify="end" gap={"6px"}>
<Flex justify="end" flexWrap="wrap" gap={"6px"}>
{(viewData && !loading) && <>
{graphCtrl()}
</>}
{selectUnit}
{durationPicker}
</Flex>
</td>
Expand All @@ -230,6 +213,7 @@ function SensorCompare(props) {
{(viewData && !loading) && <>
{graphCtrl(true)}
</>}
{selectUnit}
{durationPicker}
</Flex>
</td>
Expand Down

0 comments on commit 702fd2e

Please sign in to comment.