Skip to content

Commit

Permalink
revert CopyButton styling
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed Jan 10, 2024
1 parent 48a90f2 commit 745a6cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
22 changes: 12 additions & 10 deletions packages/jupyter-ai/src/components/copy-button.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState, useCallback } from 'react';

import Button from '@mui/material/Button';
import { Box, Button } from '@mui/material';

const CC_BTN_CLASS = 'jp-ai-copy-button';
const CC_BTN_CONTAINER_CLASS = 'jp-ai-copy-button-container';
// const CC_BTN_CLASS = 'jp-ai-copy-button';
// const CC_BTN_CONTAINER_CLASS = 'jp-ai-copy-button-container';

enum CopyStatus {
None,
Expand All @@ -12,7 +12,7 @@ enum CopyStatus {
}

const COPYBTN_TEXT_BY_STATUS: Record<CopyStatus, string> = {
[CopyStatus.None]: 'Copy to clipboard',
[CopyStatus.None]: 'Copy To Clipboard',
[CopyStatus.Copying]: 'Copying...',
[CopyStatus.Copied]: 'Copied!'
};
Expand All @@ -39,16 +39,18 @@ export function CopyButton(props: CopyButtonProps): JSX.Element {
}, [props.value]);

return (
<div className={CC_BTN_CONTAINER_CLASS}>
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
<Button
onClick={copy}
className={CC_BTN_CLASS}
variant="outlined"
aria-label="Copy to clipboard"
title="Copy to clipboard"
disabled={copyStatus !== CopyStatus.None}
aria-label="Copy To Clipboard"
sx={{
alignSelf: 'flex-end',
textTransform: 'none'
}}
>
{COPYBTN_TEXT_BY_STATUS[copyStatus]}
</Button>
</div>
</Box>
);
}
1 change: 0 additions & 1 deletion packages/jupyter-ai/style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
@import './expandable-text-field.css';
@import './chat-settings.css';
@import './rendermime-markdown.css';
@import './copy-button.css';
11 changes: 0 additions & 11 deletions packages/jupyter-ai/style/copy-button.css

This file was deleted.

0 comments on commit 745a6cd

Please sign in to comment.