-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,36 @@ | ||
import { SpeakPracticeProps } from "@type/learning"; | ||
import { speakText } from "@utils/speechUtil"; | ||
import styled from "styled-components"; | ||
import * as S from "./speakPractice.styled"; | ||
|
||
const SpeakPractice = ({ data }: { data: SpeakPracticeProps }) => { | ||
return ( | ||
<Wrapper> | ||
<Title>동화의 핵심 단어에요</Title> | ||
<S.Wrapper> | ||
<S.Title>동화의 핵심 단어에요</S.Title> | ||
{data.words.map((w, idx) => ( | ||
<SpeakBox key={idx}> | ||
<SpeakBtn | ||
<S.SpeakRowBox key={idx}> | ||
<S.SpeakBtn | ||
src="/speaker.png" | ||
onClick={() => speakText(w.word, data.languageId)} | ||
/> | ||
<WordBox>{w.word}</WordBox> | ||
<SubText> {w.mean}</SubText> | ||
</SpeakBox> | ||
<S.WordBox>{w.word}</S.WordBox> | ||
<S.MeanText1> {w.mean}</S.MeanText1> | ||
</S.SpeakRowBox> | ||
))} | ||
<Title>동화의 핵심 문장이에요</Title> | ||
<S.Title>동화의 핵심 문장이에요</S.Title> | ||
{data.sentences.map((s, idx) => ( | ||
<SpeakBox key={idx}> | ||
<SpeakBtn | ||
src="/speaker.png" | ||
onClick={() => speakText(s.sentence, data.languageId)} | ||
/> | ||
<WordBox>{s.sentence}</WordBox> | ||
<SubText> {s.mean}</SubText> | ||
</SpeakBox> | ||
<S.SpeakColumnBox> | ||
<S.SpeakRowBox key={idx}> | ||
<S.SpeakBtn | ||
src="/speaker.png" | ||
onClick={() => speakText(s.sentence, data.languageId)} | ||
/> | ||
<S.WordBox>{s.sentence}</S.WordBox> | ||
</S.SpeakRowBox> | ||
<S.MeanText2> {s.mean}</S.MeanText2> | ||
</S.SpeakColumnBox> | ||
))} | ||
</Wrapper> | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default SpeakPractice; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: 2rem; | ||
width: 100%; | ||
margin-bottom: 2rem; | ||
`; | ||
|
||
const Title = styled.div` | ||
font-size: 2.5rem; | ||
font-weight: 700; | ||
`; | ||
|
||
const SpeakBox = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 1.3rem; | ||
height: fit-content; | ||
`; | ||
|
||
const SpeakBtn = styled.img` | ||
cursor: pointer; | ||
width: 2.2rem; | ||
`; | ||
|
||
const WordBox = styled.div` | ||
font-size: 2.2rem; | ||
font-weight: 700; | ||
border: 1px solid #dcdcdc; | ||
border-radius: 8px; | ||
padding: 1rem 1.5rem; | ||
line-height: 3rem; | ||
`; | ||
|
||
const SubText = styled.div` | ||
font-size: 2rem; | ||
font-weight: 400; | ||
color: #808080; | ||
margin-left: 4rem; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: 2rem; | ||
width: 100%; | ||
margin-bottom: 4rem; | ||
`; | ||
|
||
export const Title = styled.div` | ||
font-size: 2.5rem; | ||
font-weight: 800; | ||
margin-top: 3rem; | ||
`; | ||
|
||
export const SpeakRowBox = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 1rem; | ||
height: fit-content; | ||
`; | ||
|
||
export const SpeakColumnBox = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
height: fit-content; | ||
`; | ||
|
||
export const SpeakBtn = styled.img` | ||
cursor: pointer; | ||
width: 2.2rem; | ||
`; | ||
|
||
export const WordBox = styled.div` | ||
font-size: 2.2rem; | ||
font-weight: 700; | ||
border: 1px solid #dcdcdc; | ||
border-radius: 8px; | ||
padding: 0.8rem 2rem; | ||
line-height: 3rem; | ||
`; | ||
|
||
export const MeanText1 = styled.div` | ||
font-size: 2rem; | ||
font-weight: 400; | ||
color: #808080; | ||
margin-left: 2rem; | ||
`; | ||
export const MeanText2 = styled.div` | ||
font-size: 2rem; | ||
font-weight: 400; | ||
color: #808080; | ||
margin-top: 1rem; | ||
margin-left: 4rem; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,4 +85,7 @@ const Input = styled.input` | |
left: 0; | ||
height: 100%; | ||
background-color: transparent; | ||
&:focus { | ||
outline: none; | ||
} | ||
`; |