Skip to content

Commit

Permalink
Merge pull request #2754 from okauppinen/small-fixes
Browse files Browse the repository at this point in the history
Tooltip remove
  • Loading branch information
ZakarFin authored Dec 2, 2024
2 parents 693a200 + cf9c543 commit eb8fa83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
25 changes: 10 additions & 15 deletions bundles/framework/mydata/view/embedded/SnippetPopup.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Message, Tooltip, CopyField } from 'oskari-ui';
import { Message, CopyField } from 'oskari-ui';
import styled from 'styled-components';
import { SecondaryButton, ButtonContainer, CopyButton } from 'oskari-ui/components/buttons';
import { showPopup } from 'oskari-ui/components/window';
Expand All @@ -16,15 +15,15 @@ const Content = styled.div`
margin: 12px 24px 24px;
`;

const SnippetPopup = ({html, onClose}) => {
const SnippetPopup = ({ html, onClose }) => {
const [highlighted, setHighlighted] = useState(false);

const highlightUrl = () => {
setHighlighted(true);
setTimeout(() => {
setHighlighted(false);
}, 1000);
}
};

return (
<Content>
Expand All @@ -35,16 +34,17 @@ const SnippetPopup = ({html, onClose}) => {
/>
<ButtonContainer>
<SecondaryButton type='cancel' onClick={onClose}/>
<Tooltip title={<Message messageKey={`tabs.publishedmaps.published.copy`} />}>
<CopyButton
value={html}
onClick={() => highlightUrl()}
/>
</Tooltip>
<CopyButton
value={html}
onClick={() => highlightUrl()}/>
</ButtonContainer>
</Content>
);
};
SnippetPopup.propTypes = {
html: PropTypes.string.isRequired,
onClose: PropTypes.func.isRequired
};

export const showSnippetPopup = (view, onClose) => {
const title = <Message messageKey="tabs.publishedmaps.getHTML" bundleKey={BUNDLE_NAME} />;
Expand All @@ -68,9 +68,4 @@ export const showSnippetPopup = (view, onClose) => {
</LocaleProvider>
);
return showPopup(title, content, onClose, POPUP_OPTIONS);
}

showSnippetPopup.propTypes = {
view: PropTypes.object,
onClose: PropTypes.func.isRequired
};
5 changes: 3 additions & 2 deletions src/react/components/Pagination.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { Pagination as AntPagination } from 'antd';

export const Pagination = ({ children, ...other}) => (
<AntPagination { ...other }>
// No tooltip localization default to showTitle false
export const Pagination = ({ children, showTitle = false, ...other}) => (
<AntPagination showTitle={showTitle} { ...other }>
{ children }
</AntPagination>
);

0 comments on commit eb8fa83

Please sign in to comment.