better folder structure; made usage of hermes engine explicit
This commit is contained in:
1
app.json
1
app.json
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"expo": {
|
"expo": {
|
||||||
|
"jsEngine": "hermes",
|
||||||
"name": "caldav",
|
"name": "caldav",
|
||||||
"slug": "caldav",
|
"slug": "caldav",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { View, Text, FlatList, TextInput } from "react-native";
|
import { View, Text, FlatList, TextInput } from "react-native";
|
||||||
import currentTheme from "./Themes";
|
import currentTheme from "../Themes";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import Header from "../components/Header";
|
||||||
|
|
||||||
// TODO: better shadows for everything
|
// TODO: better shadows for everything
|
||||||
|
// (maybe with extra library because of differences between android and ios)
|
||||||
|
// TODO: max width for messages
|
||||||
|
// TODO: create new messages
|
||||||
|
|
||||||
type BubbleSide = "left" | "right";
|
type BubbleSide = "left" | "right";
|
||||||
type ChatMessageProps = {
|
type ChatMessageProps = {
|
||||||
@@ -11,7 +15,7 @@ type ChatMessageProps = {
|
|||||||
height: number;
|
height: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type messageData = {
|
type MessageData = {
|
||||||
id: string;
|
id: string;
|
||||||
side: BubbleSide;
|
side: BubbleSide;
|
||||||
width: number;
|
width: number;
|
||||||
@@ -28,7 +32,7 @@ const getRandomInt = (min: number, max: number) => {
|
|||||||
const randomWidth = () => getRandomInt(100, 400);
|
const randomWidth = () => getRandomInt(100, 400);
|
||||||
const randomHeight = () => getRandomInt(50, 100);
|
const randomHeight = () => getRandomInt(50, 100);
|
||||||
|
|
||||||
const messages: messageData[] = [
|
const messages: MessageData[] = [
|
||||||
// {{{
|
// {{{
|
||||||
{
|
{
|
||||||
id: "1",
|
id: "1",
|
||||||
@@ -246,20 +250,6 @@ const Chat = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ChatHeader />
|
<ChatHeader />
|
||||||
<View
|
|
||||||
className="h-2 bg-black"
|
|
||||||
style={{
|
|
||||||
shadowColor: "#000",
|
|
||||||
shadowOffset: {
|
|
||||||
width: 0,
|
|
||||||
height: 5,
|
|
||||||
},
|
|
||||||
shadowOpacity: 0.34,
|
|
||||||
shadowRadius: 6.27,
|
|
||||||
|
|
||||||
elevation: 10,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<FlatList
|
<FlatList
|
||||||
inverted
|
inverted
|
||||||
data={messages}
|
data={messages}
|
||||||
@@ -280,12 +270,7 @@ const Chat = () => {
|
|||||||
|
|
||||||
const ChatHeader = () => {
|
const ChatHeader = () => {
|
||||||
return (
|
return (
|
||||||
<View
|
<Header>
|
||||||
className="flex flex-row items-center py-4"
|
|
||||||
style={{
|
|
||||||
backgroundColor: currentTheme.chatBot,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<View
|
<View
|
||||||
className="ml-3 w-12 h-12 rounded-3xl border border-solid"
|
className="ml-3 w-12 h-12 rounded-3xl border border-solid"
|
||||||
style={{
|
style={{
|
||||||
@@ -294,7 +279,21 @@ const ChatHeader = () => {
|
|||||||
}}
|
}}
|
||||||
></View>
|
></View>
|
||||||
<Text className="text-lg pl-3">CalChat</Text>
|
<Text className="text-lg pl-3">CalChat</Text>
|
||||||
</View>
|
<View
|
||||||
|
className="h-2 bg-black"
|
||||||
|
style={{
|
||||||
|
shadowColor: "#000",
|
||||||
|
shadowOffset: {
|
||||||
|
width: 0,
|
||||||
|
height: 5,
|
||||||
|
},
|
||||||
|
shadowOpacity: 0.34,
|
||||||
|
shadowRadius: 6.27,
|
||||||
|
|
||||||
|
elevation: 10,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Header>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
import "../global.css";
|
import "../../global.css";
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
return <Stack screenOptions={{ headerShown: false }} />;
|
return <Stack screenOptions={{ headerShown: false }} />;
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Chat from "./Chat";
|
import Chat from "./Chat";
|
||||||
|
import Calender from "./Calender";
|
||||||
|
|
||||||
export default function Index() {
|
export default function Index() {
|
||||||
return (
|
return (
|
||||||
<Chat />
|
// <Chat />
|
||||||
|
<Calender />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
38
src/components/Header.tsx
Normal file
38
src/components/Header.tsx
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import { View } from "react-native";
|
||||||
|
import currentTheme from "../Themes";
|
||||||
|
import { ReactNode } from "react";
|
||||||
|
|
||||||
|
type HeaderProps = {
|
||||||
|
children?: ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
const Header = (props: HeaderProps) => {
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
className="w-full h-32 flex flex-row items-center pt-10 pb-4"
|
||||||
|
style={{
|
||||||
|
backgroundColor: currentTheme.chatBot,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{props.children}
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
className="h-2 bg-black"
|
||||||
|
style={{
|
||||||
|
shadowColor: "#000",
|
||||||
|
shadowOffset: {
|
||||||
|
width: 0,
|
||||||
|
height: 5,
|
||||||
|
},
|
||||||
|
shadowOpacity: 0.34,
|
||||||
|
shadowRadius: 6.27,
|
||||||
|
|
||||||
|
elevation: 10,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Header;
|
||||||
Reference in New Issue
Block a user