-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from boostcamp-2020/feature/htmlcss
feat: export 버튼 기능 구현
- Loading branch information
Showing
8 changed files
with
103 additions
and
57 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
79 changes: 45 additions & 34 deletions
79
src/components/LeftSection/InputSelectionSection/InputBottomSelectionSection.tsx
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,36 +1,47 @@ | ||
// import React from 'react'; | ||
// import { | ||
// InputLatexMathTopContent, | ||
// InputLatexMathBottomContent, | ||
// } from '@src/constants/InputSection'; | ||
// import Svg from '@src/components/Common/Svg'; | ||
// import { InputLatexContent } from '@src/components/Common/LatexContent/style'; | ||
// import * as StyledComponent from './style'; | ||
/* eslint-disable react/no-array-index-key */ | ||
import React from 'react'; | ||
import { | ||
InputLatexMathTopContent, | ||
InputLatexMathBottomContent, | ||
} from '@src/constants/InputSection'; | ||
import { LatexContent } from '@src/components/Common/LatexContent'; | ||
|
||
// const InputBottomSelectionSection = () => { | ||
// return ( | ||
// <> | ||
// <StyledComponent.InputBottomSelectionSectionContainer> | ||
// <StyledComponent.InputLatexContainer> | ||
// {InputLatexMathTopContent.map((value, index) => ( | ||
// <InputLatexContent key={`dab${index}`} width="40" height="40"> | ||
// <Svg Svg={value.svg} /> | ||
// </InputLatexContent> | ||
// ))} | ||
// <InputLatexContent width="107" height="40"> | ||
// <StyledComponent.Dictionary>수식 사전</StyledComponent.Dictionary> | ||
// </InputLatexContent> | ||
// </StyledComponent.InputLatexContainer> | ||
// <StyledComponent.InputLatexContainer> | ||
// {InputLatexMathBottomContent.map((value, index) => ( | ||
// <InputLatexContent key={`dab${index}`} width="40" height="40"> | ||
// <Svg Svg={value.svg} /> | ||
// </InputLatexContent> | ||
// ))} | ||
// </StyledComponent.InputLatexContainer> | ||
// </StyledComponent.InputBottomSelectionSectionContainer> | ||
// </> | ||
// ); | ||
// }; | ||
import * as StyledComponent from './style'; | ||
|
||
// export default InputBottomSelectionSection; | ||
const InputBottomSelectionSection = () => { | ||
return ( | ||
<> | ||
<StyledComponent.InputBottomSelectionSectionContainer> | ||
<StyledComponent.InputLatexContainer> | ||
{InputLatexMathTopContent.map((value, index) => ( | ||
<LatexContent | ||
key={`latex-dab${index}`} | ||
svg={value.svg} | ||
latex={value.latex} | ||
name={value.name} | ||
width="40" | ||
height="40" | ||
/> | ||
))} | ||
<StyledComponent.InputLatexContent width="102" height="40"> | ||
<StyledComponent.Dictionary>수식 사전</StyledComponent.Dictionary> | ||
</StyledComponent.InputLatexContent> | ||
</StyledComponent.InputLatexContainer> | ||
<StyledComponent.InputLatexContainer> | ||
{InputLatexMathBottomContent.map((value, index) => ( | ||
<LatexContent | ||
key={`latex-${index}`} | ||
width="40" | ||
height="40" | ||
svg={value.svg} | ||
name={value.name} | ||
latex={value.latex} | ||
/> | ||
))} | ||
</StyledComponent.InputLatexContainer> | ||
</StyledComponent.InputBottomSelectionSectionContainer> | ||
</> | ||
); | ||
}; | ||
|
||
export default InputBottomSelectionSection; |
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const saveAsFile = (str: any, filename: string) => { | ||
const hiddenElement = document.createElement('a'); | ||
hiddenElement.href = `data:attachment/text,${encodeURI(str)}`; | ||
hiddenElement.target = '_blank'; | ||
hiddenElement.download = filename; | ||
hiddenElement.click(); | ||
}; | ||
|
||
export default saveAsFile; |