mirror of
https://github.com/seigler/triplebyte-react-spa
synced 2025-07-26 07:16:10 +00:00
19 lines
465 B
JavaScript
19 lines
465 B
JavaScript
import React from 'react';
|
|
import { useDispatch } from 'react-redux'
|
|
|
|
import { withRedux } from '../lib/redux';
|
|
|
|
const addCard = ({ columnIndex }) => {
|
|
const dispatch = useDispatch();
|
|
return <a onClick={
|
|
() => {
|
|
const userText = window.prompt('New card text:', '(no text)');
|
|
dispatch({ type: 'ADD_CARD', payload: {
|
|
column: columnIndex,
|
|
text: userText
|
|
} });
|
|
}
|
|
}>+ Add a card</a>;
|
|
}
|
|
|
|
export default withRedux(addCard);
|