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

푸터 컴포넌트 ui 작업 #73

Merged
merged 5 commits into from
Oct 27, 2024
Merged
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

/prompt
.env
Empty file removed prompt/.env
Empty file.
3 changes: 3 additions & 0 deletions public/img/footer-01.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 public/img/footer-02.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 public/img/footer-03.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 public/img/footer-04.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/assets/Images/mainManProfile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 13 additions & 17 deletions src/components/Auth/CheckAgreement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import styled from '@emotion/styled';
import Button from '@components/common/Button';
import variables from '@styles/Variables';
import checkArrow from '@assets/Images/checkArrow.svg';
import checkedArrow from '@assets/Images/checkedArrow.svg'; // 체크된 상태의 아이콘

// TODO - 모든 동의가 완료되면 가입이 진행되도록 수정해야함
interface CheckAgreementProps {
submitSignup: () => void | undefined;
onClose?: () => void;
Expand Down Expand Up @@ -34,8 +32,11 @@ const CheckAgreement = ({ submitSignup }: CheckAgreementProps) => {
return (
<BottomSheetContainer isVisible={true}>
<CheckboxAgreeAllbox>
<CheckAgreeAll>
<AllAgreeButton onClick={handleMainCheckboxChange} />
<CheckAgreeAll isChecked={isChecked}>
<AllAgreeButton
onClick={handleMainCheckboxChange}
isChecked={isChecked} // 색상 변경을 위한 상태 전달
/>
<AgreeTitle>약관에 모두 동의</AgreeTitle>
</CheckAgreeAll>
</CheckboxAgreeAllbox>
Expand Down Expand Up @@ -103,29 +104,32 @@ const CheckboxAgreeAllbox = styled.div`
padding-top: ${variables.layoutPadding};
`;

const CheckAgreeAll = styled.div`
border: 1px solid #ddd;
const CheckAgreeAll = styled.div<{ isChecked: boolean }>`
border: 0.1rem solid #ddd;
width: 100%;
height: 6rem;

border-radius: ${variables.borderRadius};
background-color: ${({ isChecked }) =>
isChecked ? `${variables.colors.primarySoft}` : '#fff'}; // 체크된 경우 색상 변경
display: flex;
align-items: center;
padding: 1.2rem;
`;

const AllAgreeButton = styled.div`
const AllAgreeButton = styled.div<{ isChecked: boolean }>`
width: 3.3rem;
height: 3.3rem;
border-radius: 50%;
background-color: #fff;
background-color: ${({ isChecked }) =>
isChecked ? `${variables.colors.primaryStrong}` : '#fff'}; // 체크된 경우 색상 변경
border: 1px solid #ddd;
background-image: url(${checkArrow});
background-position: center;
background-repeat: no-repeat;
cursor: pointer;
`;

// AgreeTitle 스타일
const AgreeTitle = styled.h2`
margin-left: 1.7rem;
font-size: ${variables.size.large};
Expand All @@ -151,14 +155,6 @@ const Checkbox = styled.input`
height: 3.3rem;
margin-right: 1rem;
cursor: pointer;

&:checked {
background-image: url(${checkedArrow});
}

&:not(:checked) {
background-image: url(${checkArrow});
}
`;

const CheckboxLabel = styled.label`
Expand Down
16 changes: 1 addition & 15 deletions src/components/Auth/SetupSubfertility.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const SetupSubfertility = ({ onNext, value, onChange }: SetupSubfertilityProps)
checked={selectedOption === 'true'}
onChange={handleChange}
/>
<CustomRadioButton selected={selectedOption === 'true'} />
네, 진단을 받았어요.
</Label>
<Label>
Expand All @@ -52,7 +51,6 @@ const SetupSubfertility = ({ onNext, value, onChange }: SetupSubfertilityProps)
checked={selectedOption === 'false'}
onChange={handleChange}
/>
<CustomRadioButton selected={selectedOption === 'false'} />
아니요, 진단은 받지 않았어요.
</Label>
</SubfertilityCheckboxContainer>
Expand Down Expand Up @@ -85,7 +83,7 @@ const SubfertilityCheckboxContainer = styled.div`
`;

const SubfertilityCheckbox = styled.input`
display: none !important;
margin-right: 0.5rem; /* 라디오 버튼과 텍스트 사이의 간격 조정 */
`;

const Label = styled.label`
Expand All @@ -94,16 +92,4 @@ const Label = styled.label`
cursor: pointer;
`;

const CustomRadioButton = styled.div<{ selected: boolean }>`
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid ${({ selected }) => (selected ? variables.colors.primary : 'gray')};
background-color: ${({ selected }) => (selected ? variables.colors.primary : 'transparent')};
margin-right: 0.5rem;
transition:
background-color 0.2s,
border-color 0.2s;
`;

export default SetupSubfertility;
69 changes: 50 additions & 19 deletions src/components/common/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
import styled from '@emotion/styled';
import variables from '@styles/Variables';
import React from 'react';
import { Link } from 'react-router-dom';

const Footer = () => {
return (
<FooterContainer>
<FooterNav>
<FooterItem>
<StyledLink to="/users/login">로그인</StyledLink>
<StyledLink to="/home">
<FooterIcon src="/img/footer-01.svg" alt="홈 아이콘" />홈
</StyledLink>
</FooterItem>
<FooterItem>
<StyledLink to="/users/signup">회원가입</StyledLink>
<StyledLink to="/emotion/record">
<FooterIcon src="/img/footer-02.svg" alt="회원가입 아이콘" />
감정기록
</StyledLink>
</FooterItem>
<FooterItem>
<StyledLink to="/counseling">심리 상담</StyledLink>
<StyledLink to="/counseling">
<FooterIcon src="/img/footer-03.svg" alt="심리 상담 아이콘" />
스트레스
</StyledLink>
</FooterItem>
<FooterItem>
<StyledLink to="/emotion/record">감정 기록</StyledLink>
<StyledLink to="/emotion/record">
<FooterIcon src="/img/footer-04.svg" alt="감정 기록 아이콘" />
AI 심리상담
</StyledLink>
</FooterItem>
</FooterNav>
</FooterContainer>
Expand All @@ -27,36 +37,57 @@ const Footer = () => {
const FooterContainer = styled.footer`
position: fixed;
bottom: 0;
width: auto;
height: 8.3rem;
left: ${variables.layoutPadding};
right: ${variables.layoutPadding};
background-color: #f8f9fa;
width: 100%;
margin: calc(-1 * ${variables.layoutPadding});
height: 10rem;
background-color: ${variables.colors.white};
display: flex;
justify-content: center;
border-radius: ${variables.borderRadius};
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
align-items: center;
border-top-left-radius: ${variables.borderRadius}+ 2.2rem;
border-top-right-radius: ${variables.borderRadius}+ 2.2rem;
box-shadow: ${variables.BoxShadow};
@media (min-width: 500px) {
width: 100%;
}
`;

const FooterNav = styled.ul`
list-style: none;
display: flex;
gap: 2rem;
gap: 4rem;
padding: 0;
margin: 0;
`;

const FooterItem = styled.li`
display: inline;
display: flex;
flex-direction: column;
align-items: center;
`;

const FooterIcon = styled.img`
width: 2.4rem;
height: 2.4rem;
transition: filter 0.3s ease;

&:hover,
&:focus {
filter: brightness(0.6) sepia(1) hue-rotate(200deg);
}
`;

const StyledLink = styled(Link)`
text-decoration: none;
color: #007bff;
font-size: 2rem;
&:hover {
text-decoration: underline;
color: #0056b3;
color: ${variables.colors.gray50};
font-size: 1.2rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.6rem;
&:focus {
color: ${variables.colors.primaryStrong};
font-weight: bold;
}
`;

Expand Down
3 changes: 2 additions & 1 deletion src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled from '@emotion/styled';
import CoupleInfomation from '@components/home/CoupleInfomation';

// 홈에서 쓰는 컴포넌트
// <HomePageTitle /> = 제목 컴포넌트 | <CoupleInfomation /> = 부부연동 ,미션 | <Footer> =푸터는 메인에서만 필요해서 호출
// <HomePageTitle /> = 제목 컴포넌트 | <CoupleInfomation /> = 부부연동 ,미션 | <Footer> = 푸터는 메인에서만 필요해서 호출

const Home = () => {
return (
Expand All @@ -24,6 +24,7 @@ const HompageContainer = styled.div`
display: flex;
flex-direction: column;
height: 100vh;
margin-top: 9rem;
`;

const ContentWrapper = styled.div`
Expand Down