Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Commit

Permalink
Changes for style-rest
Browse files Browse the repository at this point in the history
  • Loading branch information
tylermcginnis committed Aug 30, 2017
1 parent 2c0d0b9 commit 93add38
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
3 changes: 2 additions & 1 deletion components/DateHeader.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react'
import { Text } from 'react-native'
import { purple } from '../utils/colors'

export default function DateHeader ({ date }) {
return (
<Text>
<Text style={{color: purple, fontSize: 25}}>
{date}
</Text>
)
Expand Down
16 changes: 12 additions & 4 deletions components/TextButton.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import React from 'react'
import { Text, TouchableOpacity } from 'react-native'
import { Text, TouchableOpacity, StyleSheet } from 'react-native'
import { purple } from '../utils/colors'

export default function TextButton ({ children, onPress }) {
export default function TextButton ({ children, onPress, style = {} }) {
return (
<TouchableOpacity onPress={onPress}>
<Text>{children}</Text>
<Text style={[styles.reset, style]}>{children}</Text>
</TouchableOpacity>
)
}
}

const styles = StyleSheet.create({
reset: {
textAlign: 'center',
color: purple,
}
})
25 changes: 20 additions & 5 deletions components/UdaciSlider.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
import React from 'react'
import { View, Slider, StyleSheet, Text } from 'react-native'

This comment has been minimized.

Copy link
@emrekgn

emrekgn Oct 23, 2020

instead of deprecated Slider, we can use this:

import Slider from '@react-native-community/slider'

This comment has been minimized.

Copy link
@OlushesiToheeb

OlushesiToheeb May 26, 2021

yea

This comment has been minimized.

Copy link
@muhdibee

muhdibee Nov 11, 2021

yeah ma nigga.

import { gray } from '../utils/colors'

export default function UdaciSlider ({ max, unit, step, value, onChange }) {
return (
<View>
<View style={styles.row}>
<Slider
style={{flex: 1}}
step={step}
value={value}
maximumValue={max}
minimumValue={0}
onValueChange={onChange}
/>
<View>
<Text>{value}</Text>
<Text>{unit}</Text>
<View style={styles.metricCounter}>
<Text style={{fontSize: 24, textAlign: 'center'}}>{value}</Text>
<Text style={{fontSize: 18, color: gray}}>{unit}</Text>
</View>
</View>
)
}
}

const styles = StyleSheet.create({
row: {
flexDirection: 'row',
flex: 1,
alignItems: 'center',
},
metricCounter: {
width: 85,
justifyContent: 'center',
alignItems: 'center'
},
})

0 comments on commit 93add38

Please sign in to comment.