Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Add '선택지 추가' text ui #66

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions frontend/src/pages/ask.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, { useState } from "react";
import { Helmet } from "react-helmet-async";
import { ContentHeader } from "../components/content-header";
import { Fab } from "@material-ui/core";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import styled from "styled-components";
import icon_delete from "../styles/img/icon_delete.svg";

interface IProps {
showDescription?: boolean;
showComeBackDescription?: boolean;
activePageIndex: number;
}

Expand All @@ -14,8 +17,8 @@ export const Ask: React.FC = () => {
const onCurrentPageChange = (pageIndex: number) => {
setCurrentPage(pageIndex);
};
const [showDescription, setShowDescription] = useState(true);
const onClickRemove = () => setShowDescription(false);
const [showComeBackDescription, setShowComeBackDescription] = useState(true);
const onClickRemove = () => setShowComeBackDescription(false);
const [titleText, setTitleText] = useState("");
const onTitleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
if (e.target.value.length > 30) {
Expand Down Expand Up @@ -71,13 +74,20 @@ export const Ask: React.FC = () => {
<ChoiceBox key={choice}>{choice}</ChoiceBox>
))}
</ChoiceBoxes>
<AddChoiceBoxContainer>
<FontAwesomeIcon
icon={faPlus}
style={{ color: "#989898", verticalAlign: "middle", width: "9px", padding: "11px" }}
/>
<AddChoiceBoxText>선택지 추가하기</AddChoiceBoxText>
</AddChoiceBoxContainer>
</PageContainer>
<PageContainer className={currentPage == 4 ? "current" : ""}>
<Question>작성한 글에 어울리는 태그를 붙혀주세요.</Question>
<ShortInput onChange={onTitleInputChange} className={"tag"} />
</PageContainer>
</AskContainer>
{showDescription ? (
{showComeBackDescription ? (
<ComebackDescription>
<span>바로 작성하지 않아도 좋아요. 언제든지 돌아올 수 있어요 :)</span>
<img
Expand Down Expand Up @@ -219,3 +229,17 @@ const ChoiceBox = styled.div`
word-break: keep-all;
text-align: center;
`;

const AddChoiceBoxContainer = styled.div`
color: #989898;
display: flex;
justify-content: center;
align-items: center;
margin-top: 27px;
`;

const AddChoiceBoxText = styled.div`
font-family: "Spoqa Han Sans Neo", "sans-serif";
font-size: 14px;
vertical-align: middle;
`;