-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Dashboard UI #1002
Update Dashboard UI #1002
Changes from all commits
b9385e6
26fe4f9
c05e071
011b858
e36ba87
4440e1d
5ca9754
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
import React, { useRef, useState } from 'react'; | ||
import { array, string, bool } from 'prop-types'; | ||
import { angularize } from '../angular-react-helper'; | ||
import { View } from 'react-native'; | ||
import { useTheme, Card } from 'react-native-paper'; | ||
|
||
const MetricsDetails = ({ chartData}) => { | ||
|
||
const { colors } = useTheme(); | ||
const [ numVisibleDatasets, setNumVisibleDatasets ] = useState(1); | ||
|
||
const defaultPalette = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm guessing this was copied over from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to copy the contents of a file as a starting point for a new file, that's ok -- just make sure you remove the bits that aren't relevant. |
||
'#c95465', // red oklch(60% 0.15 14) | ||
'#4a71b1', // blue oklch(55% 0.11 260) | ||
'#d2824e', // orange oklch(68% 0.12 52) | ||
'#856b5d', // brown oklch(55% 0.04 50) | ||
'#59894f', // green oklch(58% 0.1 140) | ||
'#e0cc55', // yellow oklch(84% 0.14 100) | ||
'#b273ac', // purple oklch(64% 0.11 330) | ||
'#f09da6', // pink oklch(78% 0.1 12) | ||
'#b3aca8', // grey oklch(75% 0.01 55) | ||
'#80afad', // teal oklch(72% 0.05 192) | ||
] | ||
|
||
|
||
|
||
return ( | ||
<View> | ||
<div> | ||
25 | ||
miles | ||
</div> | ||
</View> | ||
) | ||
} | ||
|
||
MetricsDetails.propTypes = { | ||
chartData: array, | ||
}; | ||
|
||
angularize(MetricsDetails, 'MetricsDetails', 'emission.main.metricsdetails'); | ||
export default MetricsDetails; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
import React, { useState } from 'react'; | ||
import { array, } from 'prop-types'; | ||
import { angularize } from '../angular-react-helper'; | ||
import { Card, IconButton, Surface} from 'react-native-paper'; | ||
import BarChart from './BarChart'; | ||
import MetricsDetails from './MetricDetails'; | ||
import { StyleSheet } from 'react-native'; | ||
|
||
|
||
const MetricsCard = ({chartData, axisTitle}) => { | ||
|
||
const [state, setState] = useState({detailsView : false}) | ||
return ( | ||
<Card style={{width:"90%", alignSelf:"center", height:"280px" }}> | ||
<Surface style={{backgroundColor: 'rgba(0, 136, 206, 1)', height: "60px"}}> | ||
<Card.Title | ||
titleStyle={{textAlign:"center", color:"white", fontSize:"20px"}} | ||
title="My Distance" | ||
right={state.detailsView ? | ||
(()=><IconButton icon="chart-bar" mode="contained" onPress={()=> setState({detailsView : false})}/> | ||
): | ||
( | ||
()=> <IconButton icon="abacus" mode="contained" onPress={()=> setState({detailsView : true})}/> | ||
)} | ||
/> | ||
</Surface> | ||
|
||
{state.detailsView ? ( | ||
<> | ||
<Card.Content> | ||
<MetricsDetails chartData={chartData}/> | ||
</Card.Content> | ||
</> | ||
|
||
) : ( | ||
<> | ||
<Card.Content> | ||
<BarChart chartData={chartData} axisTitle={axisTitle} isHorizontal={true}/> | ||
</Card.Content> | ||
</> | ||
) | ||
} | ||
|
||
|
||
</Card> | ||
) | ||
} | ||
|
||
MetricsCard.propTypes = { | ||
chartData: array, | ||
}; | ||
|
||
angularize(MetricsCard, 'MetricsCard', 'emission.main.metricscard'); | ||
export default MetricsCard; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to avoid committing needless changes like this, where you add a space or adjust indentation
I know this was probably on accident - just make sure you check over the diff of what you're committing before you do so