Skip to content

Commit d63d5b6

Browse files
authored
Merge pull request #1262 from mito-ds/button-alignment
Fix import taskpane button alignment
2 parents 168c750 + e3f96e3 commit d63d5b6

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

mitosheet/src/mito/components/elements/TextButton.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ interface TextButtonProps {
6969
/**
7070
* @param [disabledTooltip] -- Message to display as tooltip when button is disabled
7171
*/
72-
disabledTooltip?: string
72+
disabledTooltip?: string;
73+
74+
style?: React.CSSProperties;
7375
}
7476

7577
/**
@@ -127,6 +129,7 @@ const TextButton = (props: TextButtonProps): JSX.Element => {
127129
disabled={props.disabled}
128130
autoFocus={props.autoFocus}
129131
title={tooltip}
132+
style={props.style}
130133
>
131134
{props.children}
132135
</button>

mitosheet/src/mito/components/import/FileBrowser/FileBrowser.tsx

+6-7
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ function FileBrowser(props: FileBrowserProps): JSX.Element {
168168
<TextButton
169169
variant='light'
170170
width='hug-contents'
171+
style={{ display: 'flex', alignItems: 'center', flexDirection: 'row', width: 'max-content' }}
171172
onClick={() => {
172173
const openCSVImport = async () => {
173174
const filePath = await getFilePath(props.mitoAPI, props.currPathParts, selectedFile);
@@ -185,19 +186,17 @@ function FileBrowser(props: FileBrowserProps): JSX.Element {
185186
}}
186187
disabled={importButtonStatus.disabled}
187188
>
188-
<Row suppressTopBottomMargin justify='space-between' align='center'>
189-
<ConfigureIcon/>
190-
<p className='ml-2px'>
191-
Configure
192-
</p>
193-
</Row>
194-
189+
<ConfigureIcon/>
190+
<p className='ml-2px'>
191+
Configure
192+
</p>
195193
</TextButton>
196194
</Col>
197195
}
198196
<Col style={{ width: '100%' }}>
199197
<TextButton
200198
variant='dark'
199+
width='block'
201200
onClick={() => {
202201
if (isExcelFile(selectedFile)) {
203202
const openExcelImport = async () => {

mitosheet/src/mito/components/layout/Row.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface RowProps {
1616
/**
1717
* @param [justify] - How to justify the Cols inside this row. Defaults to 'start'
1818
*/
19-
justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around',
19+
justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly',
2020
/**
2121
* @param [align] - How to verticaly align the content. Defaults to 'top'
2222
*/

mitosheet/src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpaneFooter.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const DefaultTaskpaneFooter = (
2020
}): JSX.Element => {
2121

2222
return (
23-
<div style={props.ignoreTaskpanePadding ? {margin: ' 0px -10px -7px -10px'} : undefined}> {/** Set a negative margin to escape the footer */}
23+
<div style={props.ignoreTaskpanePadding ? {margin: ' 0px -10px -7px -14px'} : undefined}> {/** Set a negative margin to escape the footer */}
2424
{props.children}
2525
</div>
2626
)

0 commit comments

Comments
 (0)