diff --git a/frontend/src/assets/grayHighlighter.svg b/frontend/src/assets/grayHighlighter.svg new file mode 100644 index 000000000..251127658 --- /dev/null +++ b/frontend/src/assets/grayHighlighter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/frontend/src/assets/primaryHighlighter.svg b/frontend/src/assets/primaryHighlighter.svg new file mode 100644 index 000000000..23faf8946 --- /dev/null +++ b/frontend/src/assets/primaryHighlighter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/frontend/src/components/highlight/EditSwitchButton/style.ts b/frontend/src/components/highlight/EditSwitchButton/style.ts index 160647eb1..7e1dcc9da 100644 --- a/frontend/src/components/highlight/EditSwitchButton/style.ts +++ b/frontend/src/components/highlight/EditSwitchButton/style.ts @@ -6,7 +6,8 @@ interface EditorSwitchProps { export const EditSwitchButton = styled.button` cursor: pointer; - width: 4rem; + width: 3.5rem; + height: 2rem; padding: 0.5rem; background-color: ${({ theme, $isEditable }) => ($isEditable ? theme.colors.primary : theme.colors.gray)}; @@ -18,8 +19,8 @@ export const EditSwitchButton = styled.button` export const Circle = styled.div` transform: translateX(${({ $isEditable }) => ($isEditable ? 0 : '1.5rem')}); - width: 1.5rem; - height: 1.5rem; + width: 1rem; + height: 1rem; background-color: ${({ theme }) => theme.colors.white}; border-radius: 50%; diff --git a/frontend/src/components/highlight/HighlightEditor/index.tsx b/frontend/src/components/highlight/HighlightEditor/index.tsx index acbf6d298..b62918def 100644 --- a/frontend/src/components/highlight/HighlightEditor/index.tsx +++ b/frontend/src/components/highlight/HighlightEditor/index.tsx @@ -1,5 +1,7 @@ import { useEffect, useRef, useState } from 'react'; +import GrayHighlighterIcon from '@/assets/grayHighlighter.svg'; +import PrimaryHighlighterIcon from '@/assets/primaryHighlighter.svg'; import { EDITOR_ANSWER_CLASS_NAME, EDITOR_LINE_CLASS_NAME, @@ -22,6 +24,16 @@ import HighlightToggleButtonContainer from '../HighlightToggleButtonContainer'; import * as S from './style'; +const MODE_ICON = { + on: { + icon: PrimaryHighlighterIcon, + alt: '형광펜 기능 켜짐', + }, + off: { + icon: GrayHighlighterIcon, + alt: '형광펜 기능 꺼짐', + }, +}; interface HighlightEditorProps { questionId: number; answerList: ReviewAnswerResponseData[]; @@ -94,6 +106,11 @@ const HighlightEditor = ({ questionId, answerList }: HighlightEditorProps) => { return (
+ 형광펜 + {[...editorAnswerMap.values()].map(({ answerId, answerIndex, lineList }) => ( diff --git a/frontend/src/components/highlight/HighlightEditor/style.ts b/frontend/src/components/highlight/HighlightEditor/style.ts index f1069f686..3be605d6a 100644 --- a/frontend/src/components/highlight/HighlightEditor/style.ts +++ b/frontend/src/components/highlight/HighlightEditor/style.ts @@ -2,7 +2,20 @@ import styled from '@emotion/styled'; export const SwitchButtonWrapper = styled.div` display: flex; + gap: 0.5rem; + align-items: center; justify-content: end; + width: 100%; margin-bottom: 1rem; `; + +export const SwitchModIcon = styled.img` + width: 1.6rem; + height: 1.6rem; +`; + +export const HighlightText = styled.span<{ $isEditable: boolean }>` + display: inline-block; + color: ${({ $isEditable, theme }) => ($isEditable ? theme.colors.primary : theme.colors.gray)}; +`;