Skip to content

Commit

Permalink
chore : version 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
halfmoon-mind committed Sep 2, 2023
1 parent 71fdb8a commit bd47df0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "up-d4te",
"version": "1.0.5",
"version": "1.0.6",
"description": "Recommend Dating Course in Korea with CLI",
"author": {
"name": "Sanghyeon Sim",
Expand Down
25 changes: 11 additions & 14 deletions source/component/ShopPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ const ShopPost = ({userId, category, setStoreName}) => {

// menu
const [menuList, setMenuList] = useState([]);
const [menuName, setMenuName] = useState('');
const [menuPrice, setMenuPrice] = useState(0);
const [name, setName] = useState('');
const [price, setPrice] = useState(0);

const [confirmCommand, setConfirmCommand] = useState(''); // 입력 확인
const [isEdit, setIsEdit] = useState(false); // 입력 수정
Expand Down Expand Up @@ -199,8 +199,8 @@ const ShopPost = ({userId, category, setStoreName}) => {
if (key.return) {
if (
lastKeyPress === 'return' ||
menuName.length == 0 ||
menuPrice == 0
name.length == 0 ||
price == 0
) {
setInputStep(prevInputStep => prevInputStep + 1);
setLastKeyPress(null); // reset the last key press
Expand Down Expand Up @@ -263,10 +263,10 @@ const ShopPost = ({userId, category, setStoreName}) => {
const addMenu = () => {
setMenuList([
...menuList,
{name: menuName.split('\\')[0].trim(), price: menuPrice},
{name: name.split('\\')[0].trim(), price: price},
]);
setMenuName(''); // 입력 필드 초기화
setMenuPrice(0); // 입력 필드 초기화
setName(''); // 입력 필드 초기화
setPrice(0); // 입력 필드 초기화
setFocus(0); // 포커스 초기화
};

Expand All @@ -282,9 +282,6 @@ const ShopPost = ({userId, category, setStoreName}) => {
setLongitude(response.data['documents'][0].x);
setPhoneNumber(response.data['documents'][0].phone);
setPlaceUrl(response.data['documents'][0].place_url);
// setLongitude(kakaoShops[0].x);
// setPhoneNumber(kakaoShops[0].phone);
// setPlaceUrl(kakaoShops[0].place_url);
setSelectedShopIndex(0);
};

Expand Down Expand Up @@ -425,14 +422,14 @@ const ShopPost = ({userId, category, setStoreName}) => {
<Box>
<Text>{'{'}"menuName" : "</Text>
<TextInput
value={menuName}
onChange={setMenuName}
value={name}
onChange={setName}
focus={focus == 0}
/>
<Text>", "menuPrice" : </Text>
<TextInput
value={menuPrice.toString()}
onChange={value => setMenuPrice(parseInt(value) || 0)}
value={price.toString()}
onChange={value => setPrice(parseInt(value) || 0)}
focus={focus == 1}
/>
<Text>{'}'}</Text>
Expand Down

0 comments on commit bd47df0

Please sign in to comment.