-
Notifications
You must be signed in to change notification settings - Fork 18
Feature/#144 add download button #145
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
80793b0
73f4fb4
2f70bb8
5343f36
91c5481
c808ae6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export * from './hooks'; | ||
| export * from './global-window'; | ||
| export * from './log-download' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export const handleDownSessionContent = (sessionContent: string) => { | ||
| const element = document.createElement('a'); | ||
| const file = new Blob([sessionContent], { | ||
| type: 'text/plain;charset=utf-8', | ||
| }); | ||
| const dateNow = new Date(Date.now()).toLocaleDateString(); | ||
| element.href = URL.createObjectURL(file); | ||
| element.download = `Codepaster_Session_${dateNow}.txt`; | ||
ortiztena marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| element.click(); | ||
| }; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not using prettier formatting, @manudous will guide you setting up this |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ export const root = css` | |
| grid-column-gap: 1rem; | ||
| padding: 1rem; | ||
|
|
||
|
|
||
| @media (min-width: ${breakpoints.values.md}px) { | ||
| padding: 2rem; | ||
| grid-template-columns: 1fr 6fr 1fr; | ||
|
|
@@ -35,11 +36,13 @@ export const sessionName = css` | |
| `; | ||
|
|
||
| export const label = css` | ||
|
|
||
| display: block; | ||
| font-family: ${typography.fontFamily}; | ||
| font-size: 1.125rem; | ||
| `; | ||
|
|
||
|
|
||
| export const textarea = css` | ||
| box-sizing: border-box; | ||
| padding: ${spacing(2)}; | ||
|
|
@@ -53,3 +56,47 @@ export const textarea = css` | |
| outline: none; | ||
| } | ||
| `; | ||
|
|
||
| export const downButton = css` | ||
| display: flex; | ||
| align-items: left; | ||
| width: 100%; | ||
| padding: ${spacing(1.25)} ${spacing(1.875)}; | ||
| flex: 1; | ||
| font-size: 1.188rem; | ||
| font-weight: 400; | ||
| text-transform: capitalize; | ||
| border-radius: 0; | ||
| color: ${color.blueDark}; | ||
| background-color: white; | ||
| border: 2px solid ${color.blueDark}; | ||
| transition: all 0.2s; | ||
| &:hover, | ||
| &:active { | ||
| color: white; | ||
| background-color: ${color.blueDark}; | ||
| border: 2px solid ${color.blueDark}; | ||
| outline: none; | ||
| } | ||
| @media (min-width: ${breakpoints.values.xs}px) { | ||
|
|
||
| max-width:50%; | ||
|
|
||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be simplified since we are using material ui?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added spacing method instead of "50%" |
||
| `; | ||
|
|
||
| export const downIcon = css` | ||
| margin-right: ${spacing(1.25)}; | ||
| font-size: 1.25rem; | ||
| display: none; | ||
| @media (min-width: ${breakpoints.values.xs}px) { | ||
| display: initial; | ||
| } | ||
| `; | ||
|
|
||
| export const downScroll = css` | ||
| @media (min-width: ${breakpoints.values.xs}px) { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| } | ||
| ` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,3 +118,45 @@ export const undoIcon = css` | |
| display: initial; | ||
| } | ||
| `; | ||
|
|
||
| export const downButton = css` | ||
|
||
|
|
||
| display: flex; | ||
| align-items: center; | ||
| padding: ${spacing(1.25)} ${spacing(1.875)}; | ||
| flex: 1; | ||
| font-size: 1.188rem; | ||
| font-weight: 400; | ||
| text-transform: capitalize; | ||
| border-radius: 0; | ||
| color: ${color.blueDark}; | ||
| background-color: white; | ||
| border: 2px solid ${color.blueDark}; | ||
| transition: all 0.2s; | ||
| &:hover, | ||
| &:active { | ||
| color: white; | ||
| background-color: ${color.blueDark}; | ||
| border: 2px solid ${color.blueDark}; | ||
| outline: none; | ||
| } | ||
| @media (max-width: ${breakpoints.values.xs}px) { | ||
| color: white; | ||
| background-color: ${color.blueDark}; | ||
| border: none; | ||
| &:hover, | ||
| &:active { | ||
| background-color: ${color.blueDark}; | ||
| border: none; | ||
| } | ||
| } | ||
| `; | ||
|
|
||
| export const downIcon = css` | ||
| margin-right: ${spacing(1.25)}; | ||
| font-size: 1.25rem; | ||
| display: none; | ||
| @media (min-width: ${breakpoints.values.xs}px) { | ||
| display: initial; | ||
| } | ||
| `; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather
handleDownloadSessionContent