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

Survey #4

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.6.5",
"axios": "^1.6.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.2",
Expand Down
4 changes: 4 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { Route, Routes } from "react-router-dom";

import MainL from "./pages/2.Survey/MainL";
import Main from "./pages/2.Survey/Main";
import SideBar from "./components/SideBar";
import SurveyResult from "./pages/2.Survey/SurveyResult";
Expand All @@ -9,11 +10,13 @@ import Survey from "./pages/2.Survey/Survey";
import SurveyContent from "./pages/2.Survey/SurveyContent";
import SurveyLink from "./pages/2.Survey/SurveyLink";
import SurveyPoint from "./pages/2.Survey/SurveyPoint";
import SurveyFix from './pages/2.Survey/SurveyFix';

function App() {
return (
<>
<Routes>
<Route path="/" element={<MainL/>}/>
<Route path='/main'element={<Main />}/>
<Route path="/survey" element={<Survey />} />
<Route path="/surveyresult" element={<SurveyResult />} />
Expand All @@ -22,6 +25,7 @@ function App() {
<Route path="/surveycontent" element={<SurveyContent />} />
<Route path="/surveypoint" element={<SurveyPoint/>}/>
<Route path="/surveylink" element={<SurveyLink/>}/>
<Route path='/surveyfix' element={<SurveyFix />}/>
</Routes>
<SideBar />
</>
Expand Down
18 changes: 18 additions & 0 deletions src/assets/images/bmarketupload.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/cLinkno.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/dchangeprofile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/BottomSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const InputLabel = styled.p`
color: #000;
text-align: left;
font-family: Poppins;
font-size: 14px;
font-size: 16px;
font-style: normal;
font-weight: 800;
line-height: normal;
Expand Down
22 changes: 18 additions & 4 deletions src/components/SideBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,30 @@ import clickedSurvey from "../assets/images/bmajesticons_paper-fold-line.svg";
import surveyBt from "../assets/images/bmajesticons_paper-fold-line (1).svg";
import clickedMarket from "../assets/images/bclarity_coin-bag-line.svg";
import marketBt from "../assets/images/bclarity_coin-bag-line (1).svg";
import { useState } from "react";
import { useState,useEffect } from "react";
import { useNavigate } from "react-router-dom";
export default function SideBar() {
const [selected, setSelected] = useState("survey");
const [selected, setSelected] = useState("main");
const navigate = useNavigate();

const onButtonClick = (type) => {
setSelected(type);
navigate(type)
navigate(`/${type}`)
};
useEffect(() => {
const pathname = location.pathname;
if (pathname==="/main"){
setSelected("main")
}
else if (pathname==="/survey") {
setSelected("survey");
} else if (pathname==="/market") {
setSelected("market");
}
// 다른 페이지에 따라 필요한 로직 추가

}, [location.pathname]);

if (['/login', '/auth', '/authimg', '/authrule', '/pwfind'].includes(window.location.pathname)) return null;
return (
<BarWrapper>
<Bar onClick={() => onButtonClick("main")} selected={selected === "main"}>
Expand Down Expand Up @@ -45,6 +58,7 @@ export default function SideBar() {
</Bar>
</BarWrapper>
);

}

const BarWrapper = styled.div`
Expand Down
24 changes: 10 additions & 14 deletions src/pages/2.Survey/Main.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import React from 'react'
import styled from 'styled-components';
import { useNavigate } from 'react-router-dom';

export default function SurveyContent() {
export default function Main() {
const navigate=useNavigate();
return(
<All>
<Top>
<Logo></Logo>
<Login><LBtn onClick={()=>alert("로그인")}>로그인</LBtn></Login>
<LBtn onClick={()=>alert("프로필")}></LBtn>
</Top>
<Sset>
<Stitle><B>신규 등록</B> 설문조사</Stitle>
<Sone>
<Stwo>
<Scontent onClick={()=>alert("설문조사 제목 1")}>설문조사 제목 1</Scontent>
<Scontent onClick={()=>alert("설문조사페이지")}>설문조사 제목 1</Scontent>
<Scontent>설문조사 제목 2</Scontent>
<Scontent>설문조사 제목 3</Scontent>
</Stwo>
Expand All @@ -27,7 +29,7 @@ export default function SurveyContent() {
<Stitle><B>신규 판매 등록</B> 설문조사</Stitle>
<Sone>
<Stwo>
<Scontent>설문조사 제목 1</Scontent>
<Scontent onClick={()=>alert("설문조사페이지")}>설문조사 제목 1</Scontent>
<Scontent>설문조사 제목 2</Scontent>
<Scontent>설문조사 제목 3</Scontent>
</Stwo>
Expand Down Expand Up @@ -60,22 +62,16 @@ const Logo = styled.div`
border: none;
display: inline-block;
`
const Login = styled.div`
const LBtn = styled.button`
display: inline-block;
position: absolute;
top: 50%;
margin-top: -15px;
right: 0%;
margin-right: -10px;
`
const LBtn = styled.button`
font-size: 14px;
font-weight: 600;
color: #6046FF;
background: url('src/assets/images/cIcon.svg') no-repeat;
width: 32px;
height: 32px;
border: none;
background-color: white;
width: 55px;
height: 30px;
`
const Sset = styled.div`
padding-top: 4vh;
Expand Down
26 changes: 17 additions & 9 deletions src/pages/2.Survey/MainL.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import React from 'react'
import styled from 'styled-components';
import { useNavigate } from 'react-router-dom';

export default function SurveyContent() {
export default function MainL() {
const navigate=useNavigate();
return(
<All>
<Top>
<Logo></Logo>
<LBtn onClick={()=>alert("프로필")}></LBtn>
<Login><LBtn onClick={()=>navigate("/login")}>로그인</LBtn></Login>
</Top>
<Sset>
<Stitle><B>신규 등록</B> 설문조사</Stitle>
<Sone>
<Sone onClick={()=>navigate("/login")}>
<Stwo>
<Scontent onClick={()=>alert("설문조사 제목 1")}>설문조사 제목 1</Scontent>
<Scontent>설문조사 제목 1</Scontent>
<Scontent>설문조사 제목 2</Scontent>
<Scontent>설문조사 제목 3</Scontent>
</Stwo>
Expand All @@ -25,7 +27,7 @@ export default function SurveyContent() {
</Sset>
<Sset>
<Stitle><B>신규 판매 등록</B> 설문조사</Stitle>
<Sone>
<Sone onClick={()=>navigate("/login")}>
<Stwo>
<Scontent>설문조사 제목 1</Scontent>
<Scontent>설문조사 제목 2</Scontent>
Expand Down Expand Up @@ -60,16 +62,22 @@ const Logo = styled.div`
border: none;
display: inline-block;
`
const LBtn = styled.button`
const Login = styled.div`
display: inline-block;
position: absolute;
top: 50%;
margin-top: -15px;
right: 0%;
background: url('src/assets/images/cIcon.svg') no-repeat;
width: 32px;
height: 32px;
margin-right: -10px;
`
const LBtn = styled.button`
font-size: 14px;
font-weight: 600;
color: #6046FF;
border: none;
background-color: white;
width: 55px;
height: 30px;
`
const Sset = styled.div`
padding-top: 4vh;
Expand Down
Loading