mirror of
https://github.com/apache/superset.git
synced 2026-04-22 17:45:21 +00:00
refactor: icon to icons for sqllab (#15593)
* initial commit * rid of theme * Update superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com> * Update superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> * Update superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com> Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com> Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
79d3d06c8a
commit
d8a15e60b9
@@ -17,11 +17,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { t, useTheme } from '@superset-ui/core';
|
||||
import { t, useTheme, styled } from '@superset-ui/core';
|
||||
|
||||
import Button from 'src/components/Button';
|
||||
import withToasts from 'src/messageToasts/enhancers/withToasts';
|
||||
import Icon from 'src/components/Icon';
|
||||
import Icons from 'src/components/Icons';
|
||||
import CopyToClipboard from 'src/components/CopyToClipboard';
|
||||
import { storeQuery } from 'src/utils/common';
|
||||
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
||||
@@ -39,6 +39,16 @@ interface ShareSqlLabQueryPropTypes {
|
||||
addDangerToast: (msg: string) => void;
|
||||
}
|
||||
|
||||
const StyledIcon = styled(Icons.Link)`
|
||||
&:first-of-type {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
svg {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
function ShareSqlLabQuery({
|
||||
queryEditor,
|
||||
addDangerToast,
|
||||
@@ -86,14 +96,12 @@ function ShareSqlLabQuery({
|
||||
: t('Save the query to enable this feature');
|
||||
return (
|
||||
<Button buttonSize="small" tooltip={tooltip} disabled={!canShare}>
|
||||
<Icon
|
||||
name="link"
|
||||
color={
|
||||
<StyledIcon
|
||||
iconColor={
|
||||
canShare ? theme.colors.primary.base : theme.colors.grayscale.base
|
||||
}
|
||||
width={20}
|
||||
height={20}
|
||||
/>{' '}
|
||||
iconSize="xl"
|
||||
/>
|
||||
{t('Copy link')}
|
||||
</Button>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user