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

[FE] Refactor/#628 시맨틱 태그, 웹 표준, 웹 접근성 검토 #629

Merged
merged 30 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8a33ab8
refactor: home 및 layout 시맨틱 태그 수정
semnil5202 Nov 22, 2023
887fa6e
refactor: topicCard 및 Container 시맨틱 태그 수정
semnil5202 Nov 22, 2023
d8c190d
chore: switch default off eslint 설정
semnil5202 Nov 22, 2023
99536c8
refactor: 불필요한 profile img 제거
semnil5202 Nov 22, 2023
62e696b
refactor: banner section 시맨틱 태그 적용
semnil5202 Nov 22, 2023
87d26f7
refactor: 즐겨찾기, 내토픽리스트 시맨틱 태그 적용
semnil5202 Nov 22, 2023
dd2d2d7
refactor: topicInfo 시맨틱 태그 수정
semnil5202 Nov 22, 2023
5a7b491
refactor: Map 시맨틱 태그 수정
semnil5202 Nov 22, 2023
22781fb
refactor: topicCard, Container li 및 article 시맨틱 태그 수정
semnil5202 Nov 22, 2023
605a36b
refactor: 페이지 컴포넌트 시맨틱 태그 일괄 수정
semnil5202 Nov 22, 2023
c230aec
refactor: Search 페이지 layout width 지정 및 nav highlight 수정
semnil5202 Nov 22, 2023
7ac99a7
refactor: PinDetail h2, h3 시맨틱 태그 적용
semnil5202 Nov 22, 2023
eb2d6c3
refactor: Logo aria-label 수정
semnil5202 Nov 23, 2023
2a8bdbd
refactor: Banner aria-label 수정
semnil5202 Nov 23, 2023
e20f8b0
refactor: TopicCard 및 Image 공통 컴포넌트 등 aria-label 수정
semnil5202 Nov 23, 2023
95a4cbe
refactor: topicInfo 접근성 로직 리팩토링
semnil5202 Nov 23, 2023
1873fe8
test: cypress 테스트 data-cy 태그 의존성으로 변경
semnil5202 Nov 23, 2023
a00a904
refactor: PinPreview 및 뽑아오기 접근성 로직 수정
semnil5202 Nov 29, 2023
853781c
refactor: 개발서버 부재에 따른 api 위치 변경
semnil5202 Nov 29, 2023
7f725a8
refactor: URL 주소 공유하기 버튼 접근성 로직 수정
semnil5202 Nov 29, 2023
feffb7c
refactor: pinDetail 및 상세보기 버튼 접근성 로직 추가
semnil5202 Nov 29, 2023
100f4f9
refactor: 댓글 및 답글 접근성 로직 추가
semnil5202 Dec 3, 2023
bc9be16
refactor: 불필요한 console.log 제거
semnil5202 Dec 3, 2023
eec2293
refactor: 지도 추가하기 접근성 로직 수정
semnil5202 Dec 3, 2023
71a560b
refactor: 핀 생성 접근성 로직 수정
semnil5202 Dec 3, 2023
d4147d2
refactor: 각 영역 전체보기 페이지 접근성 로직 수정
semnil5202 Dec 3, 2023
61221a5
refactor: 즐겨찾기 및 나의 지도 접근성 로직 수정
semnil5202 Dec 3, 2023
42a9b76
refactor: 내 정보 컨테이너 접근성 로직 수정
semnil5202 Dec 3, 2023
a2bf4be
refactor: 지도, 핀, 닉네임 수정하기 접근성 로직 추가
semnil5202 Dec 3, 2023
f464444
design: 크로스 브라우징 UI 일관성을 위해 체크 박스 스타일 조정
semnil5202 Dec 3, 2023
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
1 change: 1 addition & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = {
'react/jsx-props-no-spreading': 'off',
'react/no-unused-prop-types': 'off',
'no-underscore-dangle': 'off',
'default-case': 'off',
},
settings: {
'import/resolver': {
Expand Down
4 changes: 1 addition & 3 deletions frontend/cypress/e2e/mapbefine.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ describe('메인 페이지', () => {
});

it('로고와 다양한 지도 소개 글이 보인다.', () => {
cy.get('div[aria-label="괜찮을지도 로고 및 홈으로 이동 버튼"]').should(
'be.visible',
);
cy.get('[data-cy="logo"]').should('be.visible');

cy.contains('인기 급상승할 지도').should('be.visible');
});
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/GlobalStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { createGlobalStyle } from 'styled-components';
const GlobalStyle = createGlobalStyle`
html,
body,
h2,
h3,
textarea{
padding:0;
margin:0;
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/AddFavorite/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { styled } from 'styled-components';

import { deleteApi } from '../../apis/deleteApi';
import { postApi } from '../../apis/postApi';
import { ARIA_FOCUS } from '../../constants';
import useToast from '../../hooks/useToast';

interface AddFavoriteProps {
Expand Down Expand Up @@ -48,7 +49,12 @@ function AddFavorite({
};

return (
<Wrapper onClick={isBookmarked ? deleteFavoriteList : addFavoriteList}>
<Wrapper
tabIndex={ARIA_FOCUS}
role="button"
Comment on lines +53 to +54
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스크린리더에 이로운 role까지 주다니 굿 👍

aria-label="즐겨찾기 추가 버튼"
onClick={isBookmarked ? deleteFavoriteList : addFavoriteList}
>
{children}
</Wrapper>
);
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/AddSeeTogether/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { styled } from 'styled-components';
import { deleteApi } from '../../apis/deleteApi';
import { getApi } from '../../apis/getApi';
import { postApi } from '../../apis/postApi';
import { ARIA_FOCUS } from '../../constants';
import { SeeTogetherContext } from '../../context/SeeTogetherContext';
import useNavigator from '../../hooks/useNavigator';
import useToast from '../../hooks/useToast';
Expand Down Expand Up @@ -108,7 +109,12 @@ function AddSeeTogether({
}

return (
<Wrapper onClick={isInAtlas ? deleteSeeTogether : addSeeTogetherList}>
<Wrapper
tabIndex={ARIA_FOCUS}
role="button"
aria-label="모아보기 추가 버튼"
onClick={isInAtlas ? deleteSeeTogether : addSeeTogetherList}
>
{children}
</Wrapper>
);
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/components/AuthorityRadioContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useContext, useState } from 'react';
import styled from 'styled-components';

import useGet from '../../apiHooks/useGet';
import { ARIA_FOCUS } from '../../constants';
import { ModalContext } from '../../context/ModalContext';
import {
TopicAuthorMember,
Expand Down Expand Up @@ -80,7 +81,7 @@ function AuthorityRadioContainer({
id="publicity-public"
checked={!isPrivate}
onChange={() => setIsPrivate(false)}
tabIndex={4}
tabIndex={ARIA_FOCUS}
/>
<Space size={1} />
<label htmlFor="publicity-public">공개 지도</label>
Expand All @@ -93,7 +94,7 @@ function AuthorityRadioContainer({
id="publicity-private"
checked={isPrivate}
onChange={() => setIsPrivate(true)}
tabIndex={4}
tabIndex={ARIA_FOCUS}
/>
<Space size={1} />
<label htmlFor="publicity-private">비공개 지도</label>
Expand All @@ -115,7 +116,7 @@ function AuthorityRadioContainer({
id="permission-all"
checked={isAllPermissioned}
onChange={onChangeInitAuthMembersWithSetIsAllPermissioned}
tabIndex={5}
tabIndex={ARIA_FOCUS}
/>
<Space size={1} />
{isPrivate ? (
Expand All @@ -135,7 +136,7 @@ function AuthorityRadioContainer({
onClick={() => {
isAllPermissioned === false && openModal('newTopic');
}}
tabIndex={5}
tabIndex={ARIA_FOCUS}
/>
<Space size={1} />
<label htmlFor="permission-group">친구들에게</label>
Expand Down Expand Up @@ -237,7 +238,7 @@ function AuthorityRadioContainer({

<Flex $justifyContent="end" padding="12px" bottom="0px">
<Button
tabIndex={6}
tabIndex={ARIA_FOCUS}
type="button"
variant="secondary"
onClick={() => {
Expand All @@ -252,7 +253,7 @@ function AuthorityRadioContainer({
<Space size={3} />

<Button
tabIndex={6}
tabIndex={ARIA_FOCUS}
variant="primary"
onClick={() => {
closeModal('newTopic');
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/Banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function Banner() {

return (
<Swiper
as="section"
width={1140}
height={400}
$simpleTab
Expand All @@ -38,13 +39,18 @@ export default function Banner() {
width="100%"
src={BannerItemBoongWEBP}
alt="붕어빵 배너"
aria-label="대동붕어빵여지도로 이동"
/>
</Box>
</Tab>
<Tab label="사용법">
<Box cursor="pointer">
<a href={USAGE_URL} target="blank">
<BannerImage src={BannerItemUsageWEBP} alt="사용법 배너" />
<BannerImage
src={BannerItemUsageWEBP}
alt="사용법 배너"
aria-label="새 창을 띄워 사용법 페이지로 이동"
/>
</a>
</Box>
</Tab>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/InputContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function InputContainer({
};

return (
<>
<section>
<Flex>
<Text color="black" $fontSize="default" $fontWeight="normal">
{containerTitle}
Expand Down Expand Up @@ -106,7 +106,7 @@ function InputContainer({
)}
<Space size={0} />
<ErrorText>{errorMessage}</ErrorText>
</>
</section>
);
}
const ErrorText = styled.span`
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Layout/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ function Logo() {
onKeyDown={onElementKeyDown}
ref={elementRef}
onClick={goToHome}
aria-label="괜찮을지도 로고 및 홈으로 이동 버튼"
tabIndex={0}
aria-label="괜찮을지도 로고 및 홈으로 이동하기"
data-cy="logo"
>
<LogoImage />
</Box>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function Layout({ children }: LayoutProps) {
</Box>
</LogoWrapper>
<Flex
as="main"
$flexDirection="column"
height="inherit"
overflow="auto"
Expand All @@ -88,7 +89,7 @@ function Layout({ children }: LayoutProps) {
);
}

const LogoWrapper = styled.section<{
const LogoWrapper = styled.header<{
$layoutWidth: '372px' | '100vw';
}>`
width: 372px;
Expand All @@ -107,7 +108,7 @@ const LogoWrapper = styled.section<{
}
`;

const MediaWrapper = styled.section<{
const MediaWrapper = styled.div<{
$isAddPage: boolean;
$layoutWidth: '372px' | '100vw';
}>`
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function Map() {
);
}

const MapContainer = styled.div`
const MapContainer = styled.section`
width: 100%;
height: 100%;
position: relative;
Expand Down
22 changes: 13 additions & 9 deletions frontend/src/components/MyInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { SyntheticEvent, useState } from 'react';
import { styled } from 'styled-components';

import Setting from '../../assets/updateBtn.svg';
import { DEFAULT_PROD_URL, DEFAULT_PROFILE_IMAGE } from '../../constants';
import {
ARIA_FOCUS,
DEFAULT_PROD_URL,
DEFAULT_PROFILE_IMAGE,
} from '../../constants';
import useToast from '../../hooks/useToast';
import { ProfileProps } from '../../types/Profile';
import Box from '../common/Box';
Expand Down Expand Up @@ -69,8 +73,15 @@ function MyInfo() {
$borderRadius="medium"
$justifyContent="center"
$alignItems="center"
tabIndex={ARIA_FOCUS}
aria-label={`내 정보 영역입니다. 나의 닉네임은 ${user.nickName}이고 이메일은 ${user.email} 입니다.`}
>
<SettingContainer onClick={onClickSetting}>
<SettingContainer
onClick={onClickSetting}
tabIndex={ARIA_FOCUS}
role="button"
aria-label="내 닉네임 수정하기"
>
<Setting />
</SettingContainer>
<Image
Expand Down Expand Up @@ -104,13 +115,6 @@ const MyInfoContainer = styled(Flex)`
border: 1px solid ${({ theme }) => theme.color.lightGray};
`;

const MyInfoImg = styled.img`
width: 80px;
height: 80px;

border-radius: 50%;
`;

const SettingContainer = styled.div`
position: absolute;
top: 10px;
Expand Down
Loading
Loading