import React, { useEffect, useState } from "react"; import { Text, View, Button, TouchableOpacity, Image, ImageBackground } from "react-native"; import styled from "styled-components/native"; import getRandomPoint from "../helpers/getRandomPoint"; import { noColor } from "../helpers/config"; const Home = () => { const [point, setPoint] = useState({ meridian: "Meridian", pointNumber: "Point", colorHex: noColor }); // const [isReady, setIsReady] = useState(false); function handleTouch() { let newPoint = getRandomPoint(); setPoint(newPoint); } // Views style const TitleView = styled.View` flex: 2; flex-direction: row; align-content: center; align-items: center; justify-content: space-around; margin-right: 15; margin-left: 5; `; const LogoView = styled.View` flex: 0.8; margin-right: 15; `; const TitleTextView = styled.View` flex: 3; `; const PointView = styled.View` flex: 2; flex-direction: row; align-content: center; align-items: center; justify-content: space-around; background-color: ${point.colorHex}; `; const ButtonView = styled.View` flex: 2; flex-direction: column; align-content: center; align-items: center; justify-content: center; `; // Texts style const TitleText = styled.Text` color: black; font-size: 20; font-weight: 500; text-transform: uppercase; /* // font-family: "futura-std-medium"; */ `; const PointText = styled.Text` font-size: 40; font-weight: 600; color: black; `; // Button style const TouchButton = styled.TouchableOpacity` align-items: center; justify-content: center; `; return ( 5 Element Acupuncture Points Generator {point.meridian} {point.pointNumber} handleTouch()}> ); }; export default Home;