Skip to content

Commit

Permalink
feat(save): move dummy form to component
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhong committed Jul 25, 2019
1 parent f1d07e4 commit 993633f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 42 deletions.
13 changes: 2 additions & 11 deletions app/components/DatasetSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react'
import { Action } from 'redux'
import classNames from 'classnames'
import moment from 'moment'
import SaveForm from './SaveForm'

import { WorkingDataset } from '../models/store'

Expand Down Expand Up @@ -192,17 +193,7 @@ const DatasetSidebar: React.FunctionComponent<DatasetSidebarProps> = (props: Dat
)
}
</div>
<form id='save-form'>
<div className='title'>
<input type='text' name='title' placeholder='Commit message' />
</div>
<div className='message'>
<textarea name='message' placeholder='Detailed description' />
</div>
<div className='submit'>
<input className='submit'type="submit" value="Submit" />
</div>
</form>
<SaveForm />
</div>
)
}
Expand Down
19 changes: 19 additions & 0 deletions app/components/SaveForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react'

export default class SaveForm extends React.Component<{}> {
render () {
return (
<form id='save-form'>
<div className='title'>
<input type='text' name='title' placeholder='Commit message' />
</div>
<div className='message'>
<textarea name='message' placeholder='Detailed description' />
</div>
<div className='submit'>
<input className='submit'type="submit" value="Submit" />
</div>
</form>
)
}
}
31 changes: 0 additions & 31 deletions app/scss/_dataset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -238,37 +238,6 @@ $hover-highlight-color: #F6F8FA;
padding: 6px;
background-color: $hover-highlight-color;
}

#save-form {
background-color: steelblue;
height: 180px;
display: flex;
flex-direction: column;
padding: 6px 0;

input, textarea {
width: 100%;
}

textarea {
vertical-align: top;
resize: none;
height: 100%
}

.title {
padding: $sidebar-item-padding;
}

.message {
flex-grow: 1;
padding: $sidebar-item-padding;
}

.submit {
padding: $sidebar-item-padding;
}
}
}

////////////////////////////
Expand Down
33 changes: 33 additions & 0 deletions app/scss/_saveform.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// TODO import this
$sidebar-item-padding: 6px 10px;

#save-form {
background-color: steelblue;
height: 180px;
display: flex;
flex-direction: column;
padding: 6px 0;

input, textarea {
width: 100%;
}

textarea {
vertical-align: top;
resize: none;
height: 100%
}

.title {
padding: $sidebar-item-padding;
}

.message {
flex-grow: 1;
padding: $sidebar-item-padding;
}

.submit {
padding: $sidebar-item-padding;
}
}
1 change: 1 addition & 0 deletions app/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@import "stylesheet";

@import "dataset-list";
@import "saveform";

@import "dataset";
@import "welcome";
Expand Down

0 comments on commit 993633f

Please sign in to comment.