Skip to content

Commit 0fe8c2c

Browse files
2531 fix starter project layout (#2535)
* cosmetic changes in staterproject layout Signed-off-by: msivasubramaniaan <msivasub@redhat.com> * increased width size of the card Signed-off-by: msivasubramaniaan <msivasub@redhat.com> * adjust margin of title and description text Signed-off-by: msivasubramaniaan <msivasub@redhat.com> Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
1 parent 486e4e7 commit 0fe8c2c

File tree

3 files changed

+32
-42
lines changed

3 files changed

+32
-42
lines changed

src/webview/devfile-registry/app/cardItem.style.tsx

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default (theme: Theme) =>
104104
border: '1px solid',
105105
borderColor: 'inherit',
106106
maxHeight: '40rem',
107-
maxWidth: '50rem',
107+
width: '65rem',
108108
margin: 'auto',
109109
overflow: 'auto'
110110
},
@@ -127,13 +127,11 @@ export default (theme: Theme) =>
127127
marginTop: '0.5rem'
128128
},
129129
cardButton: {
130-
display: 'block',
131-
marginTop: '0.3rem',
132-
marginBottom: '0.5rem'
130+
display: 'inline-block'
133131
},
134132
button: {
135133
width: 'auto',
136-
maxHeight: '2rem',
134+
height: '2rem',
137135
textAlign: 'center',
138136
outline: '0.0625rem solid transparent',
139137
outlineOffset: '0.125rem!important',
@@ -176,27 +174,21 @@ export default (theme: Theme) =>
176174
color: 'var(--vscode-foreground)',
177175
backgroundColor: 'var(--vscode-editor-background)',
178176
height: 'auto',
179-
width: '40rem',
180-
zIndex: 1
177+
width: '65rem'
181178
},
182179
devPageCardHeader: {
183180
display: 'block',
184181
height: '3rem',
185182
margin: '0.5rem'
186183
},
187-
devPageCardBody: {
188-
paddingLeft: '0.5rem!important',
189-
width: '100%'
190-
},
191184
starterProjectCard: {
192185
color: 'var(--vscode-foreground)',
193186
backgroundColor: 'var(--vscode-editor-background)',
194187
fontSize: 'var(--vscode-font-size)',
195188
fontFamily: 'var(--vscode-font-family)',
196-
maxWidth: '25rem',
189+
width: '60rem',
197190
maxHeight: '18rem',
198-
margin: 'auto',
199-
overflow: 'hidden',
191+
overflow: 'auto',
200192
border: '1px solid',
201193
borderColor: 'inherit'
202194
},
@@ -206,6 +198,7 @@ export default (theme: Theme) =>
206198
margin: '0.5rem'
207199
},
208200
starterProjectCardBody: {
201+
width: 'auto',
209202
display: 'flex',
210203
borderTop: '1px solid',
211204
borderTopColor: 'inherit',
@@ -233,7 +226,7 @@ export default (theme: Theme) =>
233226
color: 'var(--vscode-list-activeSelectionForeground)',
234227
paddingLeft: '0.5rem',
235228
paddingTop: '0.2rem',
236-
paddingBottom: '0.2rem',
229+
paddingBottom: '0.5rem',
237230
cursor: 'default',
238231
border: '0.5px solid',
239232
borderColor: 'var(--vscode-focusBorder)'
@@ -242,7 +235,7 @@ export default (theme: Theme) =>
242235
width: '95%',
243236
paddingLeft: '0.5rem',
244237
paddingTop: '0.2rem',
245-
paddingBottom: '0.2rem',
238+
paddingBottom: '0.5rem',
246239
cursor: 'default',
247240
backgroundColor: 'var(--vscode-list-focusBackground)',
248241
color: 'var(--vscode-list-focusForeground)',
@@ -252,7 +245,7 @@ export default (theme: Theme) =>
252245
}
253246
},
254247
display: {
255-
width: '40%',
248+
width: '50%',
256249
alignItems: 'center',
257250
marginLeft: 'auto',
258251
marginRight: 'auto',

src/webview/devfile-registry/app/cardItem.tsx

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -190,32 +190,31 @@ export class CardItem extends React.Component<DevFileProps, {
190190
</Text>
191191
</TextContent>
192192
</Button>
193-
</CardActions>
194-
{this.props.hasGitLink && <><CardActions className={this.props.cardItemStyle.cardButton}>
195-
<Button
196-
color='default'
197-
component='span'
198-
className={this.props.cardItemStyle.button}
199-
onClick={this.cloneToWorkSpace}>
200-
<TextContent>
201-
<Text component={TextVariants.h6}>
202-
Clone to Workspace
203-
</Text>
204-
</TextContent>
205-
</Button>
206-
</CardActions><CardActions className={this.props.cardItemStyle.cardButton}>
207-
<Button
193+
{this.props.hasGitLink &&
194+
<><Button
208195
color='default'
196+
variant='contained'
209197
component='span'
210198
className={this.props.cardItemStyle.button}
211-
onClick={this.openInBrowser}>
199+
onClick={this.cloneToWorkSpace}>
212200
<TextContent>
213-
<Text component={TextVariants.h1}>
214-
Open in Browser
201+
<Text component={TextVariants.h6}>
202+
Clone to Workspace
215203
</Text>
216204
</TextContent>
217-
</Button>
218-
</CardActions></>}
205+
</Button><Button
206+
color='default'
207+
variant='contained'
208+
component='span'
209+
className={this.props.cardItemStyle.button}
210+
onClick={this.openInBrowser}>
211+
<TextContent>
212+
<Text component={TextVariants.h6}>
213+
Open in Browser
214+
</Text>
215+
</TextContent>
216+
</Button></>}
217+
</CardActions>
219218
</div>
220219
</div>
221220
</CardBody>
@@ -253,9 +252,7 @@ export class CardItem extends React.Component<DevFileProps, {
253252
</TextContent>
254253
</div>
255254
</CardHeader>
256-
<CardBody className={this.props.cardItemStyle.devPageCardBody}>
257-
{starterProjectCard}
258-
</CardBody>
255+
{starterProjectCard}
259256
</Card>
260257
</CardHeader>
261258
<CardBody className={this.props.cardItemStyle.yamlCardBody}>

src/webview/devfile-registry/app/starterProjectDisplay.style.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { Theme, createStyles } from '@material-ui/core/styles';
88
export default (theme: Theme) =>
99
createStyles({
1010
displayedName: {
11-
margin: '0rem',
11+
margin: '0rem 0.5rem',
1212
marginBottom: '0rem!important'
1313
},
1414
displayedDescription: {
15-
margin: '0rem',
15+
margin: '0rem 0.5rem',
1616
marginBottom: '0rem',
1717
color: '#adabae'
1818
}

0 commit comments

Comments
 (0)