Ankilan/src/components/anki-form.jsx

33 lines
913 B
React
Raw Normal View History

2020-03-10 04:22:42 +00:00
import React, {useEffect} from 'react';
import {connect} from 'react-redux';
2020-03-07 14:30:26 +00:00
import DeckPicker from './view/deck-picker';
2020-03-11 03:31:37 +00:00
import {Form, Container, Item} from 'native-base';
2020-03-07 19:38:01 +00:00
import AnkiTemplate from './view/add-main-template';
2020-03-08 11:17:42 +00:00
import {checkAnkiLanModelForExisting} from '../actions/anki-get-actions';
2020-03-11 03:31:37 +00:00
import InputWord from './view/translatable-word';
import SubmitButton from './view/submit-button';
2020-03-07 14:30:26 +00:00
2020-03-08 11:17:42 +00:00
const AnkiForm = props => {
2020-03-10 04:22:42 +00:00
return (
<Container style={{padding: 20}}>
2020-03-11 03:31:37 +00:00
<Form onSubmit={() => alert('hell')}>
2020-03-10 04:22:42 +00:00
<DeckPicker />
2020-03-11 03:31:37 +00:00
<InputWord />
<SubmitButton />
2020-03-10 04:22:42 +00:00
</Form>
</Container>
);
};
2020-03-07 14:30:26 +00:00
2020-03-10 04:22:42 +00:00
export default connect(
state => ({
2020-03-08 11:17:42 +00:00
ankiLanModelExists: state.anki.ankiLanModelIsAlreadyExists,
modelName: state.anki.ankiLanModelName,
modelList: state.anki.modelList,
2020-03-10 04:22:42 +00:00
creator: state.anki.noteCreator,
}),
{
checkAnkiLanModelForExisting,
},
)(AnkiForm);