-
Notifications
You must be signed in to change notification settings - Fork 3
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 #15 from PatrickShaw/responsive-list
The specification list is now more responsive
- Loading branch information
Showing
10 changed files
with
189 additions
and
154 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export interface SDK { | ||
export interface Sdk { | ||
id: number; | ||
name: string; | ||
latestVersion: string; | ||
|
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,9 +1,9 @@ | ||
import { SDK } from './SDK'; | ||
import { Sdk } from 'model/Sdk'; | ||
|
||
export interface Specification { | ||
readonly id: number; // Just an example field. Not necessarily part of Specification | ||
readonly title: string; // Just an example field. Not necessarily part of Specification | ||
readonly description?: string; | ||
readonly path: string; | ||
readonly sdks: SDK[]; | ||
readonly sdks: Sdk[]; | ||
} |
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 was deleted.
Oops, something went wrong.
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,55 @@ | ||
import React, { SFC } from 'react'; | ||
import { Sdk, BuildStatus } from 'model/Sdk'; | ||
import Typography from 'material-ui/Typography'; | ||
import { createStyled } from 'view/createStyled'; | ||
import { BuildStatusChip } from 'basic/BuildStatusChip'; | ||
import Grid from 'material-ui/Grid'; | ||
import { ListItem, ListItemText } from 'material-ui/List'; | ||
import Button from 'material-ui/Button'; | ||
|
||
const Styled: any = createStyled(theme => ({ | ||
sdkItemContainer: { | ||
display: 'flex', | ||
flexGrow: 1, | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
'& > *:not(:first-child)': { | ||
marginLeft: theme.spacing.unit | ||
} | ||
}, | ||
// TODO: Regularly used classes like this should be defined somewhere else | ||
center: { | ||
marginLeft: 'auto', | ||
marginRight: 'auto' | ||
} | ||
})); | ||
|
||
export interface SdkItemProps extends React.DOMAttributes<HTMLDivElement> { | ||
sdk: Sdk; | ||
} | ||
|
||
/** | ||
* Very basic information about a SDK. | ||
* For use in lists, grids, etc. | ||
*/ | ||
|
||
export const SdkItem: SFC<SdkItemProps> = ({ sdk }) => ( | ||
<Styled> | ||
{({ classes }) => ( | ||
<div className={classes.sdkItemContainer}> | ||
<Typography>{sdk.name}</Typography> | ||
<Typography variant="body1" color="textSecondary"> | ||
{sdk.latestVersion} | ||
</Typography> | ||
<div> | ||
<BuildStatusChip buildStatus={sdk.buildStatus} /> | ||
</div> | ||
<div> | ||
<Button disabled={sdk.buildStatus === BuildStatus.RUNNING}> | ||
{sdk.buildStatus === BuildStatus.RUNNING ? 'Running...' : 'Run'} | ||
</Button> | ||
</div> | ||
</div> | ||
)} | ||
</Styled> | ||
); |
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.