-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from polijrorg/Progressive-Screens
Progressive screens
- Loading branch information
Showing
25 changed files
with
1,105 additions
and
120 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 React from 'react'; | ||
import * as S from './styles'; | ||
|
||
interface BreadcrumbProps { | ||
path: { name: string; path: string }[]; | ||
handleNavigation: (index: number) => void; | ||
} | ||
|
||
const Breadcrumb: React.FC<BreadcrumbProps> = ({ path, handleNavigation }) => { | ||
return ( | ||
<S.Container> | ||
{path.map((screen, index) => ( | ||
<S.ItemContainer key={index}> | ||
<S.Button onPress={() => handleNavigation(index)}> | ||
<S.Crumb>{screen.name}</S.Crumb> | ||
</S.Button> | ||
{index !== path.length - 1 && <S.Separator>{'>'}</S.Separator>} | ||
</S.ItemContainer> | ||
))} | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default Breadcrumb; |
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,38 @@ | ||
import { TouchableOpacity, View, Text } from 'react-native'; | ||
import styled from 'styled-components/native'; | ||
|
||
export const Container = styled(View)` | ||
width: 100%; | ||
height: auto; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 8px; | ||
`; | ||
|
||
export const Button = styled(TouchableOpacity)` | ||
width: 16px; | ||
height: 16px; | ||
padding: 0px; | ||
border-radius: 8px; | ||
background-color: #c1c8cd; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
export const ItemContainer = styled(View)` | ||
flex-direction: row; | ||
align-items: center; | ||
`; | ||
|
||
export const Crumb = styled(Text)` | ||
font-size: 10px; | ||
color: #333; | ||
`; | ||
|
||
export const Separator = styled(Text)` | ||
font-size: 16px; | ||
margin: 0 5px; | ||
color: #999; | ||
`; |
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
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
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
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
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,59 @@ | ||
import React, { useState } from 'react'; | ||
import * as S from './styles'; | ||
import { StyleSheet, Text } from 'react-native'; | ||
import Slider from '@react-native-community/slider'; | ||
|
||
interface askProps { | ||
textAsk: string; | ||
moduleId: string; | ||
onChangeValue: (moduleId: string, newValue: number) => void; | ||
initialValue?: number; // Propriedade para receber o valor inicial | ||
} | ||
|
||
const InputRange: React.FC<askProps> = ({ | ||
textAsk, | ||
moduleId, | ||
onChangeValue, | ||
initialValue = 1, // Atribui o valor 1 caso initialValue não seja fornecido | ||
}) => { | ||
const [value, setValue] = useState(initialValue); // Usa initialValue como valor inicial | ||
|
||
return ( | ||
<S.Container> | ||
<S.Title>{textAsk}</S.Title> | ||
<S.SliderContainer> | ||
<S.TextLimt>1</S.TextLimt> | ||
<Slider | ||
style={styles.slider} | ||
thumbImage={require('@assets/img/slider.png')} | ||
minimumValue={1} | ||
maximumValue={5} | ||
minimumTrackTintColor="#3E63DD" | ||
maximumTrackTintColor="#D9E2FC" | ||
thumbTintColor="#3E63DD" | ||
value={value} | ||
step={1} | ||
onValueChange={(newValue) => { | ||
setValue(newValue); | ||
onChangeValue(moduleId, newValue); | ||
}} | ||
/> | ||
<Text style={styles.sliderValue}> | ||
{value.toFixed(0).replace('.', ',')} | ||
</Text> | ||
</S.SliderContainer> | ||
</S.Container> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
slider: { | ||
minWidth: '80%', | ||
height: 40, | ||
}, | ||
sliderValue: { | ||
marginLeft: 10, | ||
}, | ||
}); | ||
|
||
export default InputRange; |
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,25 @@ | ||
import { View, Text } from 'react-native'; | ||
import styled from 'styled-components/native'; | ||
|
||
export const Title = styled(Text)` | ||
font-family: Poppins; | ||
color: black; | ||
`; | ||
export const Container = styled(View)` | ||
flex: 1; | ||
`; | ||
|
||
export const SliderContainer = styled(View)` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
padding: 4px 16px; | ||
align-items: center; | ||
gap: 8px; | ||
`; | ||
|
||
export const TextLimt = styled(Text)` | ||
font-family: Poppins; | ||
font-size: 12px; | ||
`; |
Oops, something went wrong.