Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- feat(storybook) : Added Storybook to the project, it will allow to visually test the Terminal component with different cases. Improvement of the starter folder - feat(styled-components) : Refactored Terminal to have in-JS styling through HOC. simplifies the whole thing and allows a dynamic theming. Avoid having to load a CSS file. - cleanup(Sass) : Removed Sass files and webpack styled loader as they're unecessary now
- Loading branch information
1 parent
dba3014
commit 4a9ea8f
Showing
23 changed files
with
1,501 additions
and
598 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { configure } from '@storybook/react'; | ||
|
||
function loadStories() { | ||
require('../stories'); | ||
} | ||
|
||
configure(loadStories, module); |
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,18 @@ | ||
// you can use this file to add your custom webpack plugins, loaders and anything you like. | ||
// This is just the basic way to add additional webpack configurations. | ||
// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config | ||
|
||
// IMPORTANT | ||
// When you add this file, we won't add the default configurations which is similar | ||
// to "React Create App". This only has babel loader to load JavaScript. | ||
|
||
module.exports = { | ||
plugins: [ | ||
// your custom plugins | ||
], | ||
module: { | ||
loaders: [ | ||
// add your custom loaders. | ||
], | ||
}, | ||
}; |
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,11 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
import styled from 'styled-components'; | ||
|
||
export const TerminalTopBar = styled.div` | ||
height: 30px; | ||
max-width: 600px; | ||
transition: all 0.4s ease-out; | ||
background: ${props => props.theme.barColor}; | ||
display: block; | ||
margin: 0 auto; | ||
`; |
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,70 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const TerminalContainer = styled.div` | ||
display: block; | ||
margin: 0 auto; | ||
`; | ||
|
||
export const TerminalContainerMain = TerminalContainer.extend` | ||
max-width: 600px; | ||
transition: all 0.4s ease-out; | ||
background: ${props => props.theme.backgroundColor}; | ||
max-height: 600px; | ||
height: 100%; | ||
overflow: scroll; | ||
position: relative; | ||
&:focus { | ||
outline: none; | ||
} | ||
`; | ||
|
||
const terminalOutputLineStyle = ` | ||
font-family: 'Inconsolata', monospace; | ||
font-size: 0.9em; | ||
color: green; | ||
margin-top: 10px; | ||
margin-bottom: 10px; | ||
white-space: pre-wrap; | ||
`; | ||
export const TerminalOutputLine = styled.div`${terminalOutputLineStyle}`; | ||
export const PreTerminalOutputLine = styled.pre`${terminalOutputLineStyle}`; | ||
|
||
export const TerminalInput = styled.div` | ||
display: flex; | ||
align-items: center; | ||
padding-top: 15px; | ||
padding-bottom: 15px; | ||
`; | ||
|
||
export const TerminalPrompt = styled.span` | ||
color: ${props => props.theme.prompt}; | ||
`; | ||
|
||
export const TerminalMainInput = styled.input ` | ||
font: inherit; | ||
font-size: 0.9em; | ||
&, &:focus{ | ||
border: none; | ||
padding: 0; | ||
margin: 3px; | ||
background: ${props => props.theme.backgroundColor}; | ||
color: ${props => props.theme.color}; | ||
flex: 1; | ||
outline: none; | ||
} | ||
`; | ||
|
||
export const TerminalHolder = styled.div` | ||
`; | ||
|
||
export const TerminalContent = styled.div` | ||
padding: 5px 20px; | ||
height: 100%; | ||
`; | ||
|
||
export const TerminalInputArea = styled.div` | ||
height: 100%; | ||
padding: 3px; | ||
`; | ||
|
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
Oops, something went wrong.