Skip to content

Commit

Permalink
feat: added welcome screen
Browse files Browse the repository at this point in the history
  • Loading branch information
burhanyilmaz committed Jan 8, 2024
1 parent e171a8e commit 894d1ba
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
semi: true,
singleQuote: true,
bracketSpacing: true,
printWidth: 1200,
printWidth: 100,
}
6 changes: 3 additions & 3 deletions src/components/core/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Text, TouchableOpacity } from 'react-native';

type Props = {
title: string;
onPress?: () => object;
onPress?: () => void;
};

const Button = ({ title, onPress }: Props) => (
<TouchableOpacity onPress={onPress} className="px-6 py-2.5 bg-teal-600 rounded-md">
<Text className={text({ type: 'headline', isCenter: true, class: 'text-white' })}>{title}</Text>
<TouchableOpacity onPress={onPress} className="px-6 py-4 bg-zinc-900 rounded-lg">
<Text className={text({ type: 'subtitle', isCenter: true, class: 'text-white' })}>{title}</Text>
</TouchableOpacity>
);

Expand Down
20 changes: 20 additions & 0 deletions src/components/core/Input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { TextInput } from 'react-native';

type Props = {
value?: string;
placeholder?: string;
containerClass?: string;
onPressClose?: () => void;
onChangeText: (value: string) => void;
};

const Input = ({ value, containerClass, placeholder, onChangeText }: Props) => (
<TextInput
value={value}
placeholder={placeholder}
onChangeText={onChangeText}
className={`border-[2px] rounded-lg h-[50px] border-zinc-700 text-zinc-600 px-4 pr-10 font-Medium bg-white ${containerClass}`}
/>
);

export default Input;
4 changes: 2 additions & 2 deletions src/navigators/MainNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import TestScreen from '@screens/Test';
import WelcomeScreen from '@screens/Welcome';

export type MainNavigatorParamList = {
Welcome: undefined;
Expand All @@ -11,7 +11,7 @@ const Stack = createNativeStackNavigator<MainNavigatorParamList>();
const MainNavigator = () => (
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="Welcome" component={TestScreen} />
<Stack.Screen name="Welcome" component={WelcomeScreen} />
</Stack.Navigator>
</NavigationContainer>
);
Expand Down
36 changes: 36 additions & 0 deletions src/screens/Welcome/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Button from '@components/core/Button';
import Input from '@components/core/Input';
import { text } from '@theme/text';
import { useState } from 'react';
import { Text, View } from 'react-native';

const WelcomeScreen = () => {
const [wordpressSite, setWordpressSiteUrl] = useState('https://blog.ted.com/');

return (
<View className="flex-1 items-center justify-center px-5 bg-white">
<View className="mb-10 items-center">
<View className="flex-row">
<Text className="text-zinc-700 text-[28px] font-Bold">Wo</Text>
<View className="bg-zinc-900 rounded-md">
<Text className="text-white text-[28px] font-Bold mx-2">Mob</Text>
</View>
</View>
<Text className={text({ type: 'subtitle', class: 'opacity-60 text-zinc-900 mt-1' })}>
Wordpress to Mobile App
</Text>
</View>
<View className="w-full">
<Input
value={wordpressSite}
containerClass="w-full mb-4"
onChangeText={setWordpressSiteUrl}
placeholder="Type your wordpress site link"
/>
<Button title="Convert Wordpress into Mobile" />
</View>
</View>
);
};

export default WelcomeScreen;

0 comments on commit 894d1ba

Please sign in to comment.