import * as React from "react" import { ScrollView, StyleProp, Switch, TextStyle, TouchableOpacity, View, ViewStyle, StyleSheet } from "react-native" import { observer } from "mobx-react-lite" import { color, typography } from "../../theme" import { Text } from "../" import { flatten } from "ramda" import Slider from "@react-native-community/slider" import { useState } from "react" import Accordion from 'react-native-collapsible/Accordion' import * as Animatable from 'react-native-animatable' const CONTAINER: ViewStyle = { justifyContent: "center", } const TEXT: TextStyle = { fontFamily: typography.primary, fontSize: 14, color: color.primary, } export interface TweaksProps { /** * An optional style override useful for padding & margin. */ style?: StyleProp physics setPhysics } /** * Describe your component here */ export const Tweaks = observer(function Tweaks(props: TweaksProps): JSX.Element { const { style, physics, setPhysics } = props // const styles = flatten([CONTAINER, style]) const content = [ { title: "Physics", content: { setPhysics({...physics, charge: value}) }} value={physics.charge} step={1}/> { setPhysics({...physics, linkStrength: value}) }} value={physics.linkStrength} step={0.1} /> { setPhysics({...physics, linkIts: value}) }} value={physics.linkIts} step={1}/> {setPhysics({...physics, collision: !physics.collision})}} /> , }, { title: 'Visual', content: { setPhysics({...physics, particles: value}) }} value={physics.particles} step={1}/> , }, { title: 'Modes', content: {setPhysics({...physics, collapse: !physics.collapse})}} /> {setPhysics({...physics, threedim: !physics.threedim})}} /> }, ]; const [activeSections, setActiveSections] = useState([]); const setSections = (sections) => { setActiveSections( sections.includes(undefined) ? [] : sections ); }; const renderHeader = (section, _, isActive) => { return ( {section.title} ); }; const renderContent = (section, _, isActive) => { return ( {section.content} ); } if (true) { return( ) } else { return ( { setPhysics({...physics, charge: value}) }} value={physics.charge} step={1}/> { setPhysics({...physics, linkStrength: value}) }} value={physics.linkStrength} step={0.1} /> { setPhysics({...physics, linkIts: value}) }} value={physics.linkIts} step={1}/> {setPhysics({...physics, collision: !physics.collision})}} /> { setPhysics({...physics, particles: value}) }} value={physics.particles} step={1}/> {setPhysics({...physics, collapse: !physics.collapse})}} /> {setPhysics({...physics, threedim: !physics.threedim})}} /> );} }) const styles = StyleSheet.create ({ container: { flex: 1, backgroundColor: '#F5FCFF', paddingTop: 10, position: "absolute", zIndex: 100, left: 50, top: 50, width: 300, }, title: { textAlign: 'left', fontSize: 22, fontWeight: '300', marginBottom: 20, paddingLeft: 20, }, header: { backgroundColor: '#F5FCFF', padding: 10, textAlign: "left", }, headerText: { textAlign: 'left', paddingLeft: 30, fontSize: 16, fontWeight: '500', }, content: { padding: 20, backgroundColor: '#fff', }, active: { backgroundColor: 'rgba(255,255,255,1)', }, inactive: { backgroundColor: 'rgba(245,252,255,1)', }, selectors: { marginBottom: 10, flexDirection: 'row', justifyContent: 'center', }, selector: { backgroundColor: '#F5FCFF', padding: 10, }, activeSelector: { fontWeight: 'bold', }, selectTitle: { fontSize: 14, fontWeight: '500', padding: 10, }, multipleToggle: { flexDirection: 'row', justifyContent: 'center', marginVertical: 30, alignItems: 'center', }, multipleToggle__title: { fontSize: 16, marginRight: 8, }, });