-
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.
- Loading branch information
Showing
12 changed files
with
284 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"trailingComma": "none", | ||
"semi": false, | ||
"singleQuote": true, | ||
"endOfLine":"auto", | ||
"tabWidth": 2 | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -1,20 +1,8 @@ | ||
import { StatusBar } from 'expo-status-bar'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
import React from 'react'; | ||
import TimerSection from './src/components/TimerSection'; | ||
|
||
export default function App() { | ||
return ( | ||
<View style={styles.container}> | ||
<Text>Open up App.tsx to start working on your app!</Text> | ||
<StatusBar style="auto" /> | ||
</View> | ||
<TimerSection /> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: '#fff', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
}); | ||
} |
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,42 @@ | ||
import React from 'react' | ||
import { Container, Typography, Tab } from './style' | ||
|
||
export enum TimerType { | ||
POMODORO = 'POMODORO', | ||
SHORT_BREAK = 'SHORT BREAK', | ||
LONG_BREAK = 'LONG BREAK' | ||
} | ||
|
||
// type Props = { | ||
// selectedTimerType: TimerType | ||
// setSelectedTimerType: (timerType: TimerType) => void | ||
// } | ||
|
||
// type TabProps = { | ||
// label: string | ||
// onSelect: () => void | ||
// } | ||
|
||
// const Tab = ({ label, onSelect }: TabProps) => { | ||
// return <Typography onPress={onSelect}>{label}</Typography> | ||
// } | ||
|
||
const TabBar = () => { | ||
const timerTypes = [ | ||
TimerType.POMODORO, | ||
TimerType.SHORT_BREAK, | ||
TimerType.LONG_BREAK | ||
] | ||
|
||
return ( | ||
<Container> | ||
{timerTypes.map((timerType: TimerType, index: number) => ( | ||
<Tab key={index} onPress={() => console.log(timerType)}> | ||
<Typography>{timerType}</Typography> | ||
</Tab> | ||
))} | ||
</Container> | ||
) | ||
} | ||
|
||
export default TabBar |
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,8 @@ | ||
import styled from 'styled-components/native' | ||
import { RectButton } from 'react-native-gesture-handler' | ||
|
||
export const Container = styled.View`` | ||
|
||
export const Typography = styled.Text`` | ||
|
||
export const Tab = styled(RectButton)`` |
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, { useState } from 'react' | ||
import { Container, Text } from './style' | ||
import TabBar, { TimerType } from './TabBar' | ||
|
||
const TimerSection = () => { | ||
const [selectedTimerType, setSelectedTimerType] = useState<TimerType>( | ||
TimerType.POMODORO | ||
) | ||
|
||
return ( | ||
<Container> | ||
{/* TabBar */} | ||
<TabBar | ||
selectedTimerType={selectedTimerType} | ||
setSelectedTimerType={setSelectedTimerType} | ||
/> | ||
{/* Timer */} | ||
{/* Actions */} | ||
<Text>Pomodoro</Text> | ||
</Container> | ||
) | ||
} | ||
|
||
export default TimerSection |
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,10 @@ | ||
import styled from "styled-components/native"; | ||
import theme from '../../../utils/theme'; | ||
|
||
export const Container = styled.View` | ||
background-color: ${theme.colors.primary}; | ||
padding: 10px; | ||
` | ||
|
||
export const Text = styled.Text` | ||
` |
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,9 @@ | ||
const theme = { | ||
colors: { | ||
primary: '#3D91EB', | ||
secondary: '#4B6989', | ||
white: '#FFF' | ||
} | ||
} | ||
|
||
export default theme; |
Oops, something went wrong.